Skip to content

Commit 1ec2b3a

Browse files
committed
Expose a few more (bad) ciphers in cipher::Cipher
1 parent d009660 commit 1ec2b3a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

openssl/src/cipher.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,11 @@ impl Cipher {
388388
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_ecb() as *mut _) }
389389
}
390390

391+
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
392+
pub fn camellia128_cbc() -> &'static CipherRef {
393+
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_cbc() as *mut _) }
394+
}
395+
391396
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
392397
pub fn camellia192_cfb128() -> &'static CipherRef {
393398
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cfb128() as *mut _) }
@@ -398,6 +403,11 @@ impl Cipher {
398403
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_ecb() as *mut _) }
399404
}
400405

406+
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
407+
pub fn camellia192_cbc() -> &'static CipherRef {
408+
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cbc() as *mut _) }
409+
}
410+
401411
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
402412
pub fn camellia256_cfb128() -> &'static CipherRef {
403413
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cfb128() as *mut _) }
@@ -408,6 +418,11 @@ impl Cipher {
408418
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_ecb() as *mut _) }
409419
}
410420

421+
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
422+
pub fn camellia256_cbc() -> &'static CipherRef {
423+
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cbc() as *mut _) }
424+
}
425+
411426
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
412427
pub fn cast5_cfb64() -> &'static CipherRef {
413428
unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cfb64() as *mut _) }
@@ -418,6 +433,11 @@ impl Cipher {
418433
unsafe { CipherRef::from_ptr(ffi::EVP_cast5_ecb() as *mut _) }
419434
}
420435

436+
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
437+
pub fn cast5_cbc() -> &'static CipherRef {
438+
unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cbc() as *mut _) }
439+
}
440+
421441
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
422442
pub fn idea_cfb64() -> &'static CipherRef {
423443
unsafe { CipherRef::from_ptr(ffi::EVP_idea_cfb64() as *mut _) }
@@ -428,6 +448,11 @@ impl Cipher {
428448
unsafe { CipherRef::from_ptr(ffi::EVP_idea_ecb() as *mut _) }
429449
}
430450

451+
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
452+
pub fn idea_cbc() -> &'static CipherRef {
453+
unsafe { CipherRef::from_ptr(ffi::EVP_idea_cbc() as *mut _) }
454+
}
455+
431456
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
432457
pub fn chacha20() -> &'static CipherRef {
433458
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }

0 commit comments

Comments
 (0)