diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2016-08-27 16:01:08 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2016-11-17 22:02:25 +0100 |
commit | 2f545ae45d4b93649e40ff7f93e2c3e6ce3154ae (patch) | |
tree | f29ebce27f6c271c3e7f99a3f96df6c4aadd5404 /crypto/include | |
parent | b6c6898234a12b9c6cdaa8f16fb9156097649ad7 (diff) |
Add support for reference counting using C11 atomics
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1500
Diffstat (limited to 'crypto/include')
-rw-r--r-- | crypto/include/internal/evp_int.h | 4 | ||||
-rw-r--r-- | crypto/include/internal/x509_int.h | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/crypto/include/internal/evp_int.h b/crypto/include/internal/evp_int.h index d1e607e7d3..0809dc3d05 100644 --- a/crypto/include/internal/evp_int.h +++ b/crypto/include/internal/evp_int.h @@ -7,6 +7,8 @@ * https://www.openssl.org/source/license.html */ +#include "internal/refcount.h" + struct evp_pkey_ctx_st { /* Method associated with this operation */ const EVP_PKEY_METHOD *pmeth; @@ -353,7 +355,7 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } struct evp_pkey_st { int type; int save_type; - int references; + CRYPTO_REF_COUNT references; const EVP_PKEY_ASN1_METHOD *ameth; ENGINE *engine; union { diff --git a/crypto/include/internal/x509_int.h b/crypto/include/internal/x509_int.h index 2845026dd8..10b605f709 100644 --- a/crypto/include/internal/x509_int.h +++ b/crypto/include/internal/x509_int.h @@ -7,6 +7,8 @@ * https://www.openssl.org/source/license.html */ +#include "internal/refcount.h" + /* Internal X509 structures and functions: not for application use */ /* Note: unless otherwise stated a field pointer is mandatory and should @@ -54,7 +56,7 @@ struct X509_req_st { X509_REQ_INFO req_info; /* signed certificate request data */ X509_ALGOR sig_alg; /* signature algorithm */ ASN1_BIT_STRING *signature; /* signature */ - int references; + CRYPTO_REF_COUNT references; CRYPTO_RWLOCK *lock; }; @@ -73,7 +75,7 @@ struct X509_crl_st { X509_CRL_INFO crl; /* signed CRL data */ X509_ALGOR sig_alg; /* CRL signature algorithm */ ASN1_BIT_STRING signature; /* CRL signature */ - int references; + CRYPTO_REF_COUNT references; int flags; /* * Cached copies of decoded extension values, since extensions @@ -144,7 +146,7 @@ struct x509_st { X509_CINF cert_info; X509_ALGOR sig_alg; ASN1_BIT_STRING signature; - int references; + CRYPTO_REF_COUNT references; CRYPTO_EX_DATA ex_data; /* These contain copies of various extension values */ long ex_pathlen; |