-
Notifications
You must be signed in to change notification settings - Fork 96
Implementation-specific extension: Keys may allow a second algorithm #128
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
Implementation-specific extension: Keys may allow a second algorithm #128
Conversation
Manually cherry-picked from ca5bed7 by taking that patch, replacing KEYPAIR by KEY_PAIR throughout (renaming applied in this branch), and discarding parts about import_twice in test_suite_psa_crypto (this test function was removed from this branch).
In the tests for opening a persistent key after closing it, also read back and check the key data if permitted by policy, and the key policy.
f683c3d
to
6202c99
Compare
CI passing except for expected failures because the API branch is not up-to-date (use_psa_crypto, ABI check, TLS). |
* An operation on a key may indifferently use the algorithm set with | ||
* psa_set_key_algorithm() or with this function. | ||
* | ||
* \param[out] attributes The attribute structure to write to. |
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.
Indentation
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.
Fixed in rebase. No other changes.
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.
Only an indentation problem found.
Add a second permitted algorithm to key policies. This commit includes smoke tests that do not cover psa_copy_key.
The storage format has changed, so update the test data accordingly.
Add parameters to psa_copy_key tests for the enrollment algorithm (alg2). This commit only tests with alg2=0, which is equivalent to not setting an enrollment algorithm.
6202c99
to
3027ba6
Compare
Add a second permitted algorithm to key policies, as an implementation-specific feature. This is an experimental feature which may or may not be added to the PSA Crypto API after 1.0.
This is a replay of https://github.com/ARMmbed/mbedtls-psa/pull/266 [private link] on the API branch. Because the development branch and the API branch have diverged (copy key policy, renamed identifiers, changed key creation interface), merging this feature from development to the API branch led to a lot of difficult-to-understand conflicts. Here, I take the commits from https://github.com/ARMmbed/mbedtls-psa/pull/266 one by one and modify them to suit the modern API.
Compared with https://github.com/ARMmbed/mbedtls-psa/pull/266:
PSA_ECC_CURVE_BITS
have already been merged through PSA: EC curve size macro #107.docs/architecture/mbed-crypto-storage-specification.md
because this file has not been modified in the API branch.Once this PR is merged, the next step is to merge
development
intopsa-api-1.0-beta
. This merge will have conflicts but they will be easy to resolve (the merge commit is at https://github.com/gilles-peskine-arm/mbed-crypto/tree/psa-api-1.0-beta-merge_development_20190524, I'll make a PR for it once this one is merged).