-
Notifications
You must be signed in to change notification settings - Fork 49
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
Create backwards-compatible RSA PSS sigs by default #431
Create backwards-compatible RSA PSS sigs by default #431
Conversation
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.
🚀
Should we also update |
So that should go in |
I wonder if we want to at all touch the saltlength. I'm unsure why the underlying api had to change (not in sslib, but cryptography). Is there any backstory to it? |
So I'm trying to understand the complete picture:
So end result seems to be
So I suppose my question is, is the added API surface needed? Could sslib just create sigs like it used to originally before #422 (and file an issue for future maintainers to change it when old code really is dead) and just let verify always use automatic length? |
Reasons:
That's exactly what the signing does by default now. I don't see any harm in merging this PR as it is: users who override the defaults presumably know what they are doing. Any objections? |
The biggest Q is whether we are OK with the default salt length (digest length). I think it's since, since nobody knows how to break even empty salt lengths apparently, but I think it's not a bad idea to allow those who know what they are doing to override defaults if they so wish. OTOH, I'm not against simply for now: (1) fixing signatures to the digest length, and (2) setting salt length automatically during verification. Votes? |
+1 |
Ok, so no overriding of these defaults, correct? |
I intend to create a release next week to get out a different feature (#231). Happy to include a fix for this issue here if provided. |
In secure-systems-lab#422 we changed `create_rsa_signature` to use the maximum salt length available, instead of the digest length, when creating rsassa-pss signatures, and adapted `verify_rsa_signature` to infer the salt length automatically. This made it impossible for users of the old verify function, which could only handle digest sized salts, to verify signatures created by users of the new signing function (see secure-systems-lab#430). Since the advantage of max salt lengths is mostly academic, this patch reverts `create_rsa_signature` to use digest sized salts (as agreed in secure-systems-lab#431). Note that we now use the `padding.PSS.DIGEST_LENGTH` constant instead of passing the actual digest length, as we did before. Using the constant has the same result, but is recommended by the library documentation. Also note that the patch does not revert the `verify_rsa_signature` part of secure-systems-lab#422. This allows verifying signatures created with the securesystemslib release that used max salt lengths, or created outside of securesystemslib. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Closing in favor of #436 |
Fixes: #430
Description of the changes being introduced by the pull request:
This PR fixes #430 by creating RSA PSS signatures with a salt length that defaults to size of the output of the hash function used in the signature. End-user libraries/applications such as python-tuf and python-in-toto are able to override this default if so desired.
Please verify and check that the pull request fulfils the following requirements: