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

Add support to pass salt length for RSASSA_PSS #295

Open
Taowyoo opened this issue Jul 12, 2023 · 0 comments
Open

Add support to pass salt length for RSASSA_PSS #295

Taowyoo opened this issue Jul 12, 2023 · 0 comments

Comments

@Taowyoo
Copy link
Collaborator

Taowyoo commented Jul 12, 2023

Background

We confirmed that we now could not pass a salt length through the rust-mbedtls APIs. However it was found that the function rsa_rsassa_pss_sign_ext does allow us to supply a salt length (note this is in the mbedtls-sys-auto).

Note

When turning on tls13 feature, need to be careful to following PSA specific limitations
From mbedtls-sys/vendor/docs/architecture/psa-migration/psa-limitations.md :

  • signature: mbedtls_rsa_rsassa_pss_sign()
    • message hashed externally
    • encoding hash = MGF1 hash (from context, or argument = message hash)
    • salt length: always using the maximum legal value
  • signature: mbedtls_rsa_rsassa_pss_sign_ext()
    • message hashed externally
    • encoding hash = MGF1 hash (from context, or argument = message hash)
    • salt length: specified explicitly

Also may need to call psa_crypto_init before any call to above functions.

Acceptance Criteria

  • Update the rust-mbedtls to have a function that allows us to pass a salt_length to the sign function or makes use of the current logic (where salt_length == hash_length)
  • Ensure there isn’t a performance degradation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant