Merge pull request #4294 from dgarske/tls13_earlydata

Fix early data max size handling in TLS v1.3
This commit is contained in:
Sean Parkinson
2021-08-18 08:48:42 +10:00
committed by GitHub

View File

@ -15841,20 +15841,15 @@ int DoApplicationData(WOLFSSL* ssl, byte* input, word32* inOutIdx)
int process = 0;
if (ssl->options.side == WOLFSSL_SERVER_END) {
ssl->earlyDataSz += ssl->curSize;
if ((ssl->earlyData != no_early_data) &&
(ssl->options.clientState == CLIENT_HELLO_COMPLETE)) {
process = 1;
}
if (!process && (ssl->earlyDataSz <= ssl->options.maxEarlyDataSz)) {
if (!process) {
WOLFSSL_MSG("Ignoring EarlyData!");
*inOutIdx = ssl->buffers.inputBuffer.length;
return 0;
}
if (ssl->earlyDataSz > ssl->options.maxEarlyDataSz) {
WOLFSSL_MSG("Too much EarlyData!");
process = 0;
}
}
if (!process) {
WOLFSSL_MSG("Received App data before a handshake completed");