diff options
author | Harry Chen <i@harrychen.xyz> | 2021-03-08 19:19:55 +0800 |
---|---|---|
committer | Harry Chen <i@harrychen.xyz> | 2021-03-08 19:23:07 +0800 |
commit | 5c214017e4cba8d2f1ae3df748accfc40b425de9 (patch) | |
tree | a524f240d95f2b9c63b262ba744b7218602b29aa | |
parent | 44230aff797be3f555752c5d35518616ecba610b (diff) | |
download | rust-openssl-5c214017e4cba8d2f1ae3df748accfc40b425de9.zip |
Specify libressl version requriement of SM3
Signed-off-by: Harry Chen <i@harrychen.xyz>
-rw-r--r-- | openssl-sys/src/evp.rs | 2 | ||||
-rw-r--r-- | openssl/src/hash.rs | 3 |
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 = [( |