Commit 0d8d5022 authored by Charlie Li's avatar Charlie Li
Browse files

Expose EVP_PKEY_security_bits for LibreSSL 3.6.0 and later

parent e01fbac4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ cfg_if! {
        const_ptr_api! {
            extern "C" {
                pub fn EVP_PKEY_bits(key: #[const_ptr_if(any(ossl110, libressl280))] EVP_PKEY) -> c_int;
                #[cfg(ossl110)]
                #[cfg(any(ossl110, libressl360))]
                pub fn EVP_PKEY_security_bits(pkey: #[const_ptr_if(any(ossl110, libressl280))] EVP_PKEY) -> c_int;
            }
        }
+2 −2
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ where
    ///
    ///Bits of security is defined in NIST SP800-57.
    #[corresponds(EVP_PKEY_security_bits)]
    #[cfg(ossl110)]
    #[cfg(any(ossl110, libressl360))]
    pub fn security_bits(&self) -> u32 {
        unsafe { ffi::EVP_PKEY_security_bits(self.as_ptr()) as u32 }
    }
@@ -1028,7 +1028,7 @@ mod tests {
    }

    #[test]
    #[cfg(ossl110)]
    #[cfg(any(ossl110, libressl360))]
    fn test_security_bits() {
        let group = crate::ec::EcGroup::from_curve_name(crate::nid::Nid::SECP521R1).unwrap();
        let ec_key = EcKey::generate(&group).unwrap();