Skip to content

Commit ae60c2f

Browse files
committed
Add add_alias method to X509Extension
1 parent 433f0ec commit ae60c2f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

openssl-sys/src/handwritten/x509v3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const_ptr_api! {
7878
}
7979

8080
extern "C" {
81+
pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int;
8182
pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void;
8283
pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION;
8384
pub fn X509V3_add1_i2d(

openssl/src/x509/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,14 @@ impl X509Extension {
842842
cvt_p(ffi::X509V3_EXT_nconf_nid(conf, context, name, value)).map(X509Extension)
843843
}
844844
}
845+
846+
#[corresponds(X509V3_EXT_add_alias)]
847+
pub fn add_alias(to: Nid, from: Nid) -> Result<(), ErrorStack> {
848+
unsafe {
849+
ffi::init();
850+
cvt(ffi::X509V3_EXT_add_alias(to.as_raw(), from.as_raw())).map(|_| ())
851+
}
852+
}
845853
}
846854

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

0 commit comments

Comments
 (0)