Commit ae60c2f6 authored by Tim Pambor's avatar Tim Pambor
Browse files

Add add_alias method to X509Extension

parent 433f0ecb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ const_ptr_api! {
}

extern "C" {
    pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int;
    pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void;
    pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION;
    pub fn X509V3_add1_i2d(
+8 −0
Original line number Diff line number Diff line
@@ -842,6 +842,14 @@ impl X509Extension {
            cvt_p(ffi::X509V3_EXT_nconf_nid(conf, context, name, value)).map(X509Extension)
        }
    }

    #[corresponds(X509V3_EXT_add_alias)]
    pub fn add_alias(to: Nid, from: Nid) -> Result<(), ErrorStack> {
        unsafe {
            ffi::init();
            cvt(ffi::X509V3_EXT_add_alias(to.as_raw(), from.as_raw())).map(|_| ())
        }
    }
}

/// A builder used to construct an `X509Name`.