From e35489fd755ebdb402707b7878a7044cc26220db Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Mon, 20 Mar 2017 13:46:26 +0900 Subject: [PATCH 1/2] eccCaKeyFile in RSA/ECC test --- wolfcrypt/test/test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 326d89971..03ff12853 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -5329,7 +5329,8 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) static const char* eccPubKeyDerFile = CERT_PREFIX "ecc-public-key.der"; #endif #if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN) - static const char* eccCaKeyFile = CERT_PREFIX "ecc-key.der"; + static const char* eccCaKeyFile = CERT_ROOT "ecc-key.der"; + static const char* eccCaKeyTemp = CERT_PREFIX "ecc-key.der"; #endif #if defined(WOLFSSL_CERT_GEN) || \ (defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_TEST_CERT)) @@ -9767,7 +9768,7 @@ static int ecc_test_key_gen(WC_RNG* rng, int keySize) } #ifndef NO_FILESYSTEM - keyFile = fopen(eccCaKeyFile, "wb"); + keyFile = fopen(eccCaKeyTemp, "wb"); if (!keyFile) { ERROR_OUT(-1025, done); } From 7be1077216108e60b423f57fcb4f56b5fb27c9b1 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 21 Mar 2017 08:31:07 -0700 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20for=20build=20error=20with=20unused?= =?UTF-8?q?=20=E2=80=9CeccCaKeyFile=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wolfcrypt/test/test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 03ff12853..ac05842e5 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -5299,6 +5299,9 @@ 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 @@ -5327,10 +5330,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #ifdef WOLFSSL_KEY_GEN static const char* eccCaKeyPemFile = CERT_PREFIX "ecc-key.pem"; static const char* eccPubKeyDerFile = CERT_PREFIX "ecc-public-key.der"; - #endif - #if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_KEY_GEN) - static const char* eccCaKeyFile = CERT_ROOT "ecc-key.der"; - static const char* eccCaKeyTemp = CERT_PREFIX "ecc-key.der"; + static const char* eccCaKeyTempFile = CERT_PREFIX "ecc-key.der"; #endif #if defined(WOLFSSL_CERT_GEN) || \ (defined(WOLFSSL_CERT_EXT) && defined(WOLFSSL_TEST_CERT)) @@ -9768,7 +9768,7 @@ static int ecc_test_key_gen(WC_RNG* rng, int keySize) } #ifndef NO_FILESYSTEM - keyFile = fopen(eccCaKeyTemp, "wb"); + keyFile = fopen(eccCaKeyTempFile, "wb"); if (!keyFile) { ERROR_OUT(-1025, done); }