Skip to content

Commit a299e5c

Browse files
committed
Resolve OCSP c_ulong flags change
1 parent 99bf95f commit a299e5c

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

openssl-sys/src/ocsp.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ pub const OCSP_REVOKED_STATUS_CESSATIONOFOPERATION: c_int = 5;
1010
pub const OCSP_REVOKED_STATUS_CERTIFICATEHOLD: c_int = 6;
1111
pub const OCSP_REVOKED_STATUS_REMOVEFROMCRL: c_int = 8;
1212

13-
pub const OCSP_NOCERTS: c_int = 0x1;
14-
pub const OCSP_NOINTERN: c_int = 0x2;
15-
pub const OCSP_NOSIGS: c_int = 0x4;
16-
pub const OCSP_NOCHAIN: c_int = 0x8;
17-
pub const OCSP_NOVERIFY: c_int = 0x10;
18-
pub const OCSP_NOEXPLICIT: c_int = 0x20;
19-
pub const OCSP_NOCASIGN: c_int = 0x40;
20-
pub const OCSP_NODELEGATED: c_int = 0x80;
21-
pub const OCSP_NOCHECKS: c_int = 0x100;
22-
pub const OCSP_TRUSTOTHER: c_int = 0x200;
23-
pub const OCSP_RESPID_KEY: c_int = 0x400;
24-
pub const OCSP_NOTIME: c_int = 0x800;
13+
pub const OCSP_NOCERTS: c_ulong = 0x1;
14+
pub const OCSP_NOINTERN: c_ulong = 0x2;
15+
pub const OCSP_NOSIGS: c_ulong = 0x4;
16+
pub const OCSP_NOCHAIN: c_ulong = 0x8;
17+
pub const OCSP_NOVERIFY: c_ulong = 0x10;
18+
pub const OCSP_NOEXPLICIT: c_ulong = 0x20;
19+
pub const OCSP_NOCASIGN: c_ulong = 0x40;
20+
pub const OCSP_NODELEGATED: c_ulong = 0x80;
21+
pub const OCSP_NOCHECKS: c_ulong = 0x100;
22+
pub const OCSP_TRUSTOTHER: c_ulong = 0x200;
23+
pub const OCSP_RESPID_KEY: c_ulong = 0x400;
24+
pub const OCSP_NOTIME: c_ulong = 0x800;
2525

2626
pub const OCSP_RESPONSE_STATUS_SUCCESSFUL: c_int = 0;
2727
pub const OCSP_RESPONSE_STATUS_MALFORMEDREQUEST: c_int = 1;

openssl/src/ocsp.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bitflags::bitflags;
22
use foreign_types::ForeignTypeRef;
3-
use libc::{c_int, c_long};
3+
use libc::{c_int, c_long, c_ulong};
44
use std::mem;
55
use std::ptr;
66

@@ -17,18 +17,18 @@ use openssl_macros::corresponds;
1717
bitflags! {
1818
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1919
#[repr(transparent)]
20-
pub struct OcspFlag: c_int {
21-
const NO_CERTS = ffi::OCSP_NOCERTS;
22-
const NO_INTERN = ffi::OCSP_NOINTERN;
23-
const NO_CHAIN = ffi::OCSP_NOCHAIN;
24-
const NO_VERIFY = ffi::OCSP_NOVERIFY;
25-
const NO_EXPLICIT = ffi::OCSP_NOEXPLICIT;
26-
const NO_CA_SIGN = ffi::OCSP_NOCASIGN;
27-
const NO_DELEGATED = ffi::OCSP_NODELEGATED;
28-
const NO_CHECKS = ffi::OCSP_NOCHECKS;
29-
const TRUST_OTHER = ffi::OCSP_TRUSTOTHER;
30-
const RESPID_KEY = ffi::OCSP_RESPID_KEY;
31-
const NO_TIME = ffi::OCSP_NOTIME;
20+
pub struct OcspFlag: c_ulong {
21+
const NO_CERTS = ffi::OCSP_NOCERTS as c_ulong;
22+
const NO_INTERN = ffi::OCSP_NOINTERN as c_ulong;
23+
const NO_CHAIN = ffi::OCSP_NOCHAIN as c_ulong;
24+
const NO_VERIFY = ffi::OCSP_NOVERIFY as c_ulong;
25+
const NO_EXPLICIT = ffi::OCSP_NOEXPLICIT as c_ulong;
26+
const NO_CA_SIGN = ffi::OCSP_NOCASIGN as c_ulong;
27+
const NO_DELEGATED = ffi::OCSP_NODELEGATED as c_ulong;
28+
const NO_CHECKS = ffi::OCSP_NOCHECKS as c_ulong;
29+
const TRUST_OTHER = ffi::OCSP_TRUSTOTHER as c_ulong;
30+
const RESPID_KEY = ffi::OCSP_RESPID_KEY as c_ulong;
31+
const NO_TIME = ffi::OCSP_NOTIME as c_ulong;
3232
}
3333
}
3434

@@ -169,7 +169,7 @@ impl OcspBasicResponseRef {
169169
self.as_ptr(),
170170
certs.as_ptr(),
171171
store.as_ptr(),
172-
flags.bits().try_into().map_err(|_| ErrorStack::get())?,
172+
flags.bits(),
173173
))
174174
.map(|_| ())
175175
}

0 commit comments

Comments
 (0)