Skip to content

Commit

Permalink
Merge pull request #1910 from oskirby/conditional-rc4-check
Browse files Browse the repository at this point in the history
Check for OPENSSL_NO_RC4 when using EVP_rc4
  • Loading branch information
sfackler committed Apr 26, 2023
2 parents e96adda + 34260b8 commit 03abc17
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openssl-sys/build/expando.c
Expand Up @@ -79,6 +79,10 @@ RUST_CONF_OPENSSL_NO_OCSP
RUST_CONF_OPENSSL_NO_PSK
#endif

#ifdef OPENSSL_NO_RC4
RUST_CONF_OPENSSL_NO_RC4
#endif

#ifdef OPENSSL_NO_RFC3779
RUST_CONF_OPENSSL_NO_RFC3779
#endif
Expand Down
1 change: 1 addition & 0 deletions openssl-sys/src/handwritten/evp.rs
Expand Up @@ -311,6 +311,7 @@ extern "C" {
pub fn EVP_des_ede3_cbc() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_cfb64() -> *const EVP_CIPHER;
pub fn EVP_des_cbc() -> *const EVP_CIPHER;
#[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
pub fn EVP_rc4() -> *const EVP_CIPHER;
pub fn EVP_bf_ecb() -> *const EVP_CIPHER;
pub fn EVP_bf_cbc() -> *const EVP_CIPHER;
Expand Down
1 change: 1 addition & 0 deletions openssl/src/cipher.rs
Expand Up @@ -324,6 +324,7 @@ impl Cipher {
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb64() as *mut _) }
}

#[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
pub fn rc4() -> &'static CipherRef {
unsafe { CipherRef::from_ptr(ffi::EVP_rc4() as *mut _) }
}
Expand Down
1 change: 1 addition & 0 deletions openssl/src/symm.rs
Expand Up @@ -283,6 +283,7 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_cfb64()) }
}

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

0 comments on commit 03abc17

Please sign in to comment.