Skip to content

Commit 812b73e

Browse files
author
Georg Weisert
committed
use non-owning X509 where sensible
1 parent 04ceb33 commit 812b73e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openssl/src/x509/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1672,12 +1672,12 @@ impl X509Revoked {
16721672
ffi::d2i_X509_REVOKED
16731673
}
16741674

1675-
pub fn new(to_revoke: &X509) -> Result<Self, ErrorStack> {
1675+
pub fn new(to_revoke: &X509Ref) -> Result<Self, ErrorStack> {
16761676
unsafe { Ok(Self(Self::new_raw(to_revoke)?)) }
16771677
}
16781678

16791679
/// the caller has to ensure the pointer is freed
1680-
unsafe fn new_raw(to_revoke: &X509) -> Result<*mut ffi::X509_REVOKED, ErrorStack> {
1680+
unsafe fn new_raw(to_revoke: &X509Ref) -> Result<*mut ffi::X509_REVOKED, ErrorStack> {
16811681
let result = cvt_p(ffi::X509_REVOKED_new())?;
16821682

16831683
if ffi::X509_REVOKED_set_serialNumber(result, to_revoke.serial_number().as_ptr()) <= 0 {
@@ -1875,7 +1875,7 @@ impl X509Crl {
18751875

18761876
// if not cfg(ossl110) issuer_cert is unused
18771877
#[allow(unused_variables)]
1878-
pub fn new(issuer_cert: &X509, conf: Option<&ConfRef>) -> Result<Self, ErrorStack> {
1878+
pub fn new(issuer_cert: &X509Ref, conf: Option<&ConfRef>) -> Result<Self, ErrorStack> {
18791879
unsafe {
18801880
let crl = Self(cvt_p(ffi::X509_CRL_new())?);
18811881

0 commit comments

Comments
 (0)