-
Notifications
You must be signed in to change notification settings - Fork 47
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
Some fixes for EdDSA signatures + test coverage #497
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
simo5
requested changes
Jan 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fix needs changes, but it is correct in abstract
The EdDSA supports only one-shot signatures so we need to get rid of the Update + Final semantics in favor of the one-shot operation. Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
simo5
reviewed
Jan 10, 2025
Jakuje
force-pushed
the
eddsa-fixes
branch
2 times, most recently
from
January 13, 2025 17:41
f7fbb4d
to
9a8549e
Compare
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
When we import the EdDSA key from file, we always use the printable string choice in the EC_PARAMS. But the key on token can use OID in which case, we will not be able to match these two keys. Previously, the fallback involved getting the EC_GROUP from the EC_PARAMS, but this really works only with the ECDSA keys. On EdDSA keys, we always fail as the EdDSA keys do not have any EC_GROUP defined in OpenSSL and there is no conversion from the EC_PARAMS that contain printable string so the matching needs to be done differently than with the ECDSA keys. Previously, this worked because the Ed25519 keys we used had always representation with printable string so we were able to match the EC_PARAM strings byte-by-byte. Signed-off-by: Jakub Jelen <[email protected]>
simo5
approved these changes
Jan 13, 2025
Thanks for this fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There was a logic error in creating the eddsa signature params for pkcs11, that when
OSSL_SIGNATURE_PARAM_INSTANCE
OSSL_PARAM was not provided, the pkcs11 parameters were not created and Ed448 operations were failing.For some reason, the pkcs11 parameters are required for the Ed448 even if no prehashing nor context is used.
Additionally, if only the context is provided by OpenSSL/caller, we also need to provide the correct parameters, which was not handled before.
Unfortunately, this is not the issue I was after during last days.
Checklist
Reviewer's checklist: