From e7edf7bb20f9295f0e26cc09601d524aaf0377b0 Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Wed, 27 Jun 2018 17:55:12 +0100 Subject: [PATCH] psa: Expect zero-length exported-public symmetric keys Because exporting-public a symmetric key fails, we have no reasonable expectation that the exported key length has any value at all other than something obviously incorrect or "empty", like a key with a length of 0. Our current implementation explicitly sets the exported key length to 0 on errors, so test for this. Fix the "PSA import/export-public: cannot export-public a symmetric key" test to expect a key length of 0 instead of 162. --- tests/suites/test_suite_psa_crypto.data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_psa_crypto.data b/tests/suites/test_suite_psa_crypto.data index 265a6d5be..612a15220 100644 --- a/tests/suites/test_suite_psa_crypto.data +++ b/tests/suites/test_suite_psa_crypto.data @@ -103,7 +103,7 @@ import_export_public_key:"3082025e02010002818100af057d396ee84fb75fdbb5c2b13c7fe5 PSA import/export-public: cannot export-public a symmetric key depends_on:MBEDTLS_PK_C:MBEDTLS_PK_PARSE_C:MBEDTLS_RSA_C -import_export_public_key:"2b7e151628aed2a6abf7158809cf4f3c":PSA_KEY_TYPE_AES:PSA_ALG_CBC_BASE | PSA_ALG_BLOCK_CIPHER_PAD_NONE:128:162:PSA_ERROR_INVALID_ARGUMENT +import_export_public_key:"2b7e151628aed2a6abf7158809cf4f3c":PSA_KEY_TYPE_AES:PSA_ALG_CBC_BASE | PSA_ALG_BLOCK_CIPHER_PAD_NONE:128:0:PSA_ERROR_INVALID_ARGUMENT PSA import/export EC secp256r1: good depends_on:MBEDTLS_PK_C:MBEDTLS_PK_PARSE_C:MBEDTLS_ECP_C:MBEDTLS_ECP_DP_SECP256R1_ENABLED