Skip to content

Commit

Permalink
fix for fortress and no sha build with encrypted keys
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Oct 21, 2019
1 parent e24787c commit 09a0859
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
15 changes: 8 additions & 7 deletions tests/api.c
Expand Up @@ -4321,7 +4321,8 @@ static void test_wolfSSL_PKCS12(void)
* Password Key
*/
#if defined(OPENSSL_EXTRA) && !defined(NO_DES3) && !defined(NO_FILESYSTEM) && \
!defined(NO_ASN) && !defined(NO_PWDBASED) && !defined(NO_RSA)
!defined(NO_ASN) && !defined(NO_PWDBASED) && !defined(NO_RSA) && \
!defined(NO_SHA)
byte buffer[5300];
char file[] = "./certs/test-servercert.p12";
char order[] = "./certs/ecc-rsa-server.p12";
Expand Down Expand Up @@ -4614,11 +4615,11 @@ static void test_wolfSSL_PKCS8(void)
word32 x = 0;
#endif
#ifdef TEST_PKCS8_ENC
#ifndef NO_RSA
#if !defined(NO_RSA) && !defined(NO_SHA)
const char serverKeyPkcs8EncPemFile[] = "./certs/server-keyPkcs8Enc.pem";
const char serverKeyPkcs8EncDerFile[] = "./certs/server-keyPkcs8Enc.der";
#endif
#ifdef HAVE_ECC
#if defined(HAVE_ECC) && !defined(NO_SHA)
const char eccPkcs8EncPrivKeyPemFile[] = "./certs/ecc-keyPkcs8Enc.pem";
const char eccPkcs8EncPrivKeyDerFile[] = "./certs/ecc-keyPkcs8Enc.der";
#endif
Expand Down Expand Up @@ -4646,7 +4647,7 @@ static void test_wolfSSL_PKCS8(void)
wolfSSL_CTX_set_default_passwd_cb_userdata(ctx, (void*)&flag);
flag = 1; /* used by password callback as return code */

#ifndef NO_RSA
#if !defined(NO_RSA) && !defined(NO_SHA)
/* test loading PEM PKCS8 encrypted file */
f = XFOPEN(serverKeyPkcs8EncPemFile, "rb");
AssertTrue((f != XBADFILE));
Expand Down Expand Up @@ -4683,7 +4684,7 @@ static void test_wolfSSL_PKCS8(void)
WOLFSSL_FILETYPE_ASN1), WOLFSSL_SUCCESS);
#endif /* !NO_RSA */

#ifdef HAVE_ECC
#if defined(HAVE_ECC) && !defined(NO_SHA)
/* test loading PEM PKCS8 encrypted ECC Key file */
f = XFOPEN(eccPkcs8EncPrivKeyPemFile, "rb");
AssertTrue((f != XBADFILE));
Expand Down Expand Up @@ -18118,7 +18119,7 @@ static void test_wc_i2d_PKCS12(void)
{
#if !defined(NO_ASN) && !defined(NO_PWDBASED) && defined(HAVE_PKCS12) \
&& !defined(NO_FILESYSTEM) && !defined(NO_RSA) \
&& !defined(NO_AES) && !defined(NO_DES3)
&& !defined(NO_AES) && !defined(NO_DES3) && !defined(NO_SHA)
WC_PKCS12* pkcs12 = NULL;
unsigned char der[FOURK_BUF * 2];
unsigned char* pt;
Expand Down Expand Up @@ -22384,7 +22385,7 @@ static void test_wolfSSL_OBJ(void)
* mode
*/
#if defined(OPENSSL_EXTRA) && !defined(NO_SHA256) && !defined(NO_ASN) && \
!defined(HAVE_FIPS)
!defined(HAVE_FIPS) && !defined(NO_SHA)
ASN1_OBJECT *obj = NULL;
char buf[50];

Expand Down
3 changes: 2 additions & 1 deletion tests/suites.c
Expand Up @@ -903,7 +903,8 @@ int SuiteTest(int argc, char** argv)
}
#endif
#endif
#if defined(WOLFSSL_ENCRYPTED_KEYS) && !defined(NO_DES3) && !defined(NO_MD5)
#if defined(WOLFSSL_ENCRYPTED_KEYS) && !defined(NO_DES3) && !defined(NO_MD5) &&\
!defined(NO_SHA)
/* test encrypted keys */
strcpy(argv0[1], "tests/test-enckeys.conf");
printf("starting encrypted keys extra cipher suite tests\n");
Expand Down
4 changes: 2 additions & 2 deletions wolfcrypt/test/test.c
Expand Up @@ -5288,7 +5288,7 @@ int des_test(void)
if (ret != 0)
return -4606;

#ifdef WOLFSSL_ENCRYPTED_KEYS
#if defined(WOLFSSL_ENCRYPTED_KEYS) && !defined(NO_SHA)
{
EncryptedInfo info;
XMEMSET(&info, 0, sizeof(EncryptedInfo));
Expand Down Expand Up @@ -5422,7 +5422,7 @@ int des3_test(void)
wc_Des3Free(&enc);
wc_Des3Free(&dec);

#ifdef WOLFSSL_ENCRYPTED_KEYS
#if defined(WOLFSSL_ENCRYPTED_KEYS) && !defined(NO_SHA)
{
EncryptedInfo info;
XMEMSET(&info, 0, sizeof(EncryptedInfo));
Expand Down

0 comments on commit 09a0859

Please sign in to comment.