From 198611db322f52ecc57f3d7005c8dd6af249e4e0 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Wed, 17 Oct 2018 13:58:19 +0100 Subject: [PATCH] Add missing return value check in ECDSA test suite The test case `ecdsa_det_test_vectors` from the ECDSA test suite called `mbedtls_md()` without checking its return value. --- tests/suites/test_suite_ecdsa.function | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/suites/test_suite_ecdsa.function b/tests/suites/test_suite_ecdsa.function index 48ce586be..8e76154de 100644 --- a/tests/suites/test_suite_ecdsa.function +++ b/tests/suites/test_suite_ecdsa.function @@ -117,7 +117,8 @@ void ecdsa_det_test_vectors( int id, char * d_str, int md_alg, char * msg, md_info = mbedtls_md_info_from_type( 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 ); TEST_ASSERT( mbedtls_ecdsa_sign_det( &grp, &r, &s, &d, hash, hlen, md_alg ) == 0 );