You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ed25519/Ed448 does not throw when used with invalid digest in crypto.createSign #52097
When Signer is used for Ed25519 signing, Signer does not report any errors, but returns an all-zero Buffer as the signature result.
This can be confusing for programmers who think they have signed successfully, but in fact the returned signature is not available.
What is the feature you are proposing to solve the problem?
I think in this case Signer.sign should throw an error so that the programmer can deal with the problem early on.
changed the title [-]It is recommended to throw an error when passing Ed25519 private key to Signer.[/-][+]Ed25519/Ed448 does not throw when used with invalid digest in crypto.createSign[/+]on Mar 19, 2024
Activity
panva commentedon Mar 17, 2024
This seems like a bug. Ed25519 and Ed448 should only be available via the oneshot apis in the first place.
xicilion commentedon Mar 18, 2024
Yes, there is indeed an error here, so an error should be thrown here instead of returning a zero-filled Buffer.
[-]It is recommended to throw an error when passing Ed25519 private key to Signer.[/-][+]Ed25519/Ed448 does not throw when used with invalid digest in crypto.createSign[/+]panva commentedon Mar 19, 2024
cc @nodejs/crypto
medic-code commentedon Mar 22, 2024
I would like to work on this if nobody else is.
crypto: reject Ed25519/Ed448 in Sign/Verify prototypes
crypto: reject Ed25519/Ed448 in Sign/Verify prototypes
crypto: reject Ed25519/Ed448 in Sign/Verify prototypes
crypto: reject Ed25519/Ed448 in Sign/Verify prototypes