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

Returning attributes through GetAttributeValue in certain error scenarios #174

Open
13ajay opened this issue Nov 2, 2023 · 0 comments
Open

Comments

@13ajay
Copy link

13ajay commented Nov 2, 2023

For the C_GetAttributeValue function, the standard states the following:

Note that the error codes CKR_ATTRIBUTE_SENSITIVE, CKR_ATTRIBUTE_TYPE_INVALID, and CKR_BUFFER_TOO_SMALL do not denote true errors for C_GetAttributeValue. If a call to C_GetAttributeValue returns any of these three values, then the call MUST nonetheless have processed every attribute in the template supplied to C_GetAttributeValue. Each attribute in the template whose value can be returned by the call to C_GetAttributeValue will be returned by the call to C_GetAttributeValue.

But based on my reading of the implementation of the wrapper function in this package, regardless of the type of error that is thrown by the C function, if there is one thrown, then the first value returned by GetAttributeValue will be nil. Is my understanding here correct? If so, is that expected? If this package aims to be an implementation of the PKCS#11 API, I think it would be best if it stuck to the standard here.

@13ajay 13ajay changed the title Returning attributes in GetAttributeValue in certain error scenarios Returning attributes through GetAttributeValue in certain error scenarios Nov 2, 2023
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

No branches or pull requests

1 participant