summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend
diff options
context:
space:
mode:
authorWiktor Kwapisiewicz <wiktor@metacode.biz>2023-01-19 11:34:15 +0100
committerWiktor Kwapisiewicz <wiktor@metacode.biz>2023-03-20 08:01:35 +0100
commit8e6e7a080dc4b581504b7c71357678bb5ece7a8d (patch)
tree26e62059ac8874199231eb1738f1063f519f52eb /openpgp/src/crypto/backend
parentc1a3ef8c539845dc13d8bf91211970c227636881 (diff)
openpgp: Add check for CAST5.
- OpenSSL can be compiled with no support for CAST5. - This will be indicated by setting `osslconf` variable to `OPENSSL_NO_CAST`. - See https://github.com/sfackler/rust-openssl/pull/1786
Diffstat (limited to 'openpgp/src/crypto/backend')
-rw-r--r--openpgp/src/crypto/backend/openssl/symmetric.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/openssl/symmetric.rs b/openpgp/src/crypto/backend/openssl/symmetric.rs
index 4f68fa0e..605d7533 100644
--- a/openpgp/src/crypto/backend/openssl/symmetric.rs
+++ b/openpgp/src/crypto/backend/openssl/symmetric.rs
@@ -160,6 +160,7 @@ impl SymmetricAlgorithm {
#[cfg(not(osslconf = "OPENSSL_NO_BF"))]
SymmetricAlgorithm::Blowfish => Cipher::bf_cfb64(),
+ #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
SymmetricAlgorithm::CAST5 => Cipher::cast5_cfb64(),
_ => return Err(Error::UnsupportedSymmetricAlgorithm(self))?,
})
@@ -186,6 +187,7 @@ impl SymmetricAlgorithm {
#[cfg(not(osslconf = "OPENSSL_NO_BF"))]
SymmetricAlgorithm::Blowfish => Cipher::bf_ecb(),
+ #[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
SymmetricAlgorithm::CAST5 => Cipher::cast5_ecb(),
_ => Err(Error::UnsupportedSymmetricAlgorithm(self))?,
})