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

Use thumbprint instead of friendly name for certificate labels. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simonjhaggett
Copy link

Using the friendly name property (CERT_FRIENDLY_NAME_PROP_ID) as the CKA_LABEL
attribute value for a certificate can be problematic, as not all certificates
have a value for this property. This has been seen to cause problems with NSS,
where multiple certificates without friendly names were assigned the same
nickname. This resulted in a browser only being able to access one of the
certificates.

This fix updates p11c_cert_certificate_get_bytes() to report the certificate's
thumbprint instead (provided by the CERT_HASH_PROP_ID property). Thumbprints
are commonly used to identify certificates on Windows systems, and can be
calculated for any certificate (as they are simply a hash).

Signed-off-by: Simon Haggett [email protected]

Using the friendly name property (CERT_FRIENDLY_NAME_PROP_ID) as the CKA_LABEL
attribute value for a certificate can be problematic, as not all certificates
have a value for this property. This has been seen to cause problems with NSS,
where multiple certificates without friendly names were assigned the same
nickname. This resulted in a browser only being able to access one of the
certificates.

This fix updates p11c_cert_certificate_get_bytes() to report the certificate's
thumbprint instead (provided by the CERT_HASH_PROP_ID property). Thumbprints
are commonly used to identify certificates on Windows systems, and can be
calculated for any certificate (as they are simply a hash).

Signed-off-by: Simon Haggett <[email protected]>
@makadizsolt
Copy link

makadizsolt commented Dec 20, 2023

But identifying a certificate by a hash is not really user friendly. Wouldn't it be a better way to only use the thumbprint if the certificate has no friendly name?

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.

2 participants