mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-24 06:02:44 +00:00
test: check exported length against proper MAX_SIZE
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
478c236938
commit
1eacae865e
@ -1590,7 +1590,11 @@ void import_export(data_t *data,
|
|||||||
TEST_LE_U(exported_length,
|
TEST_LE_U(exported_length,
|
||||||
PSA_EXPORT_KEY_OUTPUT_SIZE(type,
|
PSA_EXPORT_KEY_OUTPUT_SIZE(type,
|
||||||
psa_get_key_bits(&got_attributes)));
|
psa_get_key_bits(&got_attributes)));
|
||||||
|
if (PSA_KEY_TYPE_IS_KEY_PAIR(type)) {
|
||||||
TEST_LE_U(exported_length, PSA_EXPORT_KEY_PAIR_MAX_SIZE);
|
TEST_LE_U(exported_length, PSA_EXPORT_KEY_PAIR_MAX_SIZE);
|
||||||
|
} else if (PSA_KEY_TYPE_IS_PUBLIC_KEY(type)) {
|
||||||
|
TEST_LE_U(exported_length, PSA_EXPORT_PUBLIC_KEY_MAX_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
destroy:
|
destroy:
|
||||||
/* Destroy the key */
|
/* Destroy the key */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user