Skip to content

Commit 9cf4429

Browse files
committed
fix c related integer issues
1 parent 57e376a commit 9cf4429

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

openssl/src/x509/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,10 @@ impl X509Crl {
18521852
pub fn new(issuer_cert: &X509) -> Result<Self, ErrorStack> {
18531853
unsafe {
18541854
let crl = cvt_p(ffi::X509_CRL_new())?;
1855-
cvt(ffi::X509_CRL_set_version(crl, issuer_cert.version() as i64))?;
1855+
cvt(ffi::X509_CRL_set_version(
1856+
crl,
1857+
issuer_cert.version() as c_long,
1858+
))?;
18561859
cvt(ffi::X509_CRL_set_issuer_name(
18571860
crl,
18581861
issuer_cert.issuer_name().as_ptr(),
@@ -1939,7 +1942,8 @@ impl X509Crl {
19391942
ffi::NID_crl_number,
19401943
std::mem::transmute(value.as_ptr()),
19411944
0,
1942-
ffi::X509V3_ADD_REPLACE,
1945+
#[allow(clippy::useless_conversion)]
1946+
ffi::X509V3_ADD_REPLACE.try_into().expect("This is an openssl flag and should therefore always fit into the expected integer type"),
19431947
))
19441948
.map(|_| ())
19451949
}

0 commit comments

Comments
 (0)