diff options
author | David Benjamin <davidben@chromium.org> | 2015-09-01 07:48:17 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-09-01 22:12:56 +0300 |
commit | 43c4d17230af10222e09380661308e3a8c72cfbc (patch) | |
tree | f2b1939937125d8eed003a82e54501ca70c5de52 /crypto/x509 | |
parent | 514834528212b00596ce95eb8d3dfab45379e16d (diff) |
Add X509_CRL_up_ref.
(Imported from upstream's 65cbf983ca4f69b8954f949c2edaaa48824481b3.)
Change-Id: I1e5d26ed8da5a44f68d22385b31d413628229c50
Reviewed-on: https://boringssl-review.googlesource.com/5784
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x509_lu.c | 4 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.c | 6 | ||||
-rw-r--r-- | crypto/x509/x509cset.c | 7 |
3 files changed, 12 insertions, 5 deletions
diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index aa2f5e54..6d7bc269 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -410,7 +410,7 @@ void X509_OBJECT_up_ref_count(X509_OBJECT *a) X509_up_ref(a->data.x509); break; case X509_LU_CRL: - CRYPTO_refcount_inc(&a->data.crl->references); + X509_CRL_up_ref(a->data.crl); break; } } @@ -572,7 +572,7 @@ STACK_OF(X509_CRL)* X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) { obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); x = obj->data.crl; - CRYPTO_refcount_inc(&x->references); + X509_CRL_up_ref(x); if (!sk_X509_CRL_push(sk, x)) { CRYPTO_MUTEX_unlock(&ctx->ctx->objs_lock); diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index c22ad34d..5d856f05 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -274,7 +274,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); goto end; } - CRYPTO_refcount_inc(&xtmp->references); + X509_up_ref(xtmp); (void)sk_X509_delete_ptr(sktmp,xtmp); ctx->last_untrusted++; x=xtmp; @@ -992,7 +992,7 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl, *pissuer = best_crl_issuer; *pscore = best_score; *preasons = best_reasons; - CRYPTO_refcount_inc(&best_crl->references); + X509_CRL_up_ref(best_crl); if (*pdcrl) { X509_CRL_free(*pdcrl); @@ -1099,7 +1099,7 @@ static void get_delta_sk(X509_STORE_CTX *ctx, X509_CRL **dcrl, int *pscore, { if (check_crl_time(ctx, delta, 0)) *pscore |= CRL_SCORE_TIME_DELTA; - CRYPTO_refcount_inc(&delta->references); + X509_CRL_up_ref(delta); *dcrl = delta; return; } diff --git a/crypto/x509/x509cset.c b/crypto/x509/x509cset.c index b526c69d..82d61d06 100644 --- a/crypto/x509/x509cset.c +++ b/crypto/x509/x509cset.c @@ -57,6 +57,8 @@ #include <openssl/obj.h> #include <openssl/x509.h> +#include "../internal.h" + int X509_CRL_set_version(X509_CRL *x, long version) { @@ -128,6 +130,11 @@ int X509_CRL_sort(X509_CRL *c) return 1; } +void X509_CRL_up_ref(X509_CRL *crl) + { + CRYPTO_refcount_inc(&crl->references); + } + int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) { ASN1_TIME *in; |