From 6fb174e564a839e9b3bdffaab5353c89ee1e826d Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 15 May 2015 15:53:28 -0700 Subject: [PATCH] Remove last references to named locks. These ASN.1 macros are the last references to the old-style OpenSSL locks that remain. The ASN.1 reference count handling was changed in a previous commit to use |CRYPTO_refcount_*| so these lock references were unused anyway. Change-Id: I1b27eef140723050a8e6878a1bea11da3409d0eb Reviewed-on: https://boringssl-review.googlesource.com/4776 Reviewed-by: Adam Langley --- crypto/x509/x_crl.c | 2 +- crypto/x509/x_req.c | 2 +- crypto/x509/x_x509.c | 2 +- include/openssl/asn1t.h | 13 ++++++------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c index 9af13c01..2f41bb14 100644 --- a/crypto/x509/x_crl.c +++ b/crypto/x509/x_crl.c @@ -373,7 +373,7 @@ static void setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp) DIST_POINT_set_dpname(idp->distpoint, X509_CRL_get_issuer(crl)); } -ASN1_SEQUENCE_ref(X509_CRL, crl_cb, CRYPTO_LOCK_X509_CRL) = { +ASN1_SEQUENCE_ref(X509_CRL, crl_cb) = { ASN1_SIMPLE(X509_CRL, crl, X509_CRL_INFO), ASN1_SIMPLE(X509_CRL, sig_alg, X509_ALGOR), ASN1_SIMPLE(X509_CRL, signature, ASN1_BIT_STRING) diff --git a/crypto/x509/x_req.c b/crypto/x509/x_req.c index 8bf4613b..3d301297 100644 --- a/crypto/x509/x_req.c +++ b/crypto/x509/x_req.c @@ -102,7 +102,7 @@ ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb) = { IMPLEMENT_ASN1_FUNCTIONS(X509_REQ_INFO) -ASN1_SEQUENCE_ref(X509_REQ, 0, CRYPTO_LOCK_X509_REQ) = { +ASN1_SEQUENCE_ref(X509_REQ, 0) = { ASN1_SIMPLE(X509_REQ, req_info, X509_REQ_INFO), ASN1_SIMPLE(X509_REQ, sig_alg, X509_ALGOR), ASN1_SIMPLE(X509_REQ, signature, ASN1_BIT_STRING) diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c index 289e5fca..c975dd35 100644 --- a/crypto/x509/x_x509.c +++ b/crypto/x509/x_x509.c @@ -131,7 +131,7 @@ static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, } -ASN1_SEQUENCE_ref(X509, x509_cb, CRYPTO_LOCK_X509) = { +ASN1_SEQUENCE_ref(X509, x509_cb) = { ASN1_SIMPLE(X509, cert_info, X509_CINF), ASN1_SIMPLE(X509, sig_alg, X509_ALGOR), ASN1_SIMPLE(X509, signature, ASN1_BIT_STRING) diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index 2945fa8e..0f2560b7 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -149,19 +149,19 @@ extern "C" { ASN1_SEQUENCE_cb(tname, cb) #define ASN1_SEQUENCE_cb(tname, cb) \ - static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, cb, 0}; \ ASN1_SEQUENCE(tname) #define ASN1_BROKEN_SEQUENCE(tname) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0}; \ ASN1_SEQUENCE(tname) -#define ASN1_SEQUENCE_ref(tname, cb, lck) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ +#define ASN1_SEQUENCE_ref(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), cb, 0}; \ ASN1_SEQUENCE(tname) #define ASN1_SEQUENCE_enc(tname, enc, cb) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, cb, offsetof(tname, enc)}; \ ASN1_SEQUENCE(tname) #define ASN1_NDEF_SEQUENCE_END(tname) \ @@ -233,7 +233,7 @@ extern "C" { static const ASN1_TEMPLATE tname##_ch_tt[] #define ASN1_CHOICE_cb(tname, cb) \ - static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, cb, 0}; \ ASN1_CHOICE(tname) #define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) @@ -670,7 +670,6 @@ typedef struct ASN1_AUX_st { void *app_data; int flags; int ref_offset; /* Offset of reference value */ - int ref_lock; /* Lock type to use */ ASN1_aux_cb *asn1_cb; int enc_offset; /* Offset of ASN1_ENCODING structure */ } ASN1_AUX;