Unverified Commit a299e5c0 authored by Sean McGrail's avatar Sean McGrail
Browse files

Resolve OCSP c_ulong flags change

parent 99bf95f0
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -10,18 +10,18 @@ pub const OCSP_REVOKED_STATUS_CESSATIONOFOPERATION: c_int = 5;
pub const OCSP_REVOKED_STATUS_CERTIFICATEHOLD: c_int = 6;
pub const OCSP_REVOKED_STATUS_REMOVEFROMCRL: c_int = 8;

pub const OCSP_NOCERTS: c_int = 0x1;
pub const OCSP_NOINTERN: c_int = 0x2;
pub const OCSP_NOSIGS: c_int = 0x4;
pub const OCSP_NOCHAIN: c_int = 0x8;
pub const OCSP_NOVERIFY: c_int = 0x10;
pub const OCSP_NOEXPLICIT: c_int = 0x20;
pub const OCSP_NOCASIGN: c_int = 0x40;
pub const OCSP_NODELEGATED: c_int = 0x80;
pub const OCSP_NOCHECKS: c_int = 0x100;
pub const OCSP_TRUSTOTHER: c_int = 0x200;
pub const OCSP_RESPID_KEY: c_int = 0x400;
pub const OCSP_NOTIME: c_int = 0x800;
pub const OCSP_NOCERTS: c_ulong = 0x1;
pub const OCSP_NOINTERN: c_ulong = 0x2;
pub const OCSP_NOSIGS: c_ulong = 0x4;
pub const OCSP_NOCHAIN: c_ulong = 0x8;
pub const OCSP_NOVERIFY: c_ulong = 0x10;
pub const OCSP_NOEXPLICIT: c_ulong = 0x20;
pub const OCSP_NOCASIGN: c_ulong = 0x40;
pub const OCSP_NODELEGATED: c_ulong = 0x80;
pub const OCSP_NOCHECKS: c_ulong = 0x100;
pub const OCSP_TRUSTOTHER: c_ulong = 0x200;
pub const OCSP_RESPID_KEY: c_ulong = 0x400;
pub const OCSP_NOTIME: c_ulong = 0x800;

pub const OCSP_RESPONSE_STATUS_SUCCESSFUL: c_int = 0;
pub const OCSP_RESPONSE_STATUS_MALFORMEDREQUEST: c_int = 1;
+14 −14
Original line number Diff line number Diff line
use bitflags::bitflags;
use foreign_types::ForeignTypeRef;
use libc::{c_int, c_long};
use libc::{c_int, c_long, c_ulong};
use std::mem;
use std::ptr;

@@ -17,18 +17,18 @@ use openssl_macros::corresponds;
bitflags! {
    #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
    #[repr(transparent)]
    pub struct OcspFlag: c_int {
        const NO_CERTS = ffi::OCSP_NOCERTS;
        const NO_INTERN = ffi::OCSP_NOINTERN;
        const NO_CHAIN = ffi::OCSP_NOCHAIN;
        const NO_VERIFY = ffi::OCSP_NOVERIFY;
        const NO_EXPLICIT = ffi::OCSP_NOEXPLICIT;
        const NO_CA_SIGN = ffi::OCSP_NOCASIGN;
        const NO_DELEGATED = ffi::OCSP_NODELEGATED;
        const NO_CHECKS = ffi::OCSP_NOCHECKS;
        const TRUST_OTHER = ffi::OCSP_TRUSTOTHER;
        const RESPID_KEY = ffi::OCSP_RESPID_KEY;
        const NO_TIME = ffi::OCSP_NOTIME;
    pub struct OcspFlag: c_ulong {
        const NO_CERTS = ffi::OCSP_NOCERTS as c_ulong;
        const NO_INTERN = ffi::OCSP_NOINTERN as c_ulong;
        const NO_CHAIN = ffi::OCSP_NOCHAIN as c_ulong;
        const NO_VERIFY = ffi::OCSP_NOVERIFY as c_ulong;
        const NO_EXPLICIT = ffi::OCSP_NOEXPLICIT as c_ulong;
        const NO_CA_SIGN = ffi::OCSP_NOCASIGN as c_ulong;
        const NO_DELEGATED = ffi::OCSP_NODELEGATED as c_ulong;
        const NO_CHECKS = ffi::OCSP_NOCHECKS as c_ulong;
        const TRUST_OTHER = ffi::OCSP_TRUSTOTHER as c_ulong;
        const RESPID_KEY = ffi::OCSP_RESPID_KEY as c_ulong;
        const NO_TIME = ffi::OCSP_NOTIME as c_ulong;
    }
}

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