From eb162de489e7396a7380fd81468e806a91f878b5 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Mon, 12 Feb 2018 04:16:17 -0500 Subject: [PATCH] Add test dependencies Add RSA and ECDSA dependencies to tests --- tests/suites/test_suite_pk.data | 3 +++ tests/suites/test_suite_pk.function | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_pk.data b/tests/suites/test_suite_pk.data index e105ad52b5..11b5f108e3 100644 --- a/tests/suites/test_suite_pk.data +++ b/tests/suites/test_suite_pk.data @@ -155,12 +155,15 @@ depends_on:MBEDTLS_RSA_C:MBEDTLS_HAVE_INT64 pk_rsa_overflow: PK opaque mock +depends_on:MBEDTLS_RSA_C:MBEDTLS_ECDSA_C pk_opaque_mock: PK opaque with failed allocation +depends_on:MBEDTLS_RSA_C pk_opaque_fail_allocation: PK opaque minimal +depends_on:MBEDTLS_RSA_C pk_opaque_minimal: #PK opaque wrapper (RSA) diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index e1c1230126..1ad38eadd5 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -67,7 +67,9 @@ static size_t mbedtls_rsa_key_len_func( void *ctx ) static void pk_rsa_prepare( mbedtls_rsa_context *raw ) { mbedtls_rsa_init( raw, MBEDTLS_RSA_PKCS_V15, MBEDTLS_MD_NONE ); +#if defined(MBEDTLS_GENPRIME) mbedtls_rsa_gen_key( raw, rnd_std_rand, NULL, RSA_KEY_SIZE, 3 ); +#endif } /* Test the RSA context tested_ctx by comparing its operation with a @@ -742,7 +744,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:MBEDTLS_RSA_C:MBEDTLS_ECDSA_C */ void pk_opaque_mock( ) { mbedtls_pk_info_t info = @@ -852,7 +854,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */ void pk_opaque_minimal( ) { mbedtls_pk_info_t info = @@ -922,7 +924,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */ void pk_opaque_fail_allocation( ) { mbedtls_pk_info_t info =