summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libssl/ssl_tlsext.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index f417f59b8e..a42856264b 100644
--- a/src/lib/libssl/ssl_tlsext.c
+++ b/src/lib/libssl/ssl_tlsext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_tlsext.c,v 1.128 2022/08/04 09:27:36 tb Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.129 2022/08/15 10:46:53 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -86,7 +86,7 @@ tlsext_alpn_check_format(CBS *cbs)
86static int 86static int
87tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert) 87tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert)
88{ 88{
89 CBS alpn; 89 CBS alpn, selected_cbs;
90 const unsigned char *selected; 90 const unsigned char *selected;
91 unsigned char selected_len; 91 unsigned char selected_len;
92 int r; 92 int r;
@@ -111,11 +111,9 @@ tlsext_alpn_server_parse(SSL *s, uint16_t msg_types, CBS *cbs, int *alert)
111 s->ctx->internal->alpn_select_cb_arg); 111 s->ctx->internal->alpn_select_cb_arg);
112 112
113 if (r == SSL_TLSEXT_ERR_OK) { 113 if (r == SSL_TLSEXT_ERR_OK) {
114 CBS cbs; 114 CBS_init(&selected_cbs, selected, selected_len);
115 115
116 CBS_init(&cbs, selected, selected_len); 116 if (!CBS_stow(&selected_cbs, &s->s3->alpn_selected,
117
118 if (!CBS_stow(&cbs, &s->s3->alpn_selected,
119 &s->s3->alpn_selected_len)) { 117 &s->s3->alpn_selected_len)) {
120 *alert = SSL_AD_INTERNAL_ERROR; 118 *alert = SSL_AD_INTERNAL_ERROR;
121 return 0; 119 return 0;