Merge pull request #1884 from kaleb-himes/ECC_DISABLED_TEST_FIX

Fixes to resolve skipped tests with ECC disabled
This commit is contained in:
toddouska 2018-10-24 09:30:47 -07:00 committed by GitHub
commit 0eb115e7a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 20 deletions

View File

@ -2202,7 +2202,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
#endif
}
if (!usePsk && !useAnon && (!useVerifyCb || myVerifyFail)) {
if (!usePsk && !useAnon && !useVerifyCb && !myVerifyFail) {
#ifndef TEST_LOAD_BUFFER
if (wolfSSL_CTX_load_verify_locations(ctx, verifyCert, 0)
!= WOLFSSL_SUCCESS) {
@ -2235,7 +2235,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
}
#endif /* WOLFSSL_TRUST_PEER_CERT && !NO_FILESYSTEM */
}
if (useVerifyCb)
if (useVerifyCb || myVerifyFail)
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_PEER, myVerify);
else if (!usePsk && !useAnon && doPeerCheck == 0)
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, 0);
@ -2617,14 +2617,8 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
}
else {
#ifdef WOLFSSL_EARLY_DATA
#ifndef HAVE_SESSION_TICKET
if (!usePsk) {
}
else
#endif
if (earlyData) {
if (usePsk && earlyData)
EarlyData(ctx, ssl, msg, msgSz, buffer);
}
#endif
do {
err = 0; /* reset error */

View File

@ -16359,7 +16359,7 @@ int SetCipherList(WOLFSSL_CTX* ctx, Suites* suites, const char* list)
if (next[0] == 0 || XSTRNCMP(next, "ALL", 3) == 0 ||
XSTRNCMP(next, "DEFAULT", 7) == 0)
return 1; /* wolfSSL defualt */
return 1; /* wolfSSL default */
do {
char* current = next;
@ -20047,7 +20047,7 @@ int SendClientKeyExchange(WOLFSSL* ssl)
break;
}
#endif /* !NO_DH && !NO_PSK */
#if defined(HAVE_ECC) && !defined(HAVE_CURVE25519) && \
#if (defined(HAVE_ECC) || defined(HAVE_CURVE25519)) && \
!defined(NO_PSK)
case ecdhe_psk_kea:
{
@ -20062,7 +20062,7 @@ int SendClientKeyExchange(WOLFSSL* ssl)
*args->output = (byte)args->length;
args->encSz += args->length + OPAQUE8_LEN;
/* Create pre master secret is the concatination of
/* Create pre master secret is the concatenation of
eccSize + eccSharedKey + pskSize + pskKey */
c16toa((word16)ssl->arrays->preMasterSz, pms);
ssl->arrays->preMasterSz += OPAQUE16_LEN;
@ -20078,7 +20078,7 @@ int SendClientKeyExchange(WOLFSSL* ssl)
ssl->arrays->psk_keySz = 0; /* No further need */
break;
}
#endif /* (HAVE_ECC && !HAVE_CURVE25519) && !NO_PSK */
#endif /* (HAVE_ECC || HAVE_CURVE25519) && !NO_PSK */
#ifdef HAVE_NTRU
case ntru_kea:
{
@ -23501,7 +23501,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
#endif /* WOLFSSL_DTLS */
{
/* copmression match types */
/* compression match types */
int matchNo = 0;
int matchZlib = 0;

View File

@ -8450,7 +8450,7 @@ int wolfSSL_write_early_data(WOLFSSL* ssl, const void* data, int sz, int* outSz)
if (ssl->options.handShakeState == NULL_STATE) {
ssl->earlyData = expecting_early_data;
ret = wolfSSL_connect_TLSv13(ssl);
if (ret <= 0)
if (ret != WOLFSSL_SUCCESS)
return WOLFSSL_FATAL_ERROR;
}
if (ssl->options.handShakeState == CLIENT_HELLO_COMPLETE) {

View File

@ -172,7 +172,7 @@ static int IsValidCert(const char* line)
begin = XSTRSTR(line, "-c ");
if (begin == NULL)
return 0;
return 1;
begin += 3;
for (i = 0; i < sizeof(cert) - 1 && *begin != ' ' && *begin != '\0'; i++)

View File

@ -1,9 +1,10 @@
# THIS TEST IS BROKEN
# server TLSv1.3 downgrade
-v d
-l TLS13-CHACHA20-POLY1305-SHA256
#-v d
#-l TLS13-CHACHA20-POLY1305-SHA256
# client TLSv1.2
-v 3
#-v 3
# server TLSv1.2
-v 3

View File

@ -670,7 +670,7 @@
defined(HAVE_ED25519))
#define BUILD_TLS_ECDHE_ECDSA_WITH_CHACHA20_OLD_POLY1305_SHA256
#endif
#ifndef NO_RSA
#if !defined(NO_RSA) && defined(HAVE_ECC)
#define BUILD_TLS_ECDHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256
#endif
#if !defined(NO_DH) && !defined(NO_RSA)