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

Support CKA_PUBLIC_KEY_INFO #759

Open
dengert opened this issue Oct 24, 2024 · 0 comments
Open

Support CKA_PUBLIC_KEY_INFO #759

dengert opened this issue Oct 24, 2024 · 0 comments

Comments

@dengert
Copy link

dengert commented Oct 24, 2024

PKCS11 C_GetAttributeValue for CKA_PUBLIC_KEY_INFO returns with zero length.
This comment appears 3 times in the code: "// TODO: CKA_PUBLIC_KEY_INFO is accepted, but we do not calculate it."
one is here.

The comment: "// i2d_PUBKEY incorrectly does not const the key argument?!" appears here.

https://docs.openssl.org/3.0/man3/X509_PUBKEY_new/ says: "i2d_PUBKEY() encodes an EVP_PKEY structure using SubjectPublicKeyInfo". PKCS11 says: "The value of the CKA_PUBLIC_KEY_INFO attribute is the DER encoded value of SubjectPublicKeyInfo".

https://docs.openssl.org/3.0/man3/X509_PUBKEY_new/#description says: "i2d_PUBKEY() encodes an EVP_PKEY structure using SubjectPublicKeyInfo format."

This should be easy to implement, for a C++ programmer, and it would work on any type of pubkey.

The problems shows up in mods to OpenSC OpenSC/OpenSC#3090 calling the softhsm2 pkcs11 module.

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