From 1ec2b3af013c7d757d4684e783cf20b8fc4a8ca5 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 3 Nov 2023 10:58:32 -0700 Subject: [PATCH] Expose a few more (bad) ciphers in cipher::Cipher --- openssl/src/cipher.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/openssl/src/cipher.rs b/openssl/src/cipher.rs index 892cae1db7..722847b0ef 100644 --- a/openssl/src/cipher.rs +++ b/openssl/src/cipher.rs @@ -388,6 +388,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_ecb() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] + pub fn camellia128_cbc() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_cbc() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] pub fn camellia192_cfb128() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cfb128() as *mut _) } @@ -398,6 +403,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_ecb() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] + pub fn camellia192_cbc() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cbc() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] pub fn camellia256_cfb128() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cfb128() as *mut _) } @@ -408,6 +418,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_ecb() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))] + pub fn camellia256_cbc() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cbc() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_CAST"))] pub fn cast5_cfb64() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cfb64() as *mut _) } @@ -418,6 +433,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_cast5_ecb() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_CAST"))] + pub fn cast5_cbc() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cbc() as *mut _) } + } + #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))] pub fn idea_cfb64() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_idea_cfb64() as *mut _) } @@ -428,6 +448,11 @@ impl Cipher { unsafe { CipherRef::from_ptr(ffi::EVP_idea_ecb() as *mut _) } } + #[cfg(not(osslconf = "OPENSSL_NO_IDEA"))] + pub fn idea_cbc() -> &'static CipherRef { + unsafe { CipherRef::from_ptr(ffi::EVP_idea_cbc() as *mut _) } + } + #[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))] pub fn chacha20() -> &'static CipherRef { unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }