Skip to content

Commit

Permalink
Add missing return code check on calls to mbedtls_md()
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles-peskine-arm committed Jan 27, 2020
1 parent 1a30fbb commit 75aab52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/suites/test_suite_ecdsa.function
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@ void ecdsa_write_restart( int id, char *d_str, int md_alg,
TEST_ASSERT( md_info != NULL );

hlen = mbedtls_md_get_size( md_info );
mbedtls_md( md_info, (const unsigned char *) msg, strlen( msg ), hash );
TEST_ASSERT( mbedtls_md( md_info,
(const unsigned char *) msg, strlen( msg ),
hash ) == 0 );

mbedtls_ecp_set_max_ops( max_ops );

Expand Down
4 changes: 3 additions & 1 deletion tests/suites/test_suite_pk.function
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,9 @@ void pk_sign_verify_restart( int pk_type, int grp_id, char *d_str,
TEST_ASSERT( md_info != NULL );

hlen = mbedtls_md_get_size( md_info );
mbedtls_md( md_info, (const unsigned char *) msg, strlen( msg ), hash );
TEST_ASSERT( mbedtls_md( md_info,
(const unsigned char *) msg, strlen( msg ),
hash ) == 0 );

mbedtls_ecp_set_max_ops( max_ops );

Expand Down

0 comments on commit 75aab52

Please sign in to comment.