Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attribute extension defining Unhanled attribute type and EC Kdf improvements #241

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ilkerBaltaci
Copy link

@ilkerBaltaci ilkerBaltaci commented Dec 24, 2024

For undefined attribute types in PKCS#11 spec, I defined Unhandled attribute type to get attribute type value and data value as Vec type. I also change visibility of the struct variables to edit from outside of the module. ECKdf struct edited for defining KDF type and shared value.

İlker BALTACI added 2 commits December 24, 2024 10:49
…anged for KDF type and shared value definition.

Signed-off-by: İlker BALTACI <ilker.baltaci@tubitak.gov.tr>
Signed-off-by: İlker BALTACI <ilker.baltaci@tubitak.gov.tr>
@@ -136,6 +136,8 @@ pub enum AttributeType {
Wrap,
/// Indicates that the key can only be wrapped with a wrapping key that has the Trusted attribute
WrapWithTrusted,
/// Wraps undefined and custom attribute types.
Unhandled(CK_ATTRIBUTE_TYPE),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ilkerBaltaci , thanks for your PR 🙏!

I understand the idea behind the Unhandled types, but I think we strive to only expose in the cryptoki crate idiomatic structures and functions which are safe to use and abstracted away from the raw PKCS11 types. That's summarized in our README:

All the PKCS11 items might not be implemented but everything that is implemented is safe.

I will let other maintainers give their opinions but I think that if you have new types/algos you want to add it's best to do so in the high-level "way" where you add corresponding cryptoki structures/functions for those new types

@@ -1006,6 +1017,8 @@ impl ObjectClass {
pub const MECHANISM: ObjectClass = ObjectClass { val: CKO_MECHANISM };
/// An OTP key object
pub const OTP_KEY: ObjectClass = ObjectClass { val: CKO_OTP_KEY };
/// A profile object
pub const PROFILE: ObjectClass = ObjectClass { val: CKO_PROFILE };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is perfect to add though!

@hug-dev
Copy link
Member

hug-dev commented Dec 25, 2024

I added new EcKdf options here btw, https://github.com/parallaxsecond/rust-cryptoki/pull/239/files! We could add more if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants