diff options
Diffstat (limited to 'deps/openssl/openssl/crypto/dsa/dsa_lib.c')
-rw-r--r-- | deps/openssl/openssl/crypto/dsa/dsa_lib.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/deps/openssl/openssl/crypto/dsa/dsa_lib.c b/deps/openssl/openssl/crypto/dsa/dsa_lib.c index 08956b9e3d..1048601beb 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_lib.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_lib.c @@ -7,10 +7,9 @@ * https://www.openssl.org/source/license.html */ -/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ - #include <stdio.h> #include "internal/cryptlib.h" +#include "internal/refcount.h" #include <openssl/bn.h> #include "dsa_locl.h" #include <openssl/asn1.h> @@ -108,7 +107,7 @@ void DSA_free(DSA *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("DSA", r); if (i > 0) return; @@ -136,7 +135,7 @@ int DSA_up_ref(DSA *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("DSA", r); @@ -163,17 +162,17 @@ int DSA_size(const DSA *r) i = i2d_ASN1_INTEGER(&bs, NULL); i += i; /* r and s */ ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE); - return (ret); + return ret; } int DSA_set_ex_data(DSA *d, int idx, void *arg) { - return (CRYPTO_set_ex_data(&d->ex_data, idx, arg)); + return CRYPTO_set_ex_data(&d->ex_data, idx, arg); } void *DSA_get_ex_data(DSA *d, int idx) { - return (CRYPTO_get_ex_data(&d->ex_data, idx)); + return CRYPTO_get_ex_data(&d->ex_data, idx); } int DSA_security_bits(const DSA *d) @@ -308,6 +307,31 @@ int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) return 1; } +const BIGNUM *DSA_get0_p(const DSA *d) +{ + return d->p; +} + +const BIGNUM *DSA_get0_q(const DSA *d) +{ + return d->q; +} + +const BIGNUM *DSA_get0_g(const DSA *d) +{ + return d->g; +} + +const BIGNUM *DSA_get0_pub_key(const DSA *d) +{ + return d->pub_key; +} + +const BIGNUM *DSA_get0_priv_key(const DSA *d) +{ + return d->priv_key; +} + void DSA_clear_flags(DSA *d, int flags) { d->flags &= ~flags; |