Maintenance: Secure Renegotiation

Allow sending application data during the secure renegotiation.
This commit is contained in:
John Safranek 2020-01-08 11:50:18 -08:00
parent d257003341
commit 1f0f3eb97d
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A

View File

@ -16528,6 +16528,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 +16586,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) {