summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2020-12-04 10:29:56 -0500
committerGitHub <noreply@github.com>2020-12-04 10:29:56 -0500
commit4d64b75c1581044528e004d8eb0626d72b26adf6 (patch)
treebdfbf73f5e7c9495513a9be297120aed78b5ae5c
parent624effd3a6314ddfa4abbbf3b1eddf414edf8842 (diff)
parent5d14cc5c491fc98ab417935d72d658ef21c8f2c1 (diff)
downloadrust-openssl-4d64b75c1581044528e004d8eb0626d72b26adf6.zip
Merge pull request #1385 from KapJI/openssl-features
Support OPENSSL_NO_RMD160, OPENSSL_NO_CMS, OPENSSL_NO_BF
-rw-r--r--openssl-sys/build/expando.c12
-rw-r--r--openssl/src/hash.rs1
-rw-r--r--openssl/src/lib.rs2
-rw-r--r--openssl/src/symm.rs4
4 files changed, 18 insertions, 1 deletions
diff --git a/openssl-sys/build/expando.c b/openssl-sys/build/expando.c
index c8bfac87..44a7b27f 100644
--- a/openssl-sys/build/expando.c
+++ b/openssl-sys/build/expando.c
@@ -10,10 +10,18 @@ VERSION(LIBRESSL, LIBRESSL_VERSION_NUMBER)
VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
#endif
+#ifdef OPENSSL_NO_BF
+RUST_CONF_OPENSSL_NO_BF
+#endif
+
#ifdef OPENSSL_NO_BUF_FREELISTS
RUST_CONF_OPENSSL_NO_BUF_FREELISTS
#endif
+#ifdef OPENSSL_NO_CMS
+RUST_CONF_OPENSSL_NO_CMS
+#endif
+
#ifdef OPENSSL_NO_COMP
RUST_CONF_OPENSSL_NO_COMP
#endif
@@ -46,6 +54,10 @@ RUST_CONF_OPENSSL_NO_PSK
RUST_CONF_OPENSSL_NO_RFC3779
#endif
+#ifdef OPENSSL_NO_RMD160
+RUST_CONF_OPENSSL_NO_RMD160
+#endif
+
#ifdef OPENSSL_NO_SHA
RUST_CONF_OPENSSL_NO_SHA
#endif
diff --git a/openssl/src/hash.rs b/openssl/src/hash.rs
index 1136b6b1..4f8fe376 100644
--- a/openssl/src/hash.rs
+++ b/openssl/src/hash.rs
@@ -104,6 +104,7 @@ impl MessageDigest {
unsafe { MessageDigest(ffi::EVP_shake256()) }
}
+ #[cfg(not(osslconf = "OPENSSL_NO_RMD160"))]
pub fn ripemd160() -> MessageDigest {
unsafe { MessageDigest(ffi::EVP_ripemd160()) }
}
diff --git a/openssl/src/lib.rs b/openssl/src/lib.rs
index b4e647c0..07ec23c9 100644
--- a/openssl/src/lib.rs
+++ b/openssl/src/lib.rs
@@ -143,7 +143,7 @@ pub mod aes;
pub mod asn1;
pub mod base64;
pub mod bn;
-#[cfg(not(libressl))]
+#[cfg(all(not(libressl), not(osslconf = "OPENSSL_NO_CMS")))]
pub mod cms;
pub mod conf;
pub mod derive;
diff --git a/openssl/src/symm.rs b/openssl/src/symm.rs
index 45c5dd9b..beea446b 100644
--- a/openssl/src/symm.rs
+++ b/openssl/src/symm.rs
@@ -224,18 +224,22 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_aes_256_ocb()) }
}
+ #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
pub fn bf_cbc() -> Cipher {
unsafe { Cipher(ffi::EVP_bf_cbc()) }
}
+ #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
pub fn bf_ecb() -> Cipher {
unsafe { Cipher(ffi::EVP_bf_ecb()) }
}
+ #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
pub fn bf_cfb64() -> Cipher {
unsafe { Cipher(ffi::EVP_bf_cfb64()) }
}
+ #[cfg(not(osslconf = "OPENSSL_NO_BF"))]
pub fn bf_ofb() -> Cipher {
unsafe { Cipher(ffi::EVP_bf_ofb()) }
}