diff options
author | Matt Caswell <matt@openssl.org> | 2016-03-30 15:21:39 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-04-03 00:23:56 +0100 |
commit | 1258396d73cf937e4daaf2c35377011b9366f956 (patch) | |
tree | 6448183bf775904be79b29786795ade508f7fe4d /include | |
parent | 25c78440d21c814705e0e50c6e567300936aa02b (diff) |
Make the DSA structure opaque
Move the dsa_st structure out of the public header file. Add some accessor
functions to enable access to the internal fields, and update all internal
usage to use the new functions.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Stephen Henson <steve@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/dsa.h | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h index 240a1afa84..d0b631504d 100644 --- a/include/openssl/dsa.h +++ b/include/openssl/dsa.h @@ -143,29 +143,6 @@ struct dsa_method { int (*dsa_keygen) (DSA *dsa); }; -struct dsa_st { - /* - * This first variable is used to pick up errors where a DSA is passed - * instead of of a EVP_PKEY - */ - int pad; - long version; - BIGNUM *p; - BIGNUM *q; /* == 20 */ - BIGNUM *g; - BIGNUM *pub_key; /* y public key */ - BIGNUM *priv_key; /* x private key */ - int flags; - /* Normally used to cache montgomery values */ - BN_MONT_CTX *method_mont_p; - int references; - CRYPTO_EX_DATA ex_data; - const DSA_METHOD *meth; - /* functional reference if 'meth' is ENGINE-provided */ - ENGINE *engine; - CRYPTO_RWLOCK *lock; -}; - # define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) # define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ @@ -264,6 +241,18 @@ DH *DSA_dup_DH(const DSA *r); # define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2) # define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3) +BIGNUM *DSA_get0_p(const DSA *d); +BIGNUM *DSA_get0_q(const DSA *d); +BIGNUM *DSA_get0_g(const DSA *d); +int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g); +BIGNUM *DSA_get0_priv_key(const DSA *d); +BIGNUM *DSA_get0_pub_key(const DSA *d); +int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key); +void DSA_clear_flags(DSA *d, int flags); +int DSA_test_flags(const DSA *d, int flags); +void DSA_set_flags(DSA *d, int flags); +ENGINE *DSA_get0_engine(DSA *d); + /* BEGIN ERROR CODES */ /* * The following lines are auto generated by the script mkerr.pl. Any changes |