Skip to content

Commit 1773a4a

Browse files
Send no_renegotiation alert when rejecting renegotation attempt as defined in RFC 5246 section 7.2.2.
1 parent e70e7cb commit 1773a4a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/internal.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18073,6 +18073,16 @@ int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1807318073
}
1807418074
#endif
1807518075

18076+
#if !defined(HAVE_SECURE_RENEGOTIATION)
18077+
if (ssl->options.handShakeState == HANDSHAKE_DONE && type == client_hello &&
18078+
ssl->options.side == WOLFSSL_SERVER_END){
18079+
WOLFSSL_MSG("Renegotiation request rejected");
18080+
SendAlert(ssl, alert_fatal, no_renegotiation);
18081+
WOLFSSL_ERROR_VERBOSE(SECURE_RENEGOTIATION_E);
18082+
return SECURE_RENEGOTIATION_E;
18083+
}
18084+
#endif
18085+
1807618086
if (ssl->options.handShakeState == HANDSHAKE_DONE && type != hello_request){
1807718087
WOLFSSL_MSG("HandShake message after handshake complete");
1807818088
SendAlert(ssl, alert_fatal, unexpected_message);

0 commit comments

Comments
 (0)