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

Enable support for Rfc7512 token serial strings AND allow the old original token serial string scheme to be used #72

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

inorton-entrust
Copy link

@inorton-entrust inorton-entrust commented Feb 17, 2025

By setting PKCS11H_TOKEN_SERIALIZE_FORMAT=legacy token serials are formatted and searched for using the original pkcs11-helper string values. If unset or set to uri RFC7512 is used instead.

This change allows me to build pkcs11-helper from source and still use my pre-existing gpg keys created on Centos etc after RFC5712 support was added to Redhat versions of the library.

David Woodhouse and others added 7 commits October 1, 2024 19:04
We are going to want to use this for parsing %XX hex escapes in RFC7512
PKCS#11 URIs, where we cannot expect a trailing NUL. Since there's only
one existing caller at the moment, it's simple just to let the caller
have responsibility for that check.

Signed-off-by: David Woodhouse <[email protected]>
… IDs

The old format is still accepted for compatibility.

Signed-off-by: David Woodhouse <[email protected]>
It's a limitation of the core pkcs11-helper token matching code that we
need to specify *all* of model=, token=, manufacturer= and serial=. This
was true of the legacy serialization format, so it isn't a regression.

At least it *wouldn't* have been, if we it had distinguished between an
*explicit* "model=" parameter, and the model not being specified at all.
Thus https://bugzilla.redhat.com/show_bug.cgi?id=2298882

The requirement for all four token fields to be specified does mean that
applications using pkcs11-helper aren't *quite* as versatile and user
friendly as something which implements the full search algorithm shown in
§8 of http://david.woodhou.se/draft-woodhouse-cert-best-practice.html by
first searching for the specified certificate in all tokens without a login,
then only logging into the token in which the *certificate* was found, to
access the key. But that's OK, and something we can improve on later. It's
not a barrier to using the RFC7512 URI format in place of the legacy
serialization format.
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