Skip to content

Commit

Permalink
mbedtls: Run mbedtls_timing_self_test if MBEDTLS_TIMING_C
Browse files Browse the repository at this point in the history
This allows us to verify the support for Mbed TLS timing on Mbed OS.

Note: The macros MBEDTLS_TIMING_C and MBEDTLS_TIMING_ALT are not
enabled by default and need to be additionally enabled to run this
test.
  • Loading branch information
LDong-Arm committed Jun 14, 2021
1 parent e5904ff commit c3bff22
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions connectivity/mbedtls/tests/TESTS/mbedtls/selftest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ using namespace utest::v1;
#include "mbedtls/sha512.h"
#include "mbedtls/entropy.h"
#include "mbedtls/entropy_poll.h"
#include "mbedtls/timing.h"

#include <string.h>

Expand Down Expand Up @@ -65,6 +66,10 @@ MBEDTLS_SELF_TEST_TEST_CASE(mbedtls_sha512_self_test)
MBEDTLS_SELF_TEST_TEST_CASE(mbedtls_entropy_self_test)
#endif

#if defined(MBEDTLS_TIMING_C)
MBEDTLS_SELF_TEST_TEST_CASE(mbedtls_timing_self_test)
#endif

#else
#warning "MBEDTLS_SELF_TEST not enabled"
#endif /* MBEDTLS_SELF_TEST */
Expand All @@ -84,6 +89,10 @@ Case cases[] = {
Case("mbedtls_entropy_self_test", mbedtls_entropy_self_test_test_case),
#endif

#if defined(MBEDTLS_TIMING_C)
Case("mbedtls_timing_self_test", mbedtls_timing_self_test_test_case),
#endif

#endif /* MBEDTLS_SELF_TEST */
};

Expand Down

0 comments on commit c3bff22

Please sign in to comment.