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

EC keys: implement vendor optimization when private key contains CKA_EC_POINT #347

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

space88man
Copy link
Contributor

@space88man space88man commented Feb 22, 2024

This is an optimization to avoid having a copy of the EC public key on HSM: some vendor implementations add CKA_EC_POINT to CKK_EC/CKO_PRIVATE_KEY to facilitate EVP_PKEY_eq()-type comparisons—skip round-tripping to the HSM to find_associated_obj.

This optimization is in OpenSC/libp11 see: : OpenSC/libp11@281ccb3

For both PR#346 PR#347 I found a discussion on libp11 about the round-tripping issue: OpenSC/libp11#209

@space88man space88man force-pushed the fix-EC-test branch 2 times, most recently from 84720ad to 41a049e Compare February 22, 2024 00:11
@space88man space88man changed the title EC keys: unconditionally fetch EC_POINT EC keys: implement vendor optimization when private key contains CKA_EC_POINT Feb 22, 2024
Copy link
Member

@simo5 simo5 left a comment

Choose a reason for hiding this comment

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

also please run the format checks via make before resubmitting

src/objects.c Show resolved Hide resolved
@space88man space88man force-pushed the fix-EC-test branch 2 times, most recently from e0bae67 to 82a5fe8 Compare February 22, 2024 23:18
- always attempt to fetch CKA_EC_POINT
- vendor optimization (e.g. Thales Luna) to have CKA_EC_POINT in
  CKO_PRIVATE_KEY
- avoid HSM search for public key
- libp11 equivalent: OpenSC/libp11@281ccb3

Signed-off-by: S-P Chan <[email protected]>
@simo5
Copy link
Member

simo5 commented Feb 26, 2024

Thanks, looks good, merging!

@simo5 simo5 merged commit c578c41 into latchset:main Feb 26, 2024
20 checks passed
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