In TLS 1.3, don't allow multiple ChangeCipherSpecs in a row

This commit is contained in:
Sean Parkinson
2020-04-27 15:27:02 +10:00
parent 5376763638
commit df1b7f34f1

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