-
Notifications
You must be signed in to change notification settings - Fork 95
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
[Question] Alignment guarantees for CK_ATTRIBUTE #626
Comments
When setting attributes of a p11-kit URI, all attribute values are allocated with |
OK, i. e. for now it is safe. But what about future? Is there some policy in p11-kit that guarantees it won't change? I am going to use this assumption in the code for unlocking a root volume with a PKCS#11 token, and with wrong alignment a system will fail to boot. |
It is unlikely to change, but I don't think that currently there is any policy that guarantees this in p11-kit. We might add a guarantee. I will discuss this with @ueno |
Any decision on this? |
As far as I recall, we reached the consensus that the API should guarantee the alignment. It may not be possible alone, if the applications set arbitrary attribute through |
PKCS#11 2.40 and later describes a CK_ATTRIBUTE in the following way:
And "the application" is defined in the following way:
But API of p11-kit for URIs in the gray zone here, because parsing a PKCS#11 URI does not require to call Cryptoki interface.
So, the question: what alignment guarantees does p11-kit provide for CK_ATTRIBUTEs returned by
p11_kit_uri_get_attributes()
orp11_kit_uri_get_attribute()
? Can I pass these attributes toC_FindObjectsInit()
safely or should I repack them to ensure that *pValue is properly aligned?The text was updated successfully, but these errors were encountered: