Skip to content

Commit b7000d4

Browse files
authored
Merge pull request #345 from gilles-peskine-arm/psa_mac_verify_finish-status
Fix possible error code mangling in psa_mac_verify_finish
2 parents c69c2c5 + 28cd416 commit b7000d4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/psa_crypto.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,6 +3149,8 @@ psa_status_t psa_mac_verify_finish( psa_mac_operation_t *operation,
31493149

31503150
status = psa_mac_finish_internal( operation,
31513151
actual_mac, sizeof( actual_mac ) );
3152+
if( status != PSA_SUCCESS )
3153+
goto cleanup;
31523154

31533155
if( safer_memcmp( mac, actual_mac, mac_length ) != 0 )
31543156
status = PSA_ERROR_INVALID_SIGNATURE;

0 commit comments

Comments
 (0)