1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

pkcs7.c: Do not ignore return value of mbedlts_md

CI was failing due to the return value of mbedtls_md being ignored.
If this function does fail, return early and propogate the md error.

Signed-off-by: Nick Child <nick.child@ibm.com>
This commit is contained in:
Nick Child
2022-02-22 17:19:59 -06:00
parent 600bd30427
commit 6671841d91
2 changed files with 9 additions and 4 deletions

View File

@@ -285,9 +285,10 @@ void pkcs7_verify_hash( char *pkcs7_file, char *crt, char *filetobesigned )
md_info = mbedtls_md_info_from_type( md_alg );
mbedtls_md( md_info, data, datalen, hash );
res = mbedtls_md( md_info, data, datalen, hash );
TEST_ASSERT( res == 0 );
res = mbedtls_pkcs7_signed_hash_verify( &pkcs7, &x509, hash, sizeof(hash));
res = mbedtls_pkcs7_signed_hash_verify( &pkcs7, &x509, hash, sizeof(hash) );
TEST_ASSERT( res == 0 );
exit: