mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-09-02 16:01:16 +03:00
Fix possible buffer overread in psa_mac_finish_internal (CMAC)
This commit is contained in:
@@ -1738,7 +1738,7 @@ static psa_status_t psa_mac_finish_internal( psa_mac_operation_t *operation,
|
|||||||
uint8_t tmp[PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE];
|
uint8_t tmp[PSA_MAX_BLOCK_CIPHER_BLOCK_SIZE];
|
||||||
int ret = mbedtls_cipher_cmac_finish( &operation->ctx.cmac, tmp );
|
int ret = mbedtls_cipher_cmac_finish( &operation->ctx.cmac, tmp );
|
||||||
if( ret == 0 )
|
if( ret == 0 )
|
||||||
memcpy( mac, tmp, mac_size );
|
memcpy( mac, tmp, operation->mac_size );
|
||||||
mbedtls_zeroize( tmp, sizeof( tmp ) );
|
mbedtls_zeroize( tmp, sizeof( tmp ) );
|
||||||
return( mbedtls_to_psa_error( ret ) );
|
return( mbedtls_to_psa_error( ret ) );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user