Fix the return value for SSL_get0_chain_certs()
authorMatt Caswell <matt@openssl.org>
Tue, 16 Jul 2019 14:32:35 +0000 (15:32 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 17 Jul 2019 11:31:57 +0000 (12:31 +0100)
This function was always returning 0. It should return 1 on success.

Fixes #9374

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/9395)

ssl/s3_lib.c

index 3238fd9b7e1730511667eb0536fe6909719a794d..8a22d01325dbdc21def41b60dd4abd7cb66cbfc9 100644 (file)
@@ -3552,6 +3552,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
 
     case SSL_CTRL_GET_CHAIN_CERTS:
         *(STACK_OF(X509) **)parg = s->cert->key->chain;
+        ret = 1;
         break;
 
     case SSL_CTRL_SELECT_CURRENT_CERT: