mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Merge pull request #4294 from dgarske/tls13_earlydata
Fix early data max size handling in TLS v1.3
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user