Skip to content

Commit

Permalink
Mark add_alias unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
tpambor committed May 30, 2022
1 parent ae60c2f commit d771f49
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,12 +843,16 @@ impl 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(|_| ())
}
/// Adds an alias for an extension
///
/// This corresponds to [`X509V3_EXT_add_alias`]
///
/// # Safety
///
/// This method modifies global state without locking and therefore is not thread safe
pub unsafe fn add_alias(to: Nid, from: Nid) -> Result<(), ErrorStack> {
ffi::init();
cvt(ffi::X509V3_EXT_add_alias(to.as_raw(), from.as_raw())).map(|_| ())
}
}

Expand Down

0 comments on commit d771f49

Please sign in to comment.