aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaleed Elmelegy <waleed.elmelegy@arm.com>2024-03-14 01:39:39 +0000
committerWaleed Elmelegy <waleed.elmelegy@arm.com>2024-03-15 12:12:15 +0000
commit131b2ffd8962dae3264d98064886b83a660b6668 (patch)
tree0c1fb2c33bba314ded72444878ee86dd987b649f
parent44ccc8764bfbcf2e5d1c167191a89a6e512676ea (diff)
downloadmbedtls-131b2ffd8962dae3264d98064886b83a660b6668.zip
mbedtls-131b2ffd8962dae3264d98064886b83a660b6668.tar.gz
mbedtls-131b2ffd8962dae3264d98064886b83a660b6668.tar.bz2
Fix bug in ALPN negotiating
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
-rw-r--r--ChangeLog.d/fix-alpn-negotiating-bug.txt3
-rw-r--r--library/ssl_tls.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog.d/fix-alpn-negotiating-bug.txt b/ChangeLog.d/fix-alpn-negotiating-bug.txt
new file mode 100644
index 0000000..3bceb37
--- /dev/null
+++ b/ChangeLog.d/fix-alpn-negotiating-bug.txt
@@ -0,0 +1,3 @@
+Bugfix
+ * Fix the restoration of the ALPN when loading serialized connection with
+ * the mbedtls_ssl_context_load() API.
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index ac8e0ea..ffca53e 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -5423,7 +5423,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;
}