diff options
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa.h')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa.h | 85 |
1 files changed, 39 insertions, 46 deletions
diff --git a/src/lib/libcrypto/dsa/dsa.h b/src/lib/libcrypto/dsa/dsa.h index 12b60a8faa..9b3baadf2c 100644 --- a/src/lib/libcrypto/dsa/dsa.h +++ b/src/lib/libcrypto/dsa/dsa.h | |||
@@ -65,16 +65,17 @@ | |||
65 | #ifndef HEADER_DSA_H | 65 | #ifndef HEADER_DSA_H |
66 | #define HEADER_DSA_H | 66 | #define HEADER_DSA_H |
67 | 67 | ||
68 | #ifdef NO_DSA | 68 | #ifdef OPENSSL_NO_DSA |
69 | #error DSA is disabled. | 69 | #error DSA is disabled. |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #ifndef NO_BIO | 72 | #ifndef OPENSSL_NO_BIO |
73 | #include <openssl/bio.h> | 73 | #include <openssl/bio.h> |
74 | #endif | 74 | #endif |
75 | #include <openssl/bn.h> | 75 | #include <openssl/bn.h> |
76 | #include <openssl/crypto.h> | 76 | #include <openssl/crypto.h> |
77 | #ifndef NO_DH | 77 | #include <openssl/ossl_typ.h> |
78 | #ifndef OPENSSL_NO_DH | ||
78 | # include <openssl/dh.h> | 79 | # include <openssl/dh.h> |
79 | #endif | 80 | #endif |
80 | 81 | ||
@@ -116,7 +117,7 @@ struct dsa_st | |||
116 | /* This first variable is used to pick up errors where | 117 | /* This first variable is used to pick up errors where |
117 | * a DSA is passed instead of of a EVP_PKEY */ | 118 | * a DSA is passed instead of of a EVP_PKEY */ |
118 | int pad; | 119 | int pad; |
119 | int version; | 120 | long version; |
120 | int write_params; | 121 | int write_params; |
121 | BIGNUM *p; | 122 | BIGNUM *p; |
122 | BIGNUM *q; /* == 20 */ | 123 | BIGNUM *q; /* == 20 */ |
@@ -133,11 +134,9 @@ struct dsa_st | |||
133 | char *method_mont_p; | 134 | char *method_mont_p; |
134 | int references; | 135 | int references; |
135 | CRYPTO_EX_DATA ex_data; | 136 | CRYPTO_EX_DATA ex_data; |
136 | #if 0 | 137 | const DSA_METHOD *meth; |
137 | DSA_METHOD *meth; | 138 | /* functional reference if 'meth' is ENGINE-provided */ |
138 | #else | 139 | ENGINE *engine; |
139 | struct engine_st *engine; | ||
140 | #endif | ||
141 | }; | 140 | }; |
142 | 141 | ||
143 | #define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \ | 142 | #define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \ |
@@ -154,62 +153,55 @@ struct dsa_st | |||
154 | 153 | ||
155 | DSA_SIG * DSA_SIG_new(void); | 154 | DSA_SIG * DSA_SIG_new(void); |
156 | void DSA_SIG_free(DSA_SIG *a); | 155 | void DSA_SIG_free(DSA_SIG *a); |
157 | int i2d_DSA_SIG(DSA_SIG *a, unsigned char **pp); | 156 | int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); |
158 | DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length); | 157 | DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); |
159 | 158 | ||
160 | DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); | 159 | DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa); |
161 | int DSA_do_verify(const unsigned char *dgst,int dgst_len, | 160 | int DSA_do_verify(const unsigned char *dgst,int dgst_len, |
162 | DSA_SIG *sig,DSA *dsa); | 161 | DSA_SIG *sig,DSA *dsa); |
163 | 162 | ||
164 | DSA_METHOD *DSA_OpenSSL(void); | 163 | const DSA_METHOD *DSA_OpenSSL(void); |
165 | 164 | ||
166 | void DSA_set_default_openssl_method(DSA_METHOD *); | 165 | void DSA_set_default_method(const DSA_METHOD *); |
167 | DSA_METHOD *DSA_get_default_openssl_method(void); | 166 | const DSA_METHOD *DSA_get_default_method(void); |
168 | #if 0 | 167 | int DSA_set_method(DSA *dsa, const DSA_METHOD *); |
169 | DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *); | ||
170 | #else | ||
171 | int DSA_set_method(DSA *dsa, struct engine_st *engine); | ||
172 | #endif | ||
173 | 168 | ||
174 | DSA * DSA_new(void); | 169 | DSA * DSA_new(void); |
175 | #if 0 | 170 | DSA * DSA_new_method(ENGINE *engine); |
176 | DSA * DSA_new_method(DSA_METHOD *meth); | 171 | void DSA_free (DSA *r); |
177 | #else | 172 | /* "up" the DSA object's reference count */ |
178 | DSA * DSA_new_method(struct engine_st *engine); | 173 | int DSA_up_ref(DSA *r); |
179 | #endif | 174 | int DSA_size(const DSA *); |
180 | int DSA_size(DSA *); | ||
181 | /* next 4 return -1 on error */ | 175 | /* next 4 return -1 on error */ |
182 | int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); | 176 | int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); |
183 | int DSA_sign(int type,const unsigned char *dgst,int dlen, | 177 | int DSA_sign(int type,const unsigned char *dgst,int dlen, |
184 | unsigned char *sig, unsigned int *siglen, DSA *dsa); | 178 | unsigned char *sig, unsigned int *siglen, DSA *dsa); |
185 | int DSA_verify(int type,const unsigned char *dgst,int dgst_len, | 179 | int DSA_verify(int type,const unsigned char *dgst,int dgst_len, |
186 | unsigned char *sigbuf, int siglen, DSA *dsa); | 180 | const unsigned char *sigbuf, int siglen, DSA *dsa); |
187 | void DSA_free (DSA *r); | ||
188 | int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 181 | int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
189 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 182 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
190 | int DSA_set_ex_data(DSA *d, int idx, void *arg); | 183 | int DSA_set_ex_data(DSA *d, int idx, void *arg); |
191 | void *DSA_get_ex_data(DSA *d, int idx); | 184 | void *DSA_get_ex_data(DSA *d, int idx); |
192 | 185 | ||
193 | void ERR_load_DSA_strings(void ); | 186 | DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); |
194 | 187 | DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); | |
195 | DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length); | 188 | DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length); |
196 | DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length); | 189 | DSA * DSA_generate_parameters(int bits, |
197 | DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length); | 190 | unsigned char *seed,int seed_len, |
198 | DSA * DSA_generate_parameters(int bits, unsigned char *seed,int seed_len, | ||
199 | int *counter_ret, unsigned long *h_ret,void | 191 | int *counter_ret, unsigned long *h_ret,void |
200 | (*callback)(int, int, void *),void *cb_arg); | 192 | (*callback)(int, int, void *),void *cb_arg); |
201 | int DSA_generate_key(DSA *a); | 193 | int DSA_generate_key(DSA *a); |
202 | int i2d_DSAPublicKey(DSA *a, unsigned char **pp); | 194 | int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); |
203 | int i2d_DSAPrivateKey(DSA *a, unsigned char **pp); | 195 | int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); |
204 | int i2d_DSAparams(DSA *a,unsigned char **pp); | 196 | int i2d_DSAparams(const DSA *a,unsigned char **pp); |
205 | 197 | ||
206 | #ifndef NO_BIO | 198 | #ifndef OPENSSL_NO_BIO |
207 | int DSAparams_print(BIO *bp, DSA *x); | 199 | int DSAparams_print(BIO *bp, const DSA *x); |
208 | int DSA_print(BIO *bp, DSA *x, int off); | 200 | int DSA_print(BIO *bp, const DSA *x, int off); |
209 | #endif | 201 | #endif |
210 | #ifndef NO_FP_API | 202 | #ifndef OPENSSL_NO_FP_API |
211 | int DSAparams_print_fp(FILE *fp, DSA *x); | 203 | int DSAparams_print_fp(FILE *fp, const DSA *x); |
212 | int DSA_print_fp(FILE *bp, DSA *x, int off); | 204 | int DSA_print_fp(FILE *bp, const DSA *x, int off); |
213 | #endif | 205 | #endif |
214 | 206 | ||
215 | #define DSS_prime_checks 50 | 207 | #define DSS_prime_checks 50 |
@@ -218,16 +210,17 @@ int DSA_print_fp(FILE *bp, DSA *x, int off); | |||
218 | #define DSA_is_prime(n, callback, cb_arg) \ | 210 | #define DSA_is_prime(n, callback, cb_arg) \ |
219 | BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) | 211 | BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) |
220 | 212 | ||
221 | #ifndef NO_DH | 213 | #ifndef OPENSSL_NO_DH |
222 | /* Convert DSA structure (key or just parameters) into DH structure | 214 | /* Convert DSA structure (key or just parameters) into DH structure |
223 | * (be careful to avoid small subgroup attacks when using this!) */ | 215 | * (be careful to avoid small subgroup attacks when using this!) */ |
224 | DH *DSA_dup_DH(DSA *r); | 216 | DH *DSA_dup_DH(const DSA *r); |
225 | #endif | 217 | #endif |
226 | 218 | ||
227 | /* BEGIN ERROR CODES */ | 219 | /* BEGIN ERROR CODES */ |
228 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 220 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
229 | * made after this point may be overwritten when the script is next run. | 221 | * made after this point may be overwritten when the script is next run. |
230 | */ | 222 | */ |
223 | void ERR_load_DSA_strings(void); | ||
231 | 224 | ||
232 | /* Error codes for the DSA functions. */ | 225 | /* Error codes for the DSA functions. */ |
233 | 226 | ||
@@ -237,7 +230,7 @@ DH *DSA_dup_DH(DSA *r); | |||
237 | #define DSA_F_DSAPARAMS_PRINT_FP 101 | 230 | #define DSA_F_DSAPARAMS_PRINT_FP 101 |
238 | #define DSA_F_DSA_DO_SIGN 112 | 231 | #define DSA_F_DSA_DO_SIGN 112 |
239 | #define DSA_F_DSA_DO_VERIFY 113 | 232 | #define DSA_F_DSA_DO_VERIFY 113 |
240 | #define DSA_F_DSA_NEW 103 | 233 | #define DSA_F_DSA_NEW_METHOD 103 |
241 | #define DSA_F_DSA_PRINT 104 | 234 | #define DSA_F_DSA_PRINT 104 |
242 | #define DSA_F_DSA_PRINT_FP 105 | 235 | #define DSA_F_DSA_PRINT_FP 105 |
243 | #define DSA_F_DSA_SIGN 106 | 236 | #define DSA_F_DSA_SIGN 106 |
@@ -245,6 +238,7 @@ DH *DSA_dup_DH(DSA *r); | |||
245 | #define DSA_F_DSA_SIG_NEW 109 | 238 | #define DSA_F_DSA_SIG_NEW 109 |
246 | #define DSA_F_DSA_VERIFY 108 | 239 | #define DSA_F_DSA_VERIFY 108 |
247 | #define DSA_F_I2D_DSA_SIG 111 | 240 | #define DSA_F_I2D_DSA_SIG 111 |
241 | #define DSA_F_SIG_CB 114 | ||
248 | 242 | ||
249 | /* Reason codes. */ | 243 | /* Reason codes. */ |
250 | #define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 | 244 | #define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 |
@@ -254,4 +248,3 @@ DH *DSA_dup_DH(DSA *r); | |||
254 | } | 248 | } |
255 | #endif | 249 | #endif |
256 | #endif | 250 | #endif |
257 | |||