From 00ca1dcbb7925ae5eb1edf929bf26755a3947bc8 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Fri, 24 Mar 2017 14:01:06 -0600 Subject: [PATCH 1/2] Fix for: 'Fix for build error with unused eccCaKeyFile' --- wolfcrypt/test/test.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index fa977140b..6776a79da 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -5299,9 +5299,6 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #ifdef WOLFSSL_CERT_GEN static const char* caKeyFile = CERT_ROOT "ca-key.der"; static const char* caCertFile = CERT_ROOT "ca-cert.pem"; - #ifdef HAVE_ECC - static const char* eccCaKeyFile = CERT_ROOT "ecc-key.der"; - #endif #endif #endif /* !NO_RSA */ #ifndef NO_DH @@ -5315,6 +5312,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #ifdef HAVE_ECC #ifdef WOLFSSL_CERT_GEN static const char* eccCaCertFile = CERT_ROOT "server-ecc.pem"; + static const char* eccCaKeyFile = CERT_ROOT "ecc-key.der"; #endif #ifdef WOLFSSL_CERT_EXT static const char* eccCaKeyPubFile = CERT_ROOT "ecc-keyPub.der"; From 2bcb8e53fc1aee1a99cb9034ad4dfdabd9c30836 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Mon, 27 Mar 2017 16:53:13 -0600 Subject: [PATCH 2/2] Address case from review --- wolfcrypt/test/test.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 6776a79da..90572d6ec 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -5310,7 +5310,8 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #endif /* !USE_CERT_BUFFER_* */ #if !defined(USE_CERT_BUFFERS_256) && !defined(NO_ASN) #ifdef HAVE_ECC - #ifdef WOLFSSL_CERT_GEN + /* cert files to be used in rsa cert gen test, check if RSA enabled */ + #if defined(WOLFSSL_CERT_GEN) && !defined(NO_RSA) static const char* eccCaCertFile = CERT_ROOT "server-ecc.pem"; static const char* eccCaKeyFile = CERT_ROOT "ecc-key.der"; #endif @@ -5320,9 +5321,9 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #endif /* HAVE_ECC */ #endif /* !USE_CERT_BUFFER_* */ -/* Temporary Cert Files */ #ifdef HAVE_ECC - #ifdef WOLFSSL_CERT_GEN + /* Temporary Cert Files to be used in rsa cert gen test, is RSA enabled */ + #if defined(WOLFSSL_CERT_GEN) && !defined(NO_RSA) static const char* certEccPemFile = CERT_PREFIX "certecc.pem"; #endif #ifdef WOLFSSL_KEY_GEN @@ -5330,9 +5331,11 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) static const char* eccPubKeyDerFile = CERT_PREFIX "ecc-public-key.der"; static const char* eccCaKeyTempFile = CERT_PREFIX "ecc-key.der"; #endif - #if defined(WOLFSSL_CERT_GEN) || \ + #ifndef NO_RSA + #if defined(WOLFSSL_CERT_GEN) || \ (defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_TEST_CERT)) static const char* certEccDerFile = CERT_PREFIX "certecc.der"; + #endif #endif #endif /* HAVE_ECC */