-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Providing salt length input to RSA_SSA_PSS verifty message via PSA APIs #4946
Comments
We had an internal discussion on the PSS salt length and decided to go into a different direction for the salt length. The soon-to-be-published draft of version 1.0.2 of the PSA Crypto API specification states:
We decided to go this route because the salt is not a critical security parameter in PSS: I'm not aware of any reason to prefer a salt other than a slightly tighter proof. PSA implementations need to be able to verify PSS signatures produced by a non-PSA implementation, and without salt. Another reason we went this route is that it matches the behavior of the reference implementation. Why do you want to verify the salt length? Do you have a compliance requirement to reject other salt lengths? If there is demand for it, we may add a variant of |
I pushed a documentation fix (because in any case, it's a bug that the documentation and the behavior of Mbed TLS do not match): #4949 |
Hello @gilles-peskine-arm Thanks a lot for the prompt response and the quick fix of the documentation. Why do you want to verify the salt length? Do you have a compliance requirement to reject other salt lengths? If there is any possiblity of the salt check to be added as a variant of PSA_ALG_RSA_PSS please do keep me informed, To be precise i would change the function mbedtls_rsa_rsassa_pss_verify in rsa.c from:
to:
P.S: |
We had an internal discussion and we've decided to change the upcoming version of the specification. On closer inspection, we felt that it was too big a change. The current published specification is:
We intend to amend that to something like:
And we'll add a variant, tentatively called For Mbed TLS, this means that the current behavior will become the implementation of |
This is a small behavior change which is applicable to Mbed TLS 2.2x so we should schedule it in time for the 2.2x LTS (anticipating the official release of the updated PSA specification). |
PSA_ALG_RSA_PSS algorithm now accepts only the same salt length for verification that it produces when signing, as documented. Fixes Mbed-TLS#4946. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
PSA_ALG_RSA_PSS algorithm now accepts only the same salt length for verification that it produces when signing, as documented. Fixes Mbed-TLS#4946. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
PSA_ALG_RSA_PSS algorithm now accepts only the same salt length for verification that it produces when signing, as documented. Fixes Mbed-TLS#4946. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
PSA_ALG_RSA_PSS algorithm now accepts only the same salt length for verification that it produces when signing, as documented. Fixes Mbed-TLS#4946. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
PSA_ALG_RSA_PSS algorithm now accepts only the same salt length for verification that it produces when signing, as documented. Fixes Mbed-TLS#4946. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Suggested enhancement
I am trying to use PSA APIs to implement RSASSA_PSS singature verification.
I am referring to the documentation PSA Cryptography API 1.0
I am generating a signature with a salt length(slen) = hash_len.
When I try to verify this signature via RSASSA-PSS, I find that the salt length check is altogether skipped.
I am calling:
This internally sets some PSA elements and calls:
When I read the documentation, in the description of PSA_ALG_RSA_PSS (macro), there is a generic statement:
Hence can we instead of avoiding the salt length check altogether, can we either accept salt length as an argument to a PSA API or at least check for salt_len=hash_len.
Justification
Mbed TLS needs this because RSASSA_PSS is slowing gaining pace and we would require a salt length check in PSA APIs so that we do not revert back to MBEDTLS only APIs like mbedtls_rsa_rsassa_pss_verify_ext.
The text was updated successfully, but these errors were encountered: