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

crypto-refresh: minor fixes and updates for X25519/Ed25519 (new format) #1687

Merged
merged 7 commits into from Oct 10, 2023

Conversation

larabr
Copy link
Collaborator

@larabr larabr commented Sep 29, 2023

See commit messages.

TODO:

  • reject signatures with weak hashes? (waiting for spec decision)

@larabr larabr changed the title crypto-refresh: minor changes to X25519/Ed25519 (new format) crypto-refresh: minor fixes and updates for X25519/Ed25519 (new format) Sep 29, 2023
Set to replace `enums.publicKey.eddsa`, which can still be used everywhere,
but it will be dropped in v6.
Deprecation notices have been added to ease transition.
Due to a bug, a shorter hash could be selected, and signing would throw as a result.
This change fixes the issue by automatically picking SHA-256, if needed.
The same was already done for legacy EdDSA signatures.
… some ECDSA subkeys

The required hash size was determined based on the subkey algo rather than the primary key.
As a result, if the subkey being certified required a shorter hash size than the ECDSA primary key,
the issued signature would include a shorter digest than expected.

This issue is not expected to have practical security impact, and
it only affected keys with ECDSA subkeys with smaller key sizes than their ECDSA primary key
(e.g. NIST p521 primary key and NIST p256 subkey).
@larabr larabr requested a review from twiss October 3, 2023 16:52
@larabr larabr force-pushed the eddsa-rename-legacy branch 2 times, most recently from 022d8c9 to 5367f43 Compare October 4, 2023 08:36
src/key/helper.js Outdated Show resolved Hide resolved
As mandated by the new crypto-refresh spec.
This applies to both the new and legacy EdDSA format.
For the legacy signatures, it is not expected to be a breaking change, since the spec
already mandated the use SHA-256 (or stronger).
Set to replace `enums.curve.ed25519` (resp. `.curve25519`), which can still be used everywhere,
but it will be dropped in v6.
Deprecation notices have been added to ease transition.
@larabr larabr merged commit ed482a1 into openpgpjs:main Oct 10, 2023
12 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.

None yet

2 participants