Skip to content

Commit c0f1442

Browse files
authored
Merge pull request #2361 from alex/rc2
Expose rc2 ciphers on symm::Cipher
2 parents a4d399b + ae495dc commit c0f1442

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

openssl-sys/build/expando.c

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ RUST_CONF_OPENSSL_NO_PSK
8787
RUST_CONF_OPENSSL_NO_RC4
8888
#endif
8989

90+
#ifdef OPENSSL_NO_RC2
91+
RUST_CONF_OPENSSL_NO_RC2
92+
#endif
93+
9094
#ifdef OPENSSL_NO_RFC3779
9195
RUST_CONF_OPENSSL_NO_RFC3779
9296
#endif

openssl-sys/build/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn check_ssl_kind() {
7474
}
7575

7676
fn main() {
77-
println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_COMP\", \"OPENSSL_NO_SOCK\", \"OPENSSL_NO_STDIO\", \"OPENSSL_NO_EC\", \"OPENSSL_NO_SSL3_METHOD\", \"OPENSSL_NO_KRB5\", \"OPENSSL_NO_TLSEXT\", \"OPENSSL_NO_SRP\", \"OPENSSL_NO_RFC3779\", \"OPENSSL_NO_SHA\", \"OPENSSL_NO_NEXTPROTONEG\", \"OPENSSL_NO_ENGINE\", \"OPENSSL_NO_BUF_FREELISTS\"))");
77+
println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_COMP\", \"OPENSSL_NO_SOCK\", \"OPENSSL_NO_STDIO\", \"OPENSSL_NO_EC\", \"OPENSSL_NO_SSL3_METHOD\", \"OPENSSL_NO_KRB5\", \"OPENSSL_NO_TLSEXT\", \"OPENSSL_NO_SRP\", \"OPENSSL_NO_RFC3779\", \"OPENSSL_NO_SHA\", \"OPENSSL_NO_NEXTPROTONEG\", \"OPENSSL_NO_ENGINE\", \"OPENSSL_NO_BUF_FREELISTS\", \"OPENSSL_NO_RC2\"))");
7878

7979
println!("cargo:rustc-check-cfg=cfg(openssl)");
8080
println!("cargo:rustc-check-cfg=cfg(libressl)");

openssl-sys/src/handwritten/evp.rs

+5
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ extern "C" {
440440
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
441441
pub fn EVP_idea_ofb() -> *const EVP_CIPHER;
442442

443+
#[cfg(not(osslconf = "OPENSSL_NO_RC2"))]
444+
pub fn EVP_rc2_cbc() -> *const EVP_CIPHER;
445+
#[cfg(not(osslconf = "OPENSSL_NO_RC2"))]
446+
pub fn EVP_rc2_40_cbc() -> *const EVP_CIPHER;
447+
443448
#[cfg(not(ossl110))]
444449
pub fn OPENSSL_add_all_algorithms_noconf();
445450

openssl/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use std::env;
88

99
fn main() {
10-
println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_EC\", \"OPENSSL_NO_ARGON2\"))");
10+
println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_EC\", \"OPENSSL_NO_ARGON2\", \"OPENSSL_NO_RC2\"))");
1111

1212
println!("cargo:rustc-check-cfg=cfg(libressl)");
1313
println!("cargo:rustc-check-cfg=cfg(boringssl)");

openssl/src/symm.rs

+10
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,16 @@ impl Cipher {
454454
unsafe { Cipher(ffi::EVP_sm4_ofb()) }
455455
}
456456

457+
#[cfg(not(osslconf = "OPENSSL_NO_RC2"))]
458+
pub fn rc2_cbc() -> Cipher {
459+
unsafe { Cipher(ffi::EVP_rc2_cbc()) }
460+
}
461+
462+
#[cfg(not(osslconf = "OPENSSL_NO_RC2"))]
463+
pub fn rc2_40_cbc() -> Cipher {
464+
unsafe { Cipher(ffi::EVP_rc2_40_cbc()) }
465+
}
466+
457467
/// Creates a `Cipher` from a raw pointer to its OpenSSL type.
458468
///
459469
/// # Safety

0 commit comments

Comments
 (0)