Skip to content

Fix fixes reading public attribute from private object - #4

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

nb-tech5 wants to merge 7 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 October 6, 2026 16:31
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.
@nb-tech5
nb-tech5 force-pushed the fix-fixes-reading-public-attribute-from-private-object branch from 9b6d44c to 70e47b0 Compare October 6, 2026 15:32
@nb-tech5
nb-tech5 force-pushed the fix-fixes-reading-public-attribute-from-private-object branch from 1745bb9 to ad5ca5b Compare October 6, 2026 16:31
@nb-tech5
nb-tech5 force-pushed the fix-fixes-reading-public-attribute-from-private-object branch from d05584b to c9661db Compare October 6, 2026 16:43
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