update for async build and include for getenv

This commit is contained in:
Jacob Barthelmeh
2018-01-18 09:05:21 -07:00
parent 2a308bdda9
commit 377f5c304c
6 changed files with 13 additions and 41 deletions

View File

@@ -24766,8 +24766,7 @@ int wolfSSL_HMAC_CTX_copy(WOLFSSL_HMAC_CTX* des, WOLFSSL_HMAC_CTX* src)
WC_HMAC_BLOCK_SIZE);
#ifdef WOLFSSL_ASYNC_CRYPT
XMEMCPY(des->hmac.asyncDev, src->hmac.asyncDev, sizeof(WC_ASYNC_DEV));
XMEMCPY(des->hmac.keyRaw, src->hmac.keyRaw, WC_HMAC_BLOCK_SIZE);
XMEMCPY(&des->hmac.asyncDev, &src->hmac.asyncDev, sizeof(WC_ASYNC_DEV));
des->hmac.keyLen = src->hmac.keyLen;
#ifdef HAVE_CAVIUM
des->hmac.data = (byte*)XMALLOC(src->hmac.dataLen, des->heap,

View File

@@ -4073,26 +4073,6 @@ int wc_ecc_verify_hash(const byte* sig, word32 siglen, const byte* hash,
return ECC_BAD_ARG_E;
}
#ifdef WOLFSSL_ASYNC_CRYPT
if (key->asyncDev.marker == WOLFSSL_ASYNC_MARKER_ECC) {
#ifdef HAVE_CAVIUM
/* TODO: Not implemented */
#else
AsyncCryptTestDev* testDev = &key->asyncDev.dev;
if (testDev->type == ASYNC_TEST_NONE) {
testDev->type = ASYNC_TEST_ECC_VERIFY;
testDev->eccVerify.in = sig;
testDev->eccVerify.inSz = siglen;
testDev->eccVerify.out = hash;
testDev->eccVerify.outSz = hashlen;
testDev->eccVerify.stat = state;
testDev->eccVerify.key = key;
return WC_PENDING_E;
}
#endif
}
#endif
switch(key->state) {
case ECC_STATE_NONE:
case ECC_STATE_VERIFY_DECODE:

View File

@@ -4257,10 +4257,6 @@ int des3_test(void)
wc_Des3Free(&enc);
wc_Des3Free(&dec);
#ifdef WOLFSSL_ASYNC_CRYPT
wc_Des3AsyncFree(&enc);
wc_Des3AsyncFree(&dec);
#endif
return 0;
}
#endif /* NO_DES */

View File

@@ -43,10 +43,7 @@
* to need the size of the structure. */
typedef struct WOLFSSL_AES_KEY {
/* aligned and big enough for Aes from wolfssl/wolfcrypt/aes.h */
ALIGN16 void* holder[360 / sizeof(void*)];
#ifdef WOLFSSL_ASYNC_CRYPT
void* additional[64 / sizeof(void*)]; /* async uses additional memory */
#endif
ALIGN16 void* holder[(360 + WC_ASYNC_DEV_SIZE)/ sizeof(void*)];
#ifdef GCM_TABLE
/* key-based fast multiplication table. */
ALIGN16 void* M0[4096 / sizeof(void*)];

View File

@@ -39,10 +39,7 @@
* the size of RC4_KEY structures. */
typedef struct WOLFSSL_RC4_KEY {
/* big enough for Arc4 from wolfssl/wolfcrypt/arc4.h */
unsigned char holder[272];
#ifdef WOLFSSL_ASYNC_CRYPT
unsigned char additional[64]; /* async uses additional memory */
#endif
void* holder[(272 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
} WOLFSSL_RC4_KEY;
typedef WOLFSSL_RC4_KEY RC4_KEY;

View File

@@ -327,7 +327,8 @@
/* snprintf is used in asn.c for GetTimeString, PKCS7 test, and when
debugging is turned on */
#ifndef USE_WINDOWS_API
#if defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA)
#if defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) && \
!defined(NO_STDIO_FILESYSTEM)
/* case where stdio is not included else where but is needed for
* snprintf */
#include <stdio.h>
@@ -337,12 +338,6 @@
#define XSNPRINTF _snprintf
#endif
#ifdef OPENSSL_EXTRA
#ifndef XGETENV
#define XGETENV getenv
#endif
#endif /* OPENSSL_EXTRA */
#if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN)
/* use only Thread Safe version of strtok */
#if defined(__MINGW32__) || defined(WOLFSSL_TIRTOS) || \
@@ -359,6 +354,14 @@
#endif
#endif
#if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) && \
!defined(NO_STDIO_FILESYSTEM)
#ifndef XGETENV
#include <stdlib.h>
#define XGETENV getenv
#endif
#endif /* OPENSSL_EXTRA */
#ifndef CTYPE_USER
#include <ctype.h>
#if defined(HAVE_ECC) || defined(HAVE_OCSP) || \