Skip to content

Fix fixes reading public attribute from private object - #4

Open
nb-tech5 wants to merge 5 commits into
mainfrom
fix-fixes-reading-public-attribute-from-private-object
Open

Fix fixes reading public attribute from private object#4
nb-tech5 wants to merge 5 commits into
mainfrom
fix-fixes-reading-public-attribute-from-private-object

Conversation

@nb-tech5

@nb-tech5 nb-tech5 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

nb-tech5 and others added 5 commits June 2, 2026 13:27
According to the PKCS#11 spec, all key objects have defined a semantic
for CKA_START_DATE and CKA_END_DATE, although, for key objects that are
private (e.g. CKO_PRIVATE_KEY, CKO_SECRET_KEY), the retrieval of their
values fail.

This is happening when an attribute with a specialized class, e.g.
P11AttrStartDate, gets added to a private object, its value is always
written in clear, due to the updateAttr method overload, although, upon
retrieving the value, due to the retrieve method not being symmetrically
overloaded, and because the object is private, the attribute value is
decrypted and fails.

This change adds protected virtual method `retrieveAttrByteString` to
allow overloading the default behavior, namely for public attributes
(written in clear), from private object.
Also add a base class `P11NonPrivateAttribute` to be extended by public
attributes specializations.
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.

1 participant