mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-06 15:39:42 +00:00
Ensure application data records are not kept when fully processed
This commit fixes the following case: If a client is both expecting a SERVER_HELLO and has an application data record that's partially processed in flight (that's the situation the client gets into after receiving a ServerHelloRequest followed by ApplicationData), a subsequent call to mbedtls_ssl_read will set keep_current_message = 1 when seeing the unexpected application data, but not reset it to 0 after the application data has been processed. This commit fixes this.
This commit is contained in:
parent
bfbc494114
commit
cc019084b8
|
@ -6780,8 +6780,11 @@ int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len )
|
|||
ssl->in_msglen -= n;
|
||||
|
||||
if( ssl->in_msglen == 0 )
|
||||
{
|
||||
/* all bytes consumed */
|
||||
ssl->in_offt = NULL;
|
||||
ssl->keep_current_message = 0;
|
||||
}
|
||||
else
|
||||
/* more data available */
|
||||
ssl->in_offt += n;
|
||||
|
|
Loading…
Reference in a new issue