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:
Gilles Peskine
2025-05-27 19:45:29 +02:00
parent 2744a43977
commit c4949d1426
6 changed files with 15 additions and 9 deletions

View File

@@ -1569,7 +1569,7 @@ struct mbedtls_ssl_config {
#endif /* MBEDTLS_SSL_EARLY_DATA */
#if defined(MBEDTLS_SSL_ALPN)
const char **MBEDTLS_PRIVATE(alpn_list); /*!< ordered list of protocols */
const char *const *MBEDTLS_PRIVATE(alpn_list); /*!< ordered list of protocols */
#endif
#if defined(MBEDTLS_SSL_DTLS_SRTP)
@@ -4011,7 +4011,8 @@ int mbedtls_ssl_set_hs_ecjpake_password_opaque(mbedtls_ssl_context *ssl,
*
* \return 0 on success, or MBEDTLS_ERR_SSL_BAD_INPUT_DATA.
*/
int mbedtls_ssl_conf_alpn_protocols(mbedtls_ssl_config *conf, const char **protos);
int mbedtls_ssl_conf_alpn_protocols(mbedtls_ssl_config *conf,
const char *const *protos);
/**
* \brief Get the name of the negotiated Application Layer Protocol.