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

Rework the validation of RSA domain parameters in psa_import_key(). #4095

Closed
ronald-cron-arm opened this issue Feb 1, 2021 · 1 comment
Closed
Labels
component-psa PSA keystore/dispatch layer (storage, drivers, …) enhancement

Comments

@ronald-cron-arm
Copy link
Contributor

ronald-cron-arm commented Feb 1, 2021

Description

  • Type: Enhancement
  • Priority: Minor

Bug

Issue introduced when restructuring the PSA import and export code following docs/architecture/mbed-crypto-storage-specification.md (#3933).

Expected behavior
As per @stevew817 comment, if an RSA key and its attributes are validated by a driver, there should not be extra validation relying on the software implementation of RSA.

Thoughts towards a fix
Given the new structure of the PSA import code, the natural place for the check of the RSA domain parameters when importing an RSA key is mbedtls_psa_rsa_import_key().

Why are we not just rejecting RSA domain parameters when importing an RSA key as the only thing we do with them is to check that they are compatible with the RSA key ?

The fix should take into account that the check of RSA domain parameters needs eventually to be done as part of psa_generate_key() when generating an RSA key (see @gilles-peskine-arm comment).

More generally (beyond RSA/import specifics) probably that psa_validate_optional_attributes() needs to be dismantled with:
. the API specific checks being done in each APIs. Currently psa_validate_optional_attributes(), checks the attributes key type against the slot key type which makes sense for psa_copy_key() and psa_validate_key() but is not necessary for psa_import_key().
. the algorithm specific checks being done in the corresponding software driver, RSA checks in psa_crypto_rsa.c ...

@gilles-peskine-arm
Copy link
Contributor

Moot now that domain parameters have been removed in #6495.

@gilles-peskine-arm gilles-peskine-arm closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-psa PSA keystore/dispatch layer (storage, drivers, …) enhancement
Projects
None yet
Development

No branches or pull requests

5 participants