From 5930cb1c465ef5f0de6f1b91a843bb6f0bed1f23 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Menil Date: Thu, 25 Mar 2021 17:21:24 +0100 Subject: openssl: ensure to check SSL_CTX_set_alpn_protos return values SSL_CTX_set_alpn_protos() return 0 on success, and non-0 on failure Signed-off-by: Jean-Philippe Menil Closes #6794 --- lib/vtls/openssl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index a9690383d..498f8b9d1 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2749,7 +2749,10 @@ static CURLcode ossl_connect_step1(struct Curl_easy *data, /* expects length prefixed preference ordered list of protocols in wire * format */ - SSL_CTX_set_alpn_protos(backend->ctx, protocols, cur); + if(SSL_CTX_set_alpn_protos(backend->ctx, protocols, cur)) { + failf(data, "Error setting ALPN"); + return CURLE_SSL_CONNECT_ERROR; + } } #endif -- cgit v1.2.1