From c001ce33137993a0c4ff15060ed1639826bfca0b Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Tue, 1 Mar 2016 18:06:15 +0000 Subject: Convert CRYPTO_LOCK_X509_* to new multi-threading API Reviewed-by: Matt Caswell Reviewed-by: Rich Salz --- include/openssl/asn1t.h | 4 ++-- include/openssl/crypto.h | 5 ----- include/openssl/x509.h | 2 ++ include/openssl/x509_vfy.h | 2 ++ 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'include/openssl') diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index 1a17ee9..455efff 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -207,8 +207,8 @@ extern "C" { static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 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), offsetof(tname, lock), cb, 0}; \ ASN1_SEQUENCE(tname) # define ASN1_SEQUENCE_enc(tname, enc, cb) \ diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index ca3eb3c..41eac25 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -165,11 +165,6 @@ extern "C" { * names in cryptlib.c */ -# define CRYPTO_LOCK_X509 3 -# define CRYPTO_LOCK_X509_INFO 4 -# define CRYPTO_LOCK_X509_PKEY 5 -# define CRYPTO_LOCK_X509_CRL 6 -# define CRYPTO_LOCK_X509_REQ 7 # define CRYPTO_LOCK_X509_STORE 11 # define CRYPTO_LOCK_SSL_CTX 12 # define CRYPTO_LOCK_SSL_CERT 13 diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 294ab83..fe60dc8 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -312,6 +312,7 @@ typedef struct private_key_st { /* expanded version of 'enc_algor' */ EVP_CIPHER_INFO cipher; int references; + CRYPTO_RWLOCK *lock; } X509_PKEY; typedef struct X509_info_st { @@ -322,6 +323,7 @@ typedef struct X509_info_st { int enc_len; char *enc_data; int references; + CRYPTO_RWLOCK *lock; } X509_INFO; DEFINE_STACK_OF(X509_INFO) diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h index f2bd073..e883349 100644 --- a/include/openssl/x509_vfy.h +++ b/include/openssl/x509_vfy.h @@ -179,6 +179,7 @@ struct x509_store_st { int (*cleanup) (X509_STORE_CTX *ctx); CRYPTO_EX_DATA ex_data; int references; + CRYPTO_RWLOCK *lock; } /* X509_STORE */ ; int X509_STORE_set_depth(X509_STORE *store, int depth); @@ -430,6 +431,7 @@ void X509_OBJECT_up_ref_count(X509_OBJECT *a); void X509_OBJECT_free_contents(X509_OBJECT *a); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); +int X509_STORE_up_ref(X509_STORE *v); STACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); -- cgit v1.1