Commit 33504058 authored by Zhang Jingqiang's avatar Zhang Jingqiang
Browse files

enable more x509 methods for boringssl

parent e114a6cf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -480,7 +480,7 @@ impl X509Ref {

    /// Retrieves the path length extension from a certificate, if it exists.
    #[corresponds(X509_get_pathlen)]
    #[cfg(ossl110)]
    #[cfg(any(ossl110, boringssl))]
    pub fn pathlen(&self) -> Option<u32> {
        let v = unsafe { ffi::X509_get_pathlen(self.as_ptr()) };
        u32::try_from(v).ok()
@@ -488,7 +488,7 @@ impl X509Ref {

    /// Returns this certificate's subject key id, if it exists.
    #[corresponds(X509_get0_subject_key_id)]
    #[cfg(ossl110)]
    #[cfg(any(ossl110, boringssl))]
    pub fn subject_key_id(&self) -> Option<&Asn1OctetStringRef> {
        unsafe {
            let data = ffi::X509_get0_subject_key_id(self.as_ptr());
@@ -498,7 +498,7 @@ impl X509Ref {

    /// Returns this certificate's authority key id, if it exists.
    #[corresponds(X509_get0_authority_key_id)]
    #[cfg(ossl110)]
    #[cfg(any(ossl110, boringssl))]
    pub fn authority_key_id(&self) -> Option<&Asn1OctetStringRef> {
        unsafe {
            let data = ffi::X509_get0_authority_key_id(self.as_ptr());
+3 −3
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ fn test_subject_alt_name() {
}

#[test]
#[cfg(ossl110)]
#[cfg(any(ossl110, boringssl))]
fn test_retrieve_pathlen() {
    let cert = include_bytes!("../../test/root-ca.pem");
    let cert = X509::from_pem(cert).unwrap();
@@ -188,7 +188,7 @@ fn test_retrieve_pathlen() {
}

#[test]
#[cfg(ossl110)]
#[cfg(any(ossl110, boringssl))]
fn test_subject_key_id() {
    let cert = include_bytes!("../../test/certv3.pem");
    let cert = X509::from_pem(cert).unwrap();
@@ -201,7 +201,7 @@ fn test_subject_key_id() {
}

#[test]
#[cfg(ossl110)]
#[cfg(any(ossl110, boringssl))]
fn test_authority_key_id() {
    let cert = include_bytes!("../../test/certv3.pem");
    let cert = X509::from_pem(cert).unwrap();