Skip to content

Commit

Permalink
Expose a few more (bad) ciphers in symm::Cipher
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Nov 3, 2023
1 parent 1ec2b3a commit bbbd526
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openssl-sys/src/handwritten/evp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ extern "C" {
pub fn EVP_des_ecb() -> *const EVP_CIPHER;
pub fn EVP_des_ede3() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_cbc() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_ecb() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_cfb64() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_cfb8() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_ofb() -> *const EVP_CIPHER;
pub fn EVP_des_cbc() -> *const EVP_CIPHER;
#[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
pub fn EVP_rc4() -> *const EVP_CIPHER;
Expand Down Expand Up @@ -344,6 +347,7 @@ extern "C" {
pub fn EVP_aes_192_ctr() -> *const EVP_CIPHER;
pub fn EVP_aes_192_ccm() -> *const EVP_CIPHER;
pub fn EVP_aes_192_gcm() -> *const EVP_CIPHER;
pub fn EVP_aes_192_xts() -> *const EVP_CIPHER;
pub fn EVP_aes_192_ofb() -> *const EVP_CIPHER;
#[cfg(ossl110)]
pub fn EVP_aes_192_ocb() -> *const EVP_CIPHER;
Expand Down
18 changes: 18 additions & 0 deletions openssl/src/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_aes_192_cbc()) }
}

#[cfg(not(boringssl))]
pub fn aes_192_xts() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_xts()) }
}

pub fn aes_192_ctr() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_ctr()) }
}
Expand Down Expand Up @@ -278,11 +283,24 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_cbc()) }
}

pub fn des_ede3_ecb() -> Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_ecb()) }
}

#[cfg(not(boringssl))]
pub fn des_ede3_cfb64() -> Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_cfb64()) }
}

#[cfg(not(boringssl))]
pub fn des_ede3_cfb8() -> Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_cfb8()) }
}

pub fn des_ede3_ofb() -> Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_ofb()) }
}

#[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
pub fn rc4() -> Cipher {
unsafe { Cipher(ffi::EVP_rc4()) }
Expand Down

0 comments on commit bbbd526

Please sign in to comment.