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

export-object: Recover public key from algorithm specific attributes #568

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

ueno
Copy link
Member

@ueno ueno commented Sep 21, 2023

Some tokens such as SoftHSMv2 omit CKA_PUBLIC_KEY_INFO when it can be derived from algorithm specific attributes, such as CKA_MODULUS and CKA_PUBLIC_EXPONENT for RSA. This adds support for it if libtasn1 is available at compile time.

Fixes: #555

@ueno ueno force-pushed the wip/dueno/pubkey branch 2 times, most recently from e4567cf to 746ee29 Compare September 21, 2023 12:15
@coveralls
Copy link

coveralls commented Sep 21, 2023

Coverage Status

coverage: 68.851% (-0.03%) from 68.882% when pulling 652c115 on ueno:wip/dueno/pubkey into e8872bf on p11-glue:master.

@ueno ueno force-pushed the wip/dueno/pubkey branch 10 times, most recently from 56a937c to f993b82 Compare September 22, 2023 03:09
@ueno ueno marked this pull request as ready for review September 22, 2023 03:10
@ueno ueno force-pushed the wip/dueno/pubkey branch 2 times, most recently from 9932011 to 590b4af Compare September 22, 2023 06:34
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Copy link
Contributor

@ZoltanFridrich ZoltanFridrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some small things, other then that looks good.

p11-kit/export-object.c Show resolved Hide resolved
p11-kit/export-object.c Outdated Show resolved Hide resolved
p11-kit/export-object.c Outdated Show resolved Hide resolved
p11-kit/export-object.c Outdated Show resolved Hide resolved
p11-kit/export-object.c Outdated Show resolved Hide resolved
p11-kit/export-object.c Outdated Show resolved Hide resolved
p11-kit/export-object.c Outdated Show resolved Hide resolved
@ZoltanFridrich
Copy link
Contributor

I have tested the command manually together with valgrind. Seems to work fine.

@ueno ueno force-pushed the wip/dueno/pubkey branch 7 times, most recently from 0e56e90 to 3cb5371 Compare September 26, 2023 08:33
@ueno ueno requested a review from ZoltanFridrich September 26, 2023 08:33
Copy link
Contributor

@ZoltanFridrich ZoltanFridrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Some tokens such as SoftHSMv2 omits CKA_PUBLIC_KEY_INFO when it can be
derived from algorithm specific attributes, such as CKA_MODULUS and
CKA_PUBLIC_EXPONENT for RSA.  This adds support for it if libtasn1 is
available at compile time.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
@ZoltanFridrich ZoltanFridrich merged commit 0b280a0 into p11-glue:master Sep 26, 2023
12 checks passed
@ZoltanFridrich ZoltanFridrich added this to the 0.25.1 milestone Oct 25, 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

Successfully merging this pull request may close these issues.

p11-kit export-object doesn't work for public keys without SPKI stored
3 participants