Skip to content

Commit d771f49

Browse files
committed
Mark add_alias unsafe
1 parent ae60c2f commit d771f49

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

openssl/src/x509/mod.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,12 +843,16 @@ impl X509Extension {
843843
}
844844
}
845845

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-
}
846+
/// Adds an alias for an extension
847+
///
848+
/// This corresponds to [`X509V3_EXT_add_alias`]
849+
///
850+
/// # Safety
851+
///
852+
/// This method modifies global state without locking and therefore is not thread safe
853+
pub unsafe fn add_alias(to: Nid, from: Nid) -> Result<(), ErrorStack> {
854+
ffi::init();
855+
cvt(ffi::X509V3_EXT_add_alias(to.as_raw(), from.as_raw())).map(|_| ())
852856
}
853857
}
854858

0 commit comments

Comments
 (0)