Skip to content

Commit

Permalink
Merge pull request #220 from larper2axis/main
Browse files Browse the repository at this point in the history
Support vendor extensions for CK_USER_TYPE
  • Loading branch information
hug-dev committed Sep 6, 2024
2 parents 29378dc + 283c1bb commit e57920a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cryptoki/src/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,19 @@ pub enum UserType {
User,
/// Context Specific
ContextSpecific,
/// Vendor extension
VendorExtension(u32),
}

impl From<UserType> for CK_USER_TYPE {
// Mask lint for n.into() on 32-bit systems.
#![allow(clippy::useless_conversion)]
fn from(user_type: UserType) -> CK_USER_TYPE {
match user_type {
UserType::So => CKU_SO,
UserType::User => CKU_USER,
UserType::ContextSpecific => CKU_CONTEXT_SPECIFIC,
UserType::VendorExtension(n) => n.into(),
}
}
}

0 comments on commit e57920a

Please sign in to comment.