summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_lib.c4
-rw-r--r--crypto/dh/dh_locl.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index adf1771514..3dfe7c4e58 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -111,7 +111,7 @@ void DH_free(DH *r)
if (r == NULL)
return;
- CRYPTO_atomic_add(&r->references, -1, &i, r->lock);
+ CRYPTO_DOWN_REF(&r->references, &i, r->lock);
REF_PRINT_COUNT("DH", r);
if (i > 0)
return;
@@ -142,7 +142,7 @@ int DH_up_ref(DH *r)
{
int i;
- if (CRYPTO_atomic_add(&r->references, 1, &i, r->lock) <= 0)
+ if (CRYPTO_UP_REF(&r->references, &i, r->lock) <= 0)
return 0;
REF_PRINT_COUNT("DH", r);
diff --git a/crypto/dh/dh_locl.h b/crypto/dh/dh_locl.h
index 19301c3185..6867555c4a 100644
--- a/crypto/dh/dh_locl.h
+++ b/crypto/dh/dh_locl.h
@@ -8,6 +8,7 @@
*/
#include <openssl/dh.h>
+#include "internal/refcount.h"
struct dh_st {
/*
@@ -29,7 +30,7 @@ struct dh_st {
unsigned char *seed;
int seedlen;
BIGNUM *counter;
- int references;
+ CRYPTO_REF_COUNT references;
CRYPTO_EX_DATA ex_data;
const DH_METHOD *meth;
ENGINE *engine;