From 785fd55a39f37543bb613dba132771b5ab74e323 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 4 Jun 2018 15:08:56 +0200 Subject: [PATCH] Whitespace fixes; removed redundant parentheses No semantic change. --- library/psa_crypto.c | 10 +++++----- tests/suites/test_suite_psa_crypto.function | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 5fd11421d..d1960f727 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -473,9 +473,9 @@ static psa_status_t psa_internal_export_key(psa_key_slot_t key, if( !( slot->policy.usage & PSA_KEY_USAGE_EXPORT ) ) return( PSA_ERROR_NOT_PERMITTED ); - - if( ( export_public_key ) && ( !( PSA_KEY_TYPE_IS_PUBLIC_KEY( slot->type ) - || PSA_KEY_TYPE_IS_KEYPAIR( slot->type ) ) ) ) + + if( export_public_key && !( PSA_KEY_TYPE_IS_PUBLIC_KEY( slot->type ) || + PSA_KEY_TYPE_IS_KEYPAIR( slot->type ) ) ) return( PSA_ERROR_INVALID_ARGUMENT ); if( PSA_KEY_TYPE_IS_RAW_BYTES( slot->type ) ) @@ -520,8 +520,8 @@ static psa_status_t psa_internal_export_key(psa_key_slot_t key, #endif /* defined(MBEDTLS_PK_WRITE_C) */ { /* This shouldn't happen in the reference implementation, but - it is valid for a special-purpose implementation to omit - support for exporting certain key types. */ + it is valid for a special-purpose implementation to omit + support for exporting certain key types. */ return( PSA_ERROR_NOT_SUPPORTED ); } } diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 8c29f1d2e..48c6228af 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -557,7 +557,7 @@ void import_export_public_key( char *hex, psa_key_policy_init( &policy ); - psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_EXPORT, + psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_EXPORT, PSA_ALG_VENDOR_FLAG ); TEST_ASSERT( psa_set_key_policy( slot, &policy ) == PSA_SUCCESS ); @@ -580,7 +580,6 @@ void import_export_public_key( char *hex, if( status != PSA_SUCCESS ) goto destroy; - TEST_ASSERT( exported_length == (size_t) public_key_expected_length ); destroy: