summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Chen <i@harrychen.xyz>2021-03-08 19:19:55 +0800
committerHarry Chen <i@harrychen.xyz>2021-03-08 19:23:07 +0800
commit5c214017e4cba8d2f1ae3df748accfc40b425de9 (patch)
treea524f240d95f2b9c63b262ba744b7218602b29aa
parent44230aff797be3f555752c5d35518616ecba610b (diff)
downloadrust-openssl-5c214017e4cba8d2f1ae3df748accfc40b425de9.zip
Specify libressl version requriement of SM3
Signed-off-by: Harry Chen <i@harrychen.xyz>
-rw-r--r--openssl-sys/src/evp.rs2
-rw-r--r--openssl/src/hash.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/openssl-sys/src/evp.rs b/openssl-sys/src/evp.rs
index 3808c6bf..893e9828 100644
--- a/openssl-sys/src/evp.rs
+++ b/openssl-sys/src/evp.rs
@@ -243,7 +243,7 @@ extern "C" {
#[cfg(ossl111)]
pub fn EVP_shake256() -> *const EVP_MD;
pub fn EVP_ripemd160() -> *const EVP_MD;
- #[cfg(all(ossl111, not(osslconf = "OPENSSL_NO_SM3")))]
+ #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
pub fn EVP_sm3() -> *const EVP_MD;
pub fn EVP_des_ecb() -> *const EVP_CIPHER;
pub fn EVP_des_ede3() -> *const EVP_CIPHER;
diff --git a/openssl/src/hash.rs b/openssl/src/hash.rs
index 30ba8fcf..666022c7 100644
--- a/openssl/src/hash.rs
+++ b/openssl/src/hash.rs
@@ -128,7 +128,7 @@ impl MessageDigest {
unsafe { MessageDigest(ffi::EVP_ripemd160()) }
}
- #[cfg(all(ossl111, not(osslconf = "OPENSSL_NO_SM3")))]
+ #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
pub fn sm3() -> MessageDigest {
unsafe { MessageDigest(ffi::EVP_sm3()) }
}
@@ -631,6 +631,7 @@ mod tests {
}
}
+ #[cfg(all(any(ossl111, libressl291), not(osslconf = "OPENSSL_NO_SM3")))]
#[test]
fn test_sm3() {
let tests = [(