Merge pull request #2927 from SparkiDev/tls13_ccs

In TLS 1.3, don't allow multiple ChangeCipherSpecs in a row
This commit is contained in:
toddouska
2020-04-28 09:52:46 -07:00
committed by GitHub

View File

@@ -15157,6 +15157,7 @@ int ProcessReply(WOLFSSL* ssl)
}
else {
#ifdef WOLFSSL_TLS13
ssl->msgsReceived.got_change_cipher = 0;
ret = DoTls13HandShakeMsg(ssl,
ssl->buffers.inputBuffer.buffer,
&ssl->buffers.inputBuffer.idx,
@@ -15219,6 +15220,13 @@ int ProcessReply(WOLFSSL* ssl)
return UNKNOWN_RECORD_TYPE;
}
ssl->buffers.inputBuffer.idx++;
if (!ssl->msgsReceived.got_change_cipher) {
ssl->msgsReceived.got_change_cipher = 1;
}
else {
SendAlert(ssl, alert_fatal, illegal_parameter);
return UNKNOWN_RECORD_TYPE;
}
break;
}
#endif