fix: CK_TRUST types on 64-bit systems are ULONG, not u32 as now#361
Open
mingulov wants to merge 1 commit intoparallaxsecond:mainfrom
Open
fix: CK_TRUST types on 64-bit systems are ULONG, not u32 as now#361mingulov wants to merge 1 commit intoparallaxsecond:mainfrom
mingulov wants to merge 1 commit intoparallaxsecond:mainfrom
Conversation
Due to the missing CKT_ mapping at build.rs CK_TRUST types used the default type (u32), despite by the standard they had to be CK_ULONG. Fixed by adding that rule. 1 line is changed (at cryptoki-sys/build.rs), others changes are due to the regeneration. From vendor/pkcs11.h: ULONGDEF(CK_TRUST); ... /* CKT (trust) */ #define CKT_TRUST_UNKNOWN 0x00000000UL #define CKT_TRUSTED 0x00000001UL #define CKT_TRUST_ANCHOR 0x00000002UL #define CKT_NOT_TRUSTED 0x00000003UL #define CKT_TRUST_MUST_VERIFY_TRUST 0x00000004UL Signed-off-by: Denis Mingulov <denis@mingulov.com>
f9602ca to
73b4c4a
Compare
Jakuje
approved these changes
Mar 16, 2026
Collaborator
Jakuje
left a comment
There was a problem hiding this comment.
thank you! I obviously missed this block of constants!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the missing CKT_ mapping at build.rs CK_TRUST types used the default type (u32), despite by the standard they had to be CK_ULONG.
Fixed by adding that rule.
1 line is changed (at cryptoki-sys/build.rs), others changes are due to the regeneration.
From vendor/pkcs11.h:
ULONGDEF(CK_TRUST);
/* CKT (trust) */
#define CKT_TRUST_UNKNOWN 0x00000000UL
#define CKT_TRUSTED 0x00000001UL
#define CKT_TRUST_ANCHOR 0x00000002UL
#define CKT_NOT_TRUSTED 0x00000003UL
#define CKT_TRUST_MUST_VERIFY_TRUST 0x00000004UL