]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Check SSL_set1_chain error in set_cert_cb
authorpanda <daniel.phan36@gmail.com>
Mon, 8 Mar 2021 21:12:42 +0000 (13:12 -0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 12 Mar 2021 09:14:13 +0000 (10:14 +0100)
CLA: trivial

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14469)

(cherry picked from commit 1aa7ecd0d3f6d9c3739cf2e2d87673a3be03b352)

apps/s_cb.c

index 6406ddfb9e1b20c4a817e6b315054166cd1180f7..7241df4978fd5b4758ed61878c0a6cf99c13887d 100644 (file)
@@ -934,7 +934,8 @@ static int set_cert_cb(SSL *ssl, void *arg)
                 if (!SSL_build_cert_chain(ssl, 0))
                     return 0;
             } else if (exc->chain != NULL) {
-                SSL_set1_chain(ssl, exc->chain);
+                if (!SSL_set1_chain(ssl, exc->chain))
+                    return 0;
             }
         }
         exc = exc->prev;