Fix bug in ALPN loading from serialized session

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
This commit is contained in:
Waleed Elmelegy 2024-03-15 14:29:24 +00:00
parent 89e9fa0978
commit 98ebf488f5
2 changed files with 4 additions and 1 deletions

View File

@ -0,0 +1,3 @@
Bugfix
* Fix the restoration of the ALPN when loading serialized connection with
* the mbedtls_ssl_context_load() API.

View File

@ -6680,7 +6680,7 @@ static int ssl_context_load(mbedtls_ssl_context *ssl,
/* alpn_chosen should point to an item in the configured list */
for (cur = ssl->conf->alpn_list; *cur != NULL; cur++) {
if (strlen(*cur) == alpn_len &&
memcmp(p, cur, alpn_len) == 0) {
memcmp(p, *cur, alpn_len) == 0) {
ssl->alpn_chosen = *cur;
break;
}