diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2023-06-21 09:33:40 +0200 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2023-06-22 10:02:57 +0200 |
commit | a72b2ac161af29aba4d4a280e65f78fc7b4794fb (patch) | |
tree | 8d495509571547c2f773ee17da46140b5a32dbce /openpgp/src/crypto/backend/openssl | |
parent | 541301698b758732b36fd719edc1f7e768445556 (diff) |
openpgp: Honor `OPENSSL_NO_OCB` build parameter.
- If OpenSSL is built with the `OPENSSL_NO_OCB` directive it will
not have OCB.
- Stop advertising OCB as supported in that case.
- Use GCM as the default algorithm if OCB is not available.
- Tested by appending `println!("cargo:rustc-cfg=osslconf=\"{}\"",
"OPENSSL_NO_OCB");` to build.rs.
- See https://github.com/sfackler/rust-openssl/pull/1952
Diffstat (limited to 'openpgp/src/crypto/backend/openssl')
-rw-r--r-- | openpgp/src/crypto/backend/openssl/aead.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/openssl/aead.rs b/openpgp/src/crypto/backend/openssl/aead.rs index 84ce3c7e..b592e6d8 100644 --- a/openpgp/src/crypto/backend/openssl/aead.rs +++ b/openpgp/src/crypto/backend/openssl/aead.rs @@ -63,6 +63,7 @@ impl AEADAlgorithm { op: CipherOp, ) -> Result<Box<dyn Aead>> { match self { + #[cfg(not(osslconf = "OPENSSL_NO_OCB"))] AEADAlgorithm::OCB => { let cipher = match sym_algo { SymmetricAlgorithm::AES128 => Cipher::aes_128_ocb(), |