mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 16:05:30 +00:00
bdf309ccdb
Switch from the direct use of slot numbers to handles allocated by psa_allocate_key. This commit does not affect persistent key tests except for the one test function in test_suite_psa_crypto that uses persistent keys (persistent_key_load_key_from_storage). The general principle for each function is: * Change `psa_key_slot_t slot` to `psa_key_handle_t handle`. * Call psa_allocate_key() before setting the policy of the slot, or before creating key material in functions that don't set a policy. * Some PSA_ERROR_EMPTY_SLOT errors become PSA_ERROR_INVALID_HANDLE because there is now a distinction between not having a valid handle, and having a valid handle to a slot that doesn't contain key material. * In tests that use symmetric keys, calculate the max_bits parameters of psa_allocate_key() from the key data size. In tests where the key may be asymmetric, call an auxiliary macro KEY_BITS_FROM_DATA which returns an overapproximation. There's no good way to find a good value for max_bits with the API, I think the API should be tweaked. |
||
---|---|---|
.. | ||
.jenkins | ||
data_files | ||
git-scripts | ||
scripts | ||
suites | ||
.gitignore | ||
CMakeLists.txt | ||
compat.sh | ||
Descriptions.txt | ||
Makefile | ||
ssl-opt.sh |