diff --git a/build.rs b/build.rs index 4dcc271c..1fae18ce 100644 --- a/build.rs +++ b/build.rs @@ -162,6 +162,7 @@ fn main() { .blocklist_type("CK_FUNCTION_LIST_PTR") .blocklist_type("CK_FUNCTION_LIST_3_0_PTR") .blocklist_type("CK_INTERFACE") + .blocklist_var("CK_UNAVAILABLE_INFORMATION") .parse_callbacks(Box::new(Pkcs11Callbacks)) .generate() .expect("Unable to generate bindings") diff --git a/src/pkcs11/interface.rs b/src/pkcs11/interface.rs index 40997961..463e08fb 100644 --- a/src/pkcs11/interface.rs +++ b/src/pkcs11/interface.rs @@ -6,6 +6,9 @@ include!("bindings.rs"); // types that need different mutability than bindgen provides pub type CK_FUNCTION_LIST_PTR = *const CK_FUNCTION_LIST; pub type CK_FUNCTION_LIST_3_0_PTR = *const CK_FUNCTION_LIST_3_0; +// this is wrongly converted on 32b architecture to too large value +// which can not be represented in CK_ULONG. +pub const CK_UNAVAILABLE_INFORMATION: CK_ULONG = CK_ULONG::MAX; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CK_INTERFACE {