Closed InfoHunter closed 3 months ago
It seems Cargo doesn't support dynamic patching for dependencies. So if Tongsuo is selected as the underlying adaptor, one must run the following command to patch openssl
and openssl-sys
to the rust-tongsuo version:
cargo build --features crypto_adaptor_tongsuo \
--no-default-features \
--config 'patch.crates-io.openssl.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"'\
--config 'patch.crates-io.openssl-sys.git="https://github.com/Tongsuo-Project/rust-tongsuo.git"'
Or, just uncomment the following lines in Cargo.toml:
#[patch.crates-io]
#openssl = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }
#openssl-sys = { git = "https://github.com/Tongsuo-Project/rust-tongsuo.git" }
and then:
cargo build --features crypto_adaptor_tongsuo --no-default-features
To use Tongsuo as the underlying cryptography library, the user needs to set a OPENSSL_DIR=/path/to/tongsuo/install/directory
, to indicate where Tongsuo is installed. Currently only Tonsguo 8.4 and later are supported.
some in-code document snips:
Support of public key and digest algorithms will be in a separate pull request.
All have been resolved.
Able to merge subject to CIs are green
This pull request implements the
rusty_vault::modules::crypto
module and relevant cryptography adaptor mechanism. In every build of RustyVault, users can select one of the supported adaptors as the real cryptography operations provider in RustyVault.A set of new feature names are added in Cargo and they can be specified during
cargo build
by:If no adaptor is explicitly configured, then the OpenSSL adaptor is selected by default - for the compatibility considerations.