Merge pull request from hanno-arm/ssl_write_client_hello

Bounds checks in ssl_write_client_hello
This commit is contained in:
Manuel Pégourié-Gonnard 2020-06-15 10:57:51 +02:00 committed by GitHub
commit a92e3def48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 681 additions and 389 deletions
library

View file

@ -4665,7 +4665,9 @@ int mbedtls_ssl_conf_alpn_protocols( mbedtls_ssl_config *conf, const char **prot
cur_len = strlen( *p );
tot_len += cur_len;
if( cur_len == 0 || cur_len > 255 || tot_len > 65535 )
if( ( cur_len == 0 ) ||
( cur_len > MBEDTLS_SSL_MAX_ALPN_NAME_LEN ) ||
( tot_len > MBEDTLS_SSL_MAX_ALPN_LIST_LEN ) )
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
}