mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
mbedtls_ssl_conf_alpn_protocols: declare list elements as const
This reflects the fact that the library will not modify the list, and allows the list to be read from a const buffer. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -158,7 +158,7 @@ static int ssl_tls13_parse_alpn_ext(mbedtls_ssl_context *ssl,
|
||||
|
||||
/* Check that the server chosen protocol was in our list and save it */
|
||||
MBEDTLS_SSL_CHK_BUF_READ_PTR(p, protocol_name_list_end, protocol_name_len);
|
||||
for (const char **alpn = ssl->conf->alpn_list; *alpn != NULL; alpn++) {
|
||||
for (const char *const *alpn = ssl->conf->alpn_list; *alpn != NULL; alpn++) {
|
||||
if (protocol_name_len == strlen(*alpn) &&
|
||||
memcmp(p, *alpn, protocol_name_len) == 0) {
|
||||
ssl->alpn_chosen = *alpn;
|
||||
|
Reference in New Issue
Block a user