diff options
Diffstat (limited to 'src/lib/libssl/src/apps/apps.h')
-rw-r--r-- | src/lib/libssl/src/apps/apps.h | 88 |
1 files changed, 42 insertions, 46 deletions
diff --git a/src/lib/libssl/src/apps/apps.h b/src/lib/libssl/src/apps/apps.h index 3aeb46c4e2..02af317651 100644 --- a/src/lib/libssl/src/apps/apps.h +++ b/src/lib/libssl/src/apps/apps.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -63,7 +63,7 @@ | |||
63 | * are met: | 63 | * are met: |
64 | * | 64 | * |
65 | * 1. Redistributions of source code must retain the above copyright | 65 | * 1. Redistributions of source code must retain the above copyright |
66 | * notice, this list of conditions and the following disclaimer. | 66 | * notice, this list of conditions and the following disclaimer. |
67 | * | 67 | * |
68 | * 2. Redistributions in binary form must reproduce the above copyright | 68 | * 2. Redistributions in binary form must reproduce the above copyright |
69 | * notice, this list of conditions and the following disclaimer in | 69 | * notice, this list of conditions and the following disclaimer in |
@@ -142,8 +142,8 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read, | |||
142 | #define MAIN(a,v) main(a,v) | 142 | #define MAIN(a,v) main(a,v) |
143 | 143 | ||
144 | #ifndef NON_MAIN | 144 | #ifndef NON_MAIN |
145 | CONF *config=NULL; | 145 | CONF *config = NULL; |
146 | BIO *bio_err=NULL; | 146 | BIO *bio_err = NULL; |
147 | #else | 147 | #else |
148 | extern CONF *config; | 148 | extern CONF *config; |
149 | extern BIO *bio_err; | 149 | extern BIO *bio_err; |
@@ -169,7 +169,7 @@ extern BIO *bio_err; | |||
169 | #endif | 169 | #endif |
170 | 170 | ||
171 | #ifdef OPENSSL_NO_COMP | 171 | #ifdef OPENSSL_NO_COMP |
172 | #define zlib_cleanup() | 172 | #define zlib_cleanup() |
173 | #else | 173 | #else |
174 | #define zlib_cleanup() COMP_zlib_cleanup() | 174 | #define zlib_cleanup() COMP_zlib_cleanup() |
175 | #endif | 175 | #endif |
@@ -211,21 +211,20 @@ extern BIO *bio_err; | |||
211 | #endif | 211 | #endif |
212 | 212 | ||
213 | 213 | ||
214 | typedef struct args_st | 214 | typedef struct args_st { |
215 | { | ||
216 | char **data; | 215 | char **data; |
217 | int count; | 216 | int count; |
218 | } ARGS; | 217 | } ARGS; |
219 | 218 | ||
220 | #define PW_MIN_LENGTH 4 | 219 | #define PW_MIN_LENGTH 4 |
221 | typedef struct pw_cb_data | 220 | typedef struct pw_cb_data { |
222 | { | ||
223 | const void *password; | 221 | const void *password; |
224 | const char *prompt_info; | 222 | const char *prompt_info; |
225 | } PW_CB_DATA; | 223 | } PW_CB_DATA; |
226 | 224 | ||
227 | int password_callback(char *buf, int bufsiz, int verify, | 225 | int |
228 | PW_CB_DATA *cb_data); | 226 | password_callback(char *buf, int bufsiz, int verify, |
227 | PW_CB_DATA *cb_data); | ||
229 | 228 | ||
230 | int setup_ui_method(void); | 229 | int setup_ui_method(void); |
231 | void destroy_ui_method(void); | 230 | void destroy_ui_method(void); |
@@ -233,8 +232,8 @@ void destroy_ui_method(void); | |||
233 | int should_retry(int i); | 232 | int should_retry(int i); |
234 | int args_from_file(char *file, int *argc, char **argv[]); | 233 | int args_from_file(char *file, int *argc, char **argv[]); |
235 | int str2fmt(char *s); | 234 | int str2fmt(char *s); |
236 | void program_name(char *in,char *out,int size); | 235 | void program_name(char *in, char *out, int size); |
237 | int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]); | 236 | int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]); |
238 | #ifdef HEADER_X509_H | 237 | #ifdef HEADER_X509_H |
239 | int dump_cert_text(BIO *out, X509 *x); | 238 | int dump_cert_text(BIO *out, X509 *x); |
240 | void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags); | 239 | void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags); |
@@ -246,15 +245,15 @@ int copy_extensions(X509 *x, X509_REQ *req, int copy_type); | |||
246 | int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2); | 245 | int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2); |
247 | int add_oid_section(BIO *err, CONF *conf); | 246 | int add_oid_section(BIO *err, CONF *conf); |
248 | X509 *load_cert(BIO *err, const char *file, int format, | 247 | X509 *load_cert(BIO *err, const char *file, int format, |
249 | const char *pass, ENGINE *e, const char *cert_descrip); | 248 | const char *pass, ENGINE *e, const char *cert_descrip); |
250 | EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin, | 249 | EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin, |
251 | const char *pass, ENGINE *e, const char *key_descrip); | 250 | const char *pass, ENGINE *e, const char *key_descrip); |
252 | EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin, | 251 | EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin, |
253 | const char *pass, ENGINE *e, const char *key_descrip); | 252 | const char *pass, ENGINE *e, const char *key_descrip); |
254 | STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, | 253 | STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, |
255 | const char *pass, ENGINE *e, const char *cert_descrip); | 254 | const char *pass, ENGINE *e, const char *cert_descrip); |
256 | STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format, | 255 | STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format, |
257 | const char *pass, ENGINE *e, const char *cert_descrip); | 256 | const char *pass, ENGINE *e, const char *cert_descrip); |
258 | X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); | 257 | X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); |
259 | #ifndef OPENSSL_NO_ENGINE | 258 | #ifndef OPENSSL_NO_ENGINE |
260 | ENGINE *setup_engine(BIO *err, const char *engine, int debug); | 259 | ENGINE *setup_engine(BIO *err, const char *engine, int debug); |
@@ -262,9 +261,8 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug); | |||
262 | 261 | ||
263 | #ifndef OPENSSL_NO_OCSP | 262 | #ifndef OPENSSL_NO_OCSP |
264 | OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, | 263 | OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, |
265 | char *host, char *path, char *port, int use_ssl, | 264 | char *host, char *path, char *port, int use_ssl, |
266 | STACK_OF(CONF_VALUE) *headers, | 265 | STACK_OF(CONF_VALUE) *headers, int req_timeout); |
267 | int req_timeout); | ||
268 | #endif | 266 | #endif |
269 | 267 | ||
270 | int load_config(BIO *err, CONF *cnf); | 268 | int load_config(BIO *err, CONF *cnf); |
@@ -272,13 +270,13 @@ char *make_config_name(void); | |||
272 | 270 | ||
273 | /* Functions defined in ca.c and also used in ocsp.c */ | 271 | /* Functions defined in ca.c and also used in ocsp.c */ |
274 | int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, | 272 | int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, |
275 | ASN1_GENERALIZEDTIME **pinvtm, const char *str); | 273 | ASN1_GENERALIZEDTIME **pinvtm, const char *str); |
276 | 274 | ||
277 | #define DB_type 0 | 275 | #define DB_type 0 |
278 | #define DB_exp_date 1 | 276 | #define DB_exp_date 1 |
279 | #define DB_rev_date 2 | 277 | #define DB_rev_date 2 |
280 | #define DB_serial 3 /* index - unique */ | 278 | #define DB_serial 3 /* index - unique */ |
281 | #define DB_file 4 | 279 | #define DB_file 4 |
282 | #define DB_name 5 /* index - unique when active and not disabled */ | 280 | #define DB_name 5 /* index - unique when active and not disabled */ |
283 | #define DB_NUMBER 6 | 281 | #define DB_NUMBER 6 |
284 | 282 | ||
@@ -286,15 +284,13 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, | |||
286 | #define DB_TYPE_EXP 'E' | 284 | #define DB_TYPE_EXP 'E' |
287 | #define DB_TYPE_VAL 'V' | 285 | #define DB_TYPE_VAL 'V' |
288 | 286 | ||
289 | typedef struct db_attr_st | 287 | typedef struct db_attr_st { |
290 | { | ||
291 | int unique_subject; | 288 | int unique_subject; |
292 | } DB_ATTR; | 289 | } DB_ATTR; |
293 | typedef struct ca_db_st | 290 | typedef struct ca_db_st { |
294 | { | ||
295 | DB_ATTR attributes; | 291 | DB_ATTR attributes; |
296 | TXT_DB *db; | 292 | TXT_DB *db; |
297 | } CA_DB; | 293 | } CA_DB; |
298 | 294 | ||
299 | BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai); | 295 | BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai); |
300 | int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai); | 296 | int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai); |
@@ -312,19 +308,19 @@ int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b); | |||
312 | int parse_yesno(const char *str, int def); | 308 | int parse_yesno(const char *str, int def); |
313 | 309 | ||
314 | X509_NAME *parse_name(char *str, long chtype, int multirdn); | 310 | X509_NAME *parse_name(char *str, long chtype, int multirdn); |
315 | int args_verify(char ***pargs, int *pargc, | 311 | int args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, |
316 | int *badarg, BIO *err, X509_VERIFY_PARAM **pm); | 312 | X509_VERIFY_PARAM **pm); |
317 | void policies_print(BIO *out, X509_STORE_CTX *ctx); | 313 | void policies_print(BIO *out, X509_STORE_CTX *ctx); |
318 | int bio_to_mem(unsigned char **out, int maxlen, BIO *in); | 314 | int bio_to_mem(unsigned char **out, int maxlen, BIO *in); |
319 | int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); | 315 | int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); |
320 | int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, | 316 | int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, const char *algname, ENGINE *e, |
321 | const char *algname, ENGINE *e, int do_param); | 317 | int do_param); |
322 | int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md, | 318 | int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md, |
323 | STACK_OF(OPENSSL_STRING) *sigopts); | 319 | STACK_OF(OPENSSL_STRING) *sigopts); |
324 | int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md, | 320 | int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md, |
325 | STACK_OF(OPENSSL_STRING) *sigopts); | 321 | STACK_OF(OPENSSL_STRING) *sigopts); |
326 | int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md, | 322 | int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md, |
327 | STACK_OF(OPENSSL_STRING) *sigopts); | 323 | STACK_OF(OPENSSL_STRING) *sigopts); |
328 | #ifndef OPENSSL_NO_PSK | 324 | #ifndef OPENSSL_NO_PSK |
329 | extern char *psk_key; | 325 | extern char *psk_key; |
330 | #endif | 326 | #endif |
@@ -363,12 +359,12 @@ unsigned char *next_protos_parse(unsigned short *outlen, const char *in); | |||
363 | #define SERIAL_RAND_BITS 64 | 359 | #define SERIAL_RAND_BITS 64 |
364 | 360 | ||
365 | int app_isdir(const char *); | 361 | int app_isdir(const char *); |
366 | int raw_read_stdin(void *,int); | 362 | int raw_read_stdin(void *, int); |
367 | int raw_write_stdout(const void *,int); | 363 | int raw_write_stdout(const void *, int); |
368 | 364 | ||
369 | #define TM_START 0 | 365 | #define TM_START 0 |
370 | #define TM_STOP 1 | 366 | #define TM_STOP 1 |
371 | double app_tminterval (int stop,int usertime); | 367 | double app_tminterval (int stop, int usertime); |
372 | 368 | ||
373 | #define OPENSSL_NO_SSL_INTERN | 369 | #define OPENSSL_NO_SSL_INTERN |
374 | 370 | ||