forked from wolfSSL/wolfssl
Additional checks for secure renegotiation
This commit is contained in:
10
src/ssl.c
10
src/ssl.c
@ -3168,6 +3168,11 @@ static int _Rehandshake(WOLFSSL* ssl)
|
|||||||
if (ssl == NULL)
|
if (ssl == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
|
if (IsAtLeastTLSv1_3(ssl->version)) {
|
||||||
|
WOLFSSL_MSG("Secure Renegotiation not supported in TLS 1.3");
|
||||||
|
return SECURE_RENEGOTIATION_E;
|
||||||
|
}
|
||||||
|
|
||||||
if (ssl->secure_renegotiation == NULL) {
|
if (ssl->secure_renegotiation == NULL) {
|
||||||
WOLFSSL_MSG("Secure Renegotiation not forced on by user");
|
WOLFSSL_MSG("Secure Renegotiation not forced on by user");
|
||||||
return SECURE_RENEGOTIATION_E;
|
return SECURE_RENEGOTIATION_E;
|
||||||
@ -3178,6 +3183,11 @@ static int _Rehandshake(WOLFSSL* ssl)
|
|||||||
return SECURE_RENEGOTIATION_E;
|
return SECURE_RENEGOTIATION_E;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ssl->keys.dtls_epoch == 0xFFFF) {
|
||||||
|
WOLFSSL_MSG("Secure Renegotiation not allowed. Epoch would wrap");
|
||||||
|
return SECURE_RENEGOTIATION_E;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the client started the renegotiation, the server will already
|
/* If the client started the renegotiation, the server will already
|
||||||
* have processed the client's hello. */
|
* have processed the client's hello. */
|
||||||
if (ssl->options.side != WOLFSSL_SERVER_END ||
|
if (ssl->options.side != WOLFSSL_SERVER_END ||
|
||||||
|
Reference in New Issue
Block a user