mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-30 15:32:58 +00:00
Improve comments explaining legacy_methods_compression handling
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
parent
0a9e8a3a18
commit
e2a6aa5369
@ -1355,17 +1355,16 @@ static int ssl_tls13_parse_client_hello(mbedtls_ssl_context *ssl,
|
||||
* compression methods and the length of the extensions.
|
||||
*
|
||||
* cipher_suites cipher_suites_len bytes
|
||||
* legacy_compression_methods 2 bytes
|
||||
* extensions_len 2 bytes
|
||||
* legacy_compression_methods length 1 byte
|
||||
*/
|
||||
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, cipher_suites_len + 2 + 2);
|
||||
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, cipher_suites_len + 1);
|
||||
p += cipher_suites_len;
|
||||
cipher_suites_end = p;
|
||||
|
||||
/* Check if we have enough data for legacy_compression_methods
|
||||
* and a length byte.
|
||||
* and the length of the extensions (2 bytes).
|
||||
*/
|
||||
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, end, 1 + p[0]);
|
||||
MBEDTLS_SSL_CHK_BUF_READ_PTR(p + 1, end, p[0] + 2);
|
||||
|
||||
/*
|
||||
* Search for the supported versions extension and parse it to determine
|
||||
|
Loading…
x
Reference in New Issue
Block a user