diff --git a/examples/client/client.c b/examples/client/client.c index 63f91a59c..e2f2e3f40 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -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 */ diff --git a/src/internal.c b/src/internal.c index d56d63e86..d4455b5d2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -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; diff --git a/src/tls13.c b/src/tls13.c index 63a57c0e2..b2229c2f1 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -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) { diff --git a/tests/suites.c b/tests/suites.c index e4dd93a0d..d41c3e274 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -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++) diff --git a/tests/test-tls13-down.conf b/tests/test-tls13-down.conf index b52910e67..181b286eb 100644 --- a/tests/test-tls13-down.conf +++ b/tests/test-tls13-down.conf @@ -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 diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 960b5a01d..fb50e5cd9 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -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)