mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-08-24 20:19:52 +00:00
Add ALPN checking when accepting early data
Signed-off-by: Waleed Elmelegy <[email protected]>
This commit is contained in:
@@ -78,6 +78,10 @@ enum {
|
||||
#undef MBEDTLS_SSL_TLS1_3_LABEL
|
||||
};
|
||||
|
||||
#if defined(MBEDTLS_SSL_ALPN)
|
||||
#define MBEDTLS_TEST_MAX_ALPN_LIST_SIZE 10
|
||||
#endif
|
||||
|
||||
typedef struct mbedtls_test_ssl_log_pattern {
|
||||
const char *pattern;
|
||||
size_t counter;
|
||||
@@ -118,6 +122,9 @@ typedef struct mbedtls_test_handshake_test_options {
|
||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||
mbedtls_ssl_cache_context *cache;
|
||||
#endif
|
||||
#if defined(MBEDTLS_SSL_ALPN)
|
||||
const char *alpn_list[MBEDTLS_TEST_MAX_ALPN_LIST_SIZE];
|
||||
#endif
|
||||
} mbedtls_test_handshake_test_options;
|
||||
|
||||
/*
|
||||
|
||||
@@ -833,6 +833,12 @@ int mbedtls_test_ssl_endpoint_init(
|
||||
options->max_early_data_size);
|
||||
}
|
||||
#endif
|
||||
#if defined(MBEDTLS_SSL_ALPN)
|
||||
/* check that alpn_list contains at least one valid entry */
|
||||
if (options->alpn_list[0] != NULL) {
|
||||
mbedtls_ssl_conf_alpn_protocols(&(ep->conf), options->alpn_list);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_SSL_CACHE_C) && defined(MBEDTLS_SSL_SRV_C)
|
||||
|
||||
Reference in New Issue
Block a user