Merge branch 'master' into apache-fixes

This commit is contained in:
cariepointer
2020-01-09 16:33:35 -07:00
committed by GitHub
553 changed files with 3555 additions and 3105 deletions

View File

@@ -1,6 +1,6 @@
/* bio.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* crl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* internal.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -10164,7 +10164,8 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#ifdef OPENSSL_EXTRA
/* Determine untrusted depth */
if (!alreadySigner) {
if (!alreadySigner && (!args->dCert ||
!args->dCertInit || !args->dCert->selfSigned)) {
args->untrustedDepth = 1;
}
#endif
@@ -16528,6 +16529,23 @@ int SendCertificateStatus(WOLFSSL* ssl)
#endif /* WOLFSSL_NO_TLS12 */
/* If secure renegotiation is disabled, this will always return false.
* Otherwise it checks to see if we are currently renegotiating. */
static WC_INLINE int IsSCR(WOLFSSL* ssl)
{
#ifndef HAVE_SECURE_RENEGOTIATION
(void)ssl;
#else /* HAVE_SECURE_RENEGOTIATION */
if (ssl->secure_renegotiation &&
ssl->secure_renegotiation->enabled &&
ssl->options.handShakeState != HANDSHAKE_DONE)
return 1;
#endif /* HAVE_SECURE_RENEGOTIATION */
return 0;
}
int SendData(WOLFSSL* ssl, const void* data, int sz)
{
int sent = 0, /* plainText size */
@@ -16569,7 +16587,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz)
}
else
#endif
if (ssl->options.handShakeState != HANDSHAKE_DONE) {
if (ssl->options.handShakeState != HANDSHAKE_DONE && !IsSCR(ssl)) {
int err;
WOLFSSL_MSG("handshake not complete, trying to finish");
if ( (err = wolfSSL_negotiate(ssl)) != WOLFSSL_SUCCESS) {

View File

@@ -1,6 +1,6 @@
/* keys.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* ocsp.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* sniffer.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* ssl.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
@@ -23553,7 +23553,9 @@ void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY* key)
break;
}
wc_FreeMutex(&key->refMutex);
if (wc_FreeMutex(&key->refMutex) != 0) {
WOLFSSL_MSG("Couldn't free pkey mutex");
}
XFREE(key, key->heap, DYNAMIC_TYPE_PUBLIC_KEY);
}
}
@@ -35562,7 +35564,8 @@ err:
#define PEM_END_SZ 9
#define PEM_HDR_FIN "-----"
#define PEM_HDR_FIN_SZ 5
#define PEM_HDR_FIN_EOL "-----\n"
#define PEM_HDR_FIN_EOL_NEWLINE "-----\n"
#define PEM_HDR_FIN_EOL_NULL_TERM "-----\0"
#define PEM_HDR_FIN_EOL_SZ 6
int wolfSSL_PEM_read_bio(WOLFSSL_BIO* bio, char **name, char **header,
@@ -35698,8 +35701,12 @@ err:
ret = WOLFSSL_FAILURE;
}
if (ret == WOLFSSL_SUCCESS) {
if (XSTRNCMP(pem + PEM_END_SZ + nameLen, PEM_HDR_FIN_EOL,
PEM_HDR_FIN_EOL_SZ) != 0) {
if (XSTRNCMP(pem + PEM_END_SZ + nameLen,
PEM_HDR_FIN_EOL_NEWLINE,
PEM_HDR_FIN_EOL_SZ) != 0 &&
XSTRNCMP(pem + PEM_END_SZ + nameLen,
PEM_HDR_FIN_EOL_NULL_TERM,
PEM_HDR_FIN_EOL_SZ) != 0) {
ret = WOLFSSL_FAILURE;
}
}
@@ -35763,8 +35770,8 @@ err:
if (!err)
err = wolfSSL_BIO_write(bio, name, nameLen) != nameLen;
if (!err) {
err = wolfSSL_BIO_write(bio, PEM_HDR_FIN_EOL, PEM_HDR_FIN_EOL_SZ) !=
(int)PEM_HDR_FIN_EOL_SZ;
err = wolfSSL_BIO_write(bio, PEM_HDR_FIN_EOL_NEWLINE,
PEM_HDR_FIN_EOL_SZ) != (int)PEM_HDR_FIN_EOL_SZ;
}
if (!err && headerLen > 0) {
err = wolfSSL_BIO_write(bio, header, headerLen) != headerLen;
@@ -35781,8 +35788,8 @@ err:
if (!err)
err = wolfSSL_BIO_write(bio, name, nameLen) != nameLen;
if (!err) {
err = wolfSSL_BIO_write(bio, PEM_HDR_FIN_EOL, PEM_HDR_FIN_EOL_SZ) !=
(int)PEM_HDR_FIN_EOL_SZ;
err = wolfSSL_BIO_write(bio, PEM_HDR_FIN_EOL_NEWLINE,
PEM_HDR_FIN_EOL_SZ) != (int)PEM_HDR_FIN_EOL_SZ;
}
if (!err) {

View File

@@ -1,6 +1,6 @@
/* tls.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* tls13.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*

View File

@@ -1,6 +1,6 @@
/* wolfio.c
*
* Copyright (C) 2006-2019 wolfSSL Inc.
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*