diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2014-02-14 13:33:43 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2014-02-14 15:12:52 +0000 |
commit | bf2d129194d5a8f2ccf5ff5261ab755e4fc9f98e (patch) | |
tree | cb6455c33f237ef0a52ae14d2f60889131793512 /crypto/x509 | |
parent | d59d0b7c21ef656b4b352b16e5f8fce97ecc6e23 (diff) |
Simplify X509_STORE_CTX_get1_chain (from master).
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x509_vfy.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index bcbf9ea550..990be83da3 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -2123,16 +2123,9 @@ STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) { - int i; - X509 *x; - STACK_OF(X509) *chain; - if (!ctx->chain || !(chain = sk_X509_dup(ctx->chain))) return NULL; - for (i = 0; i < sk_X509_num(chain); i++) - { - x = sk_X509_value(chain, i); - CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); - } - return chain; + if (!ctx->chain) + return NULL; + return X509_chain_up_ref(ctx->chain); } X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx) |