Skip to content

Commit e57920a

Browse files
authored
Merge pull request #220 from larper2axis/main
Support vendor extensions for CK_USER_TYPE
2 parents 29378dc + 283c1bb commit e57920a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cryptoki/src/session/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,19 @@ pub enum UserType {
9090
User,
9191
/// Context Specific
9292
ContextSpecific,
93+
/// Vendor extension
94+
VendorExtension(u32),
9395
}
9496

9597
impl From<UserType> for CK_USER_TYPE {
98+
// Mask lint for n.into() on 32-bit systems.
99+
#![allow(clippy::useless_conversion)]
96100
fn from(user_type: UserType) -> CK_USER_TYPE {
97101
match user_type {
98102
UserType::So => CKU_SO,
99103
UserType::User => CKU_USER,
100104
UserType::ContextSpecific => CKU_CONTEXT_SPECIFIC,
105+
UserType::VendorExtension(n) => n.into(),
101106
}
102107
}
103108
}

0 commit comments

Comments
 (0)