Merge pull request #2363 from JacobBarthelmeh/Testing

Fixes for builds
This commit is contained in:
toddouska
2019-07-18 08:38:50 -07:00
committed by GitHub

View File

@ -365,7 +365,10 @@ int scrypt_test(void);
#if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM)
int pkcs7authenveloped_test(void); int pkcs7authenveloped_test(void);
#endif #endif
int pkcs7callback_test(byte* cert, word32 certSz, byte* key, word32 keySz); #ifndef NO_AES
int pkcs7callback_test(byte* cert, word32 certSz, byte* key,
word32 keySz);
#endif
#endif #endif
#if !defined(NO_ASN_TIME) && !defined(NO_RSA) && defined(WOLFSSL_TEST_CERT) && \ #if !defined(NO_ASN_TIME) && !defined(NO_RSA) && defined(WOLFSSL_TEST_CERT) && \
!defined(NO_FILESYSTEM) !defined(NO_FILESYSTEM)
@ -9241,7 +9244,8 @@ static const CertName certDefaultName = {
#ifndef NO_RSA #ifndef NO_RSA
#if defined(WOLFSSL_TEST_CERT) #if !defined(NO_ASN_TIME) && !defined(NO_RSA) && defined(WOLFSSL_TEST_CERT) && \
!defined(NO_FILESYSTEM)
static byte minSerial[] = { 0x02, 0x01, 0x01 }; static byte minSerial[] = { 0x02, 0x01, 0x01 };
static byte minName[] = { 0x30, 0x00 }; static byte minName[] = { 0x30, 0x00 };
static byte nameBad[] = { static byte nameBad[] = {
@ -20786,6 +20790,7 @@ static int myOriDecryptCb(PKCS7* pkcs7, byte* oriType, word32 oriTypeSz,
} }
#ifndef NO_AES
/* returns 0 on success */ /* returns 0 on success */
static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz, static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz,
byte* aad, word32 aadSz, byte* authTag, word32 authTagSz, byte* aad, word32 aadSz, byte* authTag, word32 authTagSz,
@ -20895,6 +20900,7 @@ static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz,
(void)authTagSz; (void)authTagSz;
return ret; return ret;
} }
#endif /* NO_AES */
static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz, static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz,
@ -22018,6 +22024,7 @@ int pkcs7authenveloped_test(void)
} }
#endif /* HAVE_AESGCM || HAVE_AESCCM */ #endif /* HAVE_AESGCM || HAVE_AESCCM */
#ifndef NO_AES
static const byte defKey[] = { static const byte defKey[] = {
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
@ -22418,6 +22425,7 @@ int pkcs7callback_test(byte* cert, word32 certSz, byte* key, word32 keySz)
return 0; return 0;
} }
#endif /* NO_AES */
#ifndef NO_PKCS7_ENCRYPTED_DATA #ifndef NO_PKCS7_ENCRYPTED_DATA
@ -23980,10 +23988,12 @@ int pkcs7signed_test(void)
eccClientCertBuf, (word32)eccClientCertBufSz, eccClientCertBuf, (word32)eccClientCertBufSz,
eccClientPrivKeyBuf, (word32)eccClientPrivKeyBufSz); eccClientPrivKeyBuf, (word32)eccClientPrivKeyBufSz);
#ifndef NO_AES
if (ret >= 0) if (ret >= 0)
ret = pkcs7callback_test( ret = pkcs7callback_test(
rsaClientCertBuf, (word32)rsaClientCertBufSz, rsaClientCertBuf, (word32)rsaClientCertBufSz,
rsaClientPrivKeyBuf, (word32)rsaClientPrivKeyBufSz); rsaClientPrivKeyBuf, (word32)rsaClientPrivKeyBufSz);
#endif
XFREE(rsaClientCertBuf, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); XFREE(rsaClientCertBuf, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
XFREE(rsaClientPrivKeyBuf, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); XFREE(rsaClientPrivKeyBuf, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);