Unverified Commit 4d64b75c authored by Steven Fackler's avatar Steven Fackler Committed by GitHub
Browse files

Merge pull request #1385 from KapJI/openssl-features

Support OPENSSL_NO_RMD160, OPENSSL_NO_CMS, OPENSSL_NO_BF
parents 624effd3 5d14cc5c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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()) }
    }
+1 −1
Original line number Diff line number Diff line
@@ -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;
+4 −0
Original line number Diff line number Diff line
@@ -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()) }
    }