-
Notifications
You must be signed in to change notification settings - Fork 155
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
pkcs1v15.rs:verify too strict? #322
Comments
Do you have any information on what produced that signature? This check was intended to reduce malleability but if there are notable libraries producing signatures without this property we may need to relax the check for interop purposes. |
It was produced by Sequoia using the Nettle backend.
Can you please explain a bit more what you are thinking. Are you saying that these signatures are out of spec? If so, what is out of spec, the number of leading 0 bits or the lack of the leading 0 byte? In OpenPGP, MPIs have their leading zeros stripped. Adding them back manually is not a big deal, but our other crypto backends automatically zero pad, it seems. Do you think they are doing something dangerous? |
By the way, the OpenPGP interoperability test suite includes a number of test vectors that exercise this:
|
In a conversation with @teythoon, he said:
I've changed sequoia to deal with |
FWIW #272 was the impetus for these changes |
Closing for now. We'll see if someone else complains. |
Thanks for your help. |
This change (I think) is causing some signatures to no longer verify. In particular, the check:
is failing for a signature in our test suite. The signature is a 2039-bit MPI generated by a 2048-bit RSA key. Thus, the signature data is 255 bytes and the key is 256 bytes. This used to work (admittedly, this was on rsa 0.3; I'm in the process of upgrading our rust crypto dependencies), and it seems to work with the other four crypto backends that we use in Sequoia without any special treatment. Manually padding the signature to the key length causes
verify
to correctly verify the signature.Perhaps we've just been lucky.
Running our test suite, I see:
Note the 2039-bit signature and the "verification error" message. This is from the
cert::test::merge
unit test. You should be able to reproduce the failure as follows:I apologize if this is our bug, and appreciate any support. Thanks.
The text was updated successfully, but these errors were encountered: