diff options
author | Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com> | 2022-01-25 00:25:59 +0100 |
---|---|---|
committer | Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com> | 2022-01-31 15:38:29 +0100 |
commit | f4ca3f0e525d4256021eb5fd68ae43cff545a7e7 (patch) | |
tree | ab70933e87a3e82e5e338a1cc776b7eae26efc4e | |
parent | f57b45660d8520028f06f626bf8cf9e395c7c57e (diff) | |
download | mbedtls-f4ca3f0e525d4256021eb5fd68ae43cff545a7e7.zip mbedtls-f4ca3f0e525d4256021eb5fd68ae43cff545a7e7.tar.gz mbedtls-f4ca3f0e525d4256021eb5fd68ae43cff545a7e7.tar.bz2 |
ssl test build_transforms(): in psa mode distinguish encrypt/decrypt keys
Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
-rw-r--r-- | tests/suites/test_suite_ssl.function | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index 91858e4..4635b65 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -1448,7 +1448,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in, if ( alg != MBEDTLS_SSL_NULL_CIPHER ) { - psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT ); + psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_ENCRYPT ); psa_set_key_algorithm( &attributes, alg ); psa_set_key_type( &attributes, key_type ); @@ -1466,7 +1466,7 @@ static int build_transforms( mbedtls_ssl_transform *t_in, status = psa_import_key( &attributes, key1, PSA_BITS_TO_BYTES( key_bits ), - &t_in->psa_key_dec ); + &t_out->psa_key_enc ); if ( status != PSA_SUCCESS) { @@ -1474,10 +1474,12 @@ static int build_transforms( mbedtls_ssl_transform *t_in, goto cleanup; } + psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_DECRYPT ); + status = psa_import_key( &attributes, key1, PSA_BITS_TO_BYTES( key_bits ), - &t_out->psa_key_enc ); + &t_in->psa_key_dec ); if ( status != PSA_SUCCESS) { |