diff options
author | Jean-Philippe Menil <jpmenil@gmail.com> | 2021-03-25 17:21:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-03-25 22:57:20 +0100 |
commit | 5930cb1c465ef5f0de6f1b91a843bb6f0bed1f23 (patch) | |
tree | 15fb31ae2ba3c56a495b3f419c7ad202da0a7b81 /lib | |
parent | 7b6bfd2d78cfead3f1dfadbcedc92e4fbb24ff7c (diff) | |
download | curl-5930cb1c465ef5f0de6f1b91a843bb6f0bed1f23.tar.gz |
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 <jpmenil@gmail.com>
Closes #6794
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vtls/openssl.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 |