Merge pull request #3271 from SparkiDev/tls13_peek

TLS 1.3: allow wolfSSL_peek() to return WANT_READ
This commit is contained in:
toddouska 2020-09-16 15:02:42 -07:00 committed by GitHub
commit 85da1a1d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17895,6 +17895,16 @@ startScr:
goto startScr;
}
#endif
#ifdef WOLFSSL_TLS13
if (IsAtLeastTLSv1_3(ssl->version) && ssl->options.handShakeDone &&
ssl->curRL.type == handshake && peek) {
WOLFSSL_MSG("Got Handshake Messge in APP data");
if (ssl->buffers.inputBuffer.length == 0) {
ssl->error = WOLFSSL_ERROR_WANT_READ;
return 0;
}
}
#endif
}
if (sz < (int)ssl->buffers.clearOutputBuffer.length)