X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdh%2Fdh_lib.c;h=4530ce734535c229601ccaa8f4483af24b686085;hp=adf177151486b73ce18418148e225f2740f9fa6f;hb=cd420b0b1f2336972e386eba1cccf23b47d99538;hpb=b84e12266f85156f58804ff94ea110890f13b52d diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index adf1771514..4530ce7345 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -9,24 +9,11 @@ #include #include "internal/cryptlib.h" +#include "internal/refcount.h" #include #include "dh_locl.h" #include -static const DH_METHOD *default_DH_method = NULL; - -void DH_set_default_method(const DH_METHOD *meth) -{ - default_DH_method = meth; -} - -const DH_METHOD *DH_get_default_method(void) -{ - if (!default_DH_method) - default_DH_method = DH_OpenSSL(); - return default_DH_method; -} - int DH_set_method(DH *dh, const DH_METHOD *meth) { /* @@ -111,7 +98,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 +129,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);