mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Maintenance: Secure Renegotiation
Allow sending application data during the secure renegotiation.
This commit is contained in:
@@ -16528,6 +16528,23 @@ int SendCertificateStatus(WOLFSSL* ssl)
|
|||||||
|
|
||||||
#endif /* WOLFSSL_NO_TLS12 */
|
#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 SendData(WOLFSSL* ssl, const void* data, int sz)
|
||||||
{
|
{
|
||||||
int sent = 0, /* plainText size */
|
int sent = 0, /* plainText size */
|
||||||
@@ -16569,7 +16586,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (ssl->options.handShakeState != HANDSHAKE_DONE) {
|
if (ssl->options.handShakeState != HANDSHAKE_DONE && !IsSCR(ssl)) {
|
||||||
int err;
|
int err;
|
||||||
WOLFSSL_MSG("handshake not complete, trying to finish");
|
WOLFSSL_MSG("handshake not complete, trying to finish");
|
||||||
if ( (err = wolfSSL_negotiate(ssl)) != WOLFSSL_SUCCESS) {
|
if ( (err = wolfSSL_negotiate(ssl)) != WOLFSSL_SUCCESS) {
|
||||||
|
Reference in New Issue
Block a user