2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 # define HEADER_APPS_H
14 # if defined(__unix) || defined(__unix__)
15 # include <sys/time.h> /* struct timeval for DTLS */
19 # include <openssl/e_os2.h>
20 # include <openssl/ossl_typ.h>
21 # include <openssl/bio.h>
22 # include <openssl/x509.h>
23 # include <openssl/lhash.h>
24 # include <openssl/conf.h>
25 # include <openssl/txt_db.h>
26 # include <openssl/engine.h>
27 # include <openssl/ocsp.h>
28 # include <openssl/ossl_typ.h>
31 # if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
32 # define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
34 # define openssl_fdset(a,b) FD_SET(a, b)
38 * quick macro when you need to pass an unsigned char instead of a char.
39 * this is true for some implementations of the is*() functions, for
42 #define _UC(c) ((unsigned char)(c))
44 int app_RAND_load_file(const char *file, int dont_warn);
45 int app_RAND_write_file(const char *file);
47 * When `file' is NULL, use defaults. `bio_e' is for error messages.
49 void app_RAND_allow_write_file(void);
50 long app_RAND_load_files(char *file); /* `file' is a list of files to read,
51 * separated by LIST_SEPARATOR_CHAR
52 * (see e_os.h). The string is
55 extern char *default_config_file;
59 BIO *dup_bio_in(int format);
60 BIO *dup_bio_out(int format);
61 BIO *dup_bio_err(int format);
62 BIO *bio_open_owner(const char *filename, int format, int private);
63 BIO *bio_open_default(const char *filename, char mode, int format);
64 BIO *bio_open_default_quiet(const char *filename, char mode, int format);
65 CONF *app_load_config(const char *filename);
66 CONF *app_load_config_quiet(const char *filename);
67 int app_load_modules(const CONF *config);
68 void unbuffer(FILE *fp);
69 void wait_for_async(SSL *s);
72 * Common verification options.
76 OPT_V_POLICY, OPT_V_PURPOSE, OPT_V_VERIFY_NAME, OPT_V_VERIFY_DEPTH, \
77 OPT_V_ATTIME, OPT_V_VERIFY_HOSTNAME, OPT_V_VERIFY_EMAIL, \
78 OPT_V_VERIFY_IP, OPT_V_IGNORE_CRITICAL, OPT_V_ISSUER_CHECKS, \
79 OPT_V_CRL_CHECK, OPT_V_CRL_CHECK_ALL, OPT_V_POLICY_CHECK, \
80 OPT_V_EXPLICIT_POLICY, OPT_V_INHIBIT_ANY, OPT_V_INHIBIT_MAP, \
81 OPT_V_X509_STRICT, OPT_V_EXTENDED_CRL, OPT_V_USE_DELTAS, \
82 OPT_V_POLICY_PRINT, OPT_V_CHECK_SS_SIG, OPT_V_TRUSTED_FIRST, \
83 OPT_V_SUITEB_128_ONLY, OPT_V_SUITEB_128, OPT_V_SUITEB_192, \
84 OPT_V_PARTIAL_CHAIN, OPT_V_NO_ALT_CHAINS, OPT_V_NO_CHECK_TIME, \
85 OPT_V_VERIFY_AUTH_LEVEL, \
88 # define OPT_V_OPTIONS \
89 { "policy", OPT_V_POLICY, 's', "adds policy to the acceptable policy set"}, \
90 { "purpose", OPT_V_PURPOSE, 's', \
91 "certificate chain purpose"}, \
92 { "verify_name", OPT_V_VERIFY_NAME, 's', "verification policy name"}, \
93 { "verify_depth", OPT_V_VERIFY_DEPTH, 'n', \
94 "chain depth limit" }, \
95 { "auth_level", OPT_V_VERIFY_AUTH_LEVEL, 'n', \
96 "chain authentication security level" }, \
97 { "attime", OPT_V_ATTIME, 'M', "verification epoch time" }, \
98 { "verify_hostname", OPT_V_VERIFY_HOSTNAME, 's', \
99 "expected peer hostname" }, \
100 { "verify_email", OPT_V_VERIFY_EMAIL, 's', \
101 "expected peer email" }, \
102 { "verify_ip", OPT_V_VERIFY_IP, 's', \
103 "expected peer IP address" }, \
104 { "ignore_critical", OPT_V_IGNORE_CRITICAL, '-', \
105 "permit unhandled critical extensions"}, \
106 { "issuer_checks", OPT_V_ISSUER_CHECKS, '-', "(deprecated)"}, \
107 { "crl_check", OPT_V_CRL_CHECK, '-', "check leaf certificate revocation" }, \
108 { "crl_check_all", OPT_V_CRL_CHECK_ALL, '-', "check full chain revocation" }, \
109 { "policy_check", OPT_V_POLICY_CHECK, '-', "perform rfc5280 policy checks"}, \
110 { "explicit_policy", OPT_V_EXPLICIT_POLICY, '-', \
111 "set policy variable require-explicit-policy"}, \
112 { "inhibit_any", OPT_V_INHIBIT_ANY, '-', \
113 "set policy variable inihibit-any-policy"}, \
114 { "inhibit_map", OPT_V_INHIBIT_MAP, '-', \
115 "set policy variable inihibit-policy-mapping"}, \
116 { "x509_strict", OPT_V_X509_STRICT, '-', \
117 "disable certificate compatibility work-arounds"}, \
118 { "extended_crl", OPT_V_EXTENDED_CRL, '-', \
119 "enable extended CRL features"}, \
120 { "use_deltas", OPT_V_USE_DELTAS, '-', \
122 { "policy_print", OPT_V_POLICY_PRINT, '-', \
123 "print policy processing diagnostics"}, \
124 { "check_ss_sig", OPT_V_CHECK_SS_SIG, '-', \
125 "check root CA self-signatures"}, \
126 { "trusted_first", OPT_V_TRUSTED_FIRST, '-', \
127 "search trust store first (default)" }, \
128 { "suiteB_128_only", OPT_V_SUITEB_128_ONLY, '-', "Suite B 128-bit-only mode"}, \
129 { "suiteB_128", OPT_V_SUITEB_128, '-', \
130 "Suite B 128-bit mode allowing 192-bit algorithms"}, \
131 { "suiteB_192", OPT_V_SUITEB_192, '-', "Suite B 192-bit-only mode" }, \
132 { "partial_chain", OPT_V_PARTIAL_CHAIN, '-', \
133 "accept chains anchored by intermediate trust-store CAs"}, \
134 { "no_alt_chains", OPT_V_NO_ALT_CHAINS, '-', "(deprecated)" }, \
135 { "no_check_time", OPT_V_NO_CHECK_TIME, '-', "ignore certificate validity time" }
137 # define OPT_V_CASES \
138 OPT_V__FIRST: case OPT_V__LAST: break; \
140 case OPT_V_PURPOSE: \
141 case OPT_V_VERIFY_NAME: \
142 case OPT_V_VERIFY_DEPTH: \
143 case OPT_V_VERIFY_AUTH_LEVEL: \
145 case OPT_V_VERIFY_HOSTNAME: \
146 case OPT_V_VERIFY_EMAIL: \
147 case OPT_V_VERIFY_IP: \
148 case OPT_V_IGNORE_CRITICAL: \
149 case OPT_V_ISSUER_CHECKS: \
150 case OPT_V_CRL_CHECK: \
151 case OPT_V_CRL_CHECK_ALL: \
152 case OPT_V_POLICY_CHECK: \
153 case OPT_V_EXPLICIT_POLICY: \
154 case OPT_V_INHIBIT_ANY: \
155 case OPT_V_INHIBIT_MAP: \
156 case OPT_V_X509_STRICT: \
157 case OPT_V_EXTENDED_CRL: \
158 case OPT_V_USE_DELTAS: \
159 case OPT_V_POLICY_PRINT: \
160 case OPT_V_CHECK_SS_SIG: \
161 case OPT_V_TRUSTED_FIRST: \
162 case OPT_V_SUITEB_128_ONLY: \
163 case OPT_V_SUITEB_128: \
164 case OPT_V_SUITEB_192: \
165 case OPT_V_PARTIAL_CHAIN: \
166 case OPT_V_NO_ALT_CHAINS: \
167 case OPT_V_NO_CHECK_TIME
170 * Common "extended"? options.
172 # define OPT_X_ENUM \
174 OPT_X_KEY, OPT_X_CERT, OPT_X_CHAIN, OPT_X_CHAIN_BUILD, \
175 OPT_X_CERTFORM, OPT_X_KEYFORM, \
178 # define OPT_X_OPTIONS \
179 { "xkey", OPT_X_KEY, '<', "key for Extended certificates"}, \
180 { "xcert", OPT_X_CERT, '<', "cert for Extended certificates"}, \
181 { "xchain", OPT_X_CHAIN, '<', "chain for Extended certificates"}, \
182 { "xchain_build", OPT_X_CHAIN_BUILD, '-', \
183 "build certificate chain for the extended certificates"}, \
184 { "xcertform", OPT_X_CERTFORM, 'F', \
185 "format of Extended certificate (PEM or DER) PEM default " }, \
186 { "xkeyform", OPT_X_KEYFORM, 'F', \
187 "format of Exnteded certificate's key (PEM or DER) PEM default"}
189 # define OPT_X_CASES \
190 OPT_X__FIRST: case OPT_X__LAST: break; \
194 case OPT_X_CHAIN_BUILD: \
195 case OPT_X_CERTFORM: \
199 * Common SSL options.
200 * Any changes here must be coordinated with ../ssl/ssl_conf.c
202 # define OPT_S_ENUM \
204 OPT_S_NOSSL3, OPT_S_NOTLS1, OPT_S_NOTLS1_1, OPT_S_NOTLS1_2, \
205 OPT_S_BUGS, OPT_S_NO_COMP, OPT_S_NOTICKET, \
206 OPT_S_SERVERPREF, OPT_S_LEGACYRENEG, OPT_S_LEGACYCONN, \
207 OPT_S_ONRESUMP, OPT_S_NOLEGACYCONN, OPT_S_STRICT, OPT_S_SIGALGS, \
208 OPT_S_CLIENTSIGALGS, OPT_S_CURVES, OPT_S_NAMEDCURVE, OPT_S_CIPHER, \
209 OPT_S_DHPARAM, OPT_S_DEBUGBROKE, OPT_S_COMP, \
212 # define OPT_S_OPTIONS \
213 {"no_ssl3", OPT_S_NOSSL3, '-',"Just disable SSLv3" }, \
214 {"no_tls1", OPT_S_NOTLS1, '-', "Just disable TLSv1"}, \
215 {"no_tls1_1", OPT_S_NOTLS1_1, '-', "Just disable TLSv1.1" }, \
216 {"no_tls1_2", OPT_S_NOTLS1_2, '-', "Just disable TLSv1.2"}, \
217 {"bugs", OPT_S_BUGS, '-', "Turn on SSL bug compatibility"}, \
218 {"no_comp", OPT_S_NO_COMP, '-', "Disable SSL/TLS compression (default)" }, \
219 {"comp", OPT_S_COMP, '-', "Use SSL/TLS-level compression" }, \
220 {"no_ticket", OPT_S_NOTICKET, '-', \
221 "Disable use of TLS session tickets"}, \
222 {"serverpref", OPT_S_SERVERPREF, '-', "Use server's cipher preferences"}, \
223 {"legacy_renegotiation", OPT_S_LEGACYRENEG, '-', \
224 "Enable use of legacy renegotiation (dangerous)"}, \
225 {"legacy_server_connect", OPT_S_LEGACYCONN, '-', \
226 "Allow initial connection to servers that don't support RI"}, \
227 {"no_resumption_on_reneg", OPT_S_ONRESUMP, '-', \
228 "Disallow session resumption on renegotiation"}, \
229 {"no_legacy_server_connect", OPT_S_NOLEGACYCONN, '-', \
230 "Disallow initial connection to servers that don't support RI"}, \
231 {"strict", OPT_S_STRICT, '-', \
232 "Enforce strict certificate checks as per TLS standard"}, \
233 {"sigalgs", OPT_S_SIGALGS, 's', \
234 "Signature algorithms to support (colon-separated list)" }, \
235 {"client_sigalgs", OPT_S_CLIENTSIGALGS, 's', \
236 "Signature algorithms to support for client certificate" \
237 " authentication (colon-separated list)" }, \
238 {"curves", OPT_S_CURVES, 's', \
239 "Elliptic curves to advertise (colon-separated list)" }, \
240 {"named_curve", OPT_S_NAMEDCURVE, 's', \
241 "Elliptic curve used for ECDHE (server-side only)" }, \
242 {"cipher", OPT_S_CIPHER, 's', "Specify cipher list to be used"}, \
243 {"dhparam", OPT_S_DHPARAM, '<', \
244 "DH parameter file to use, in cert file if not specified"}, \
245 {"debug_broken_protocol", OPT_S_DEBUGBROKE, '-', \
246 "Perform all sorts of protocol violations for testing purposes"}
248 # define OPT_S_CASES \
249 OPT_S__FIRST: case OPT_S__LAST: break; \
252 case OPT_S_NOTLS1_1: \
253 case OPT_S_NOTLS1_2: \
255 case OPT_S_NO_COMP: \
257 case OPT_S_NOTICKET: \
258 case OPT_S_SERVERPREF: \
259 case OPT_S_LEGACYRENEG: \
260 case OPT_S_LEGACYCONN: \
261 case OPT_S_ONRESUMP: \
262 case OPT_S_NOLEGACYCONN: \
264 case OPT_S_SIGALGS: \
265 case OPT_S_CLIENTSIGALGS: \
267 case OPT_S_NAMEDCURVE: \
269 case OPT_S_DHPARAM: \
270 case OPT_S_DEBUGBROKE
275 extern const char OPT_HELP_STR[];
276 extern const char OPT_MORE_STR[];
277 typedef struct options_st {
281 * value type: - no value (also the value zero), n number, p positive
282 * number, u unsigned, l long, s string, < input file, > output file,
283 * f any format, F der/pem format , E der/pem/engine format identifier.
284 * l, n and u include zero; p does not.
291 * A string/int pairing; widely use for option value lookup, hence the
292 * name OPT_PAIR. But that name is misleading in s_cb.c, so we also use
293 * the "generic" name STRINT_PAIR.
295 typedef struct string_int_pair_st {
298 } OPT_PAIR, STRINT_PAIR;
300 /* Flags to pass into opt_format; see FORMAT_xxx, below. */
301 # define OPT_FMT_PEMDER (1L << 1)
302 # define OPT_FMT_PKCS12 (1L << 2)
303 # define OPT_FMT_SMIME (1L << 3)
304 # define OPT_FMT_ENGINE (1L << 4)
305 # define OPT_FMT_MSBLOB (1L << 5)
306 # define OPT_FMT_NETSCAPE (1L << 6)
307 # define OPT_FMT_NSS (1L << 7)
308 # define OPT_FMT_TEXT (1L << 8)
309 # define OPT_FMT_HTTP (1L << 9)
310 # define OPT_FMT_PVK (1L << 10)
311 # define OPT_FMT_PDE (OPT_FMT_PEMDER | OPT_FMT_ENGINE)
312 # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME)
313 # define OPT_FMT_ANY ( \
314 OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \
315 OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \
316 OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
318 char *opt_progname(const char *argv0);
319 char *opt_getprog(void);
320 char *opt_init(int ac, char **av, const OPTIONS * o);
322 int opt_format(const char *s, unsigned long flags, int *result);
323 int opt_int(const char *arg, int *result);
324 int opt_ulong(const char *arg, unsigned long *result);
325 int opt_long(const char *arg, long *result);
326 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
327 defined(INTMAX_MAX) && defined(UINTMAX_MAX)
328 int opt_imax(const char *arg, intmax_t *result);
329 int opt_umax(const char *arg, uintmax_t *result);
331 # define opt_imax opt_long
332 # define opt_umax opt_ulong
333 # define intmax_t long
334 # define uintmax_t unsigned long
336 int opt_pair(const char *arg, const OPT_PAIR * pairs, int *result);
337 int opt_cipher(const char *name, const EVP_CIPHER **cipherp);
338 int opt_md(const char *name, const EVP_MD **mdp);
340 char *opt_flag(void);
341 char *opt_unknown(void);
342 char *opt_reset(void);
343 char **opt_rest(void);
344 int opt_num_rest(void);
345 int opt_verify(int i, X509_VERIFY_PARAM *vpm);
346 void opt_help(const OPTIONS * list);
347 int opt_format_error(const char *s, unsigned long flags);
349 typedef struct args_st {
356 * VMS C only for now, implemented in vms_decc_init.c
357 * If other C compilers forget to terminate argv with NULL, this function
360 char **copy_argv(int *argc, char *argv[]);
363 # define PW_MIN_LENGTH 4
364 typedef struct pw_cb_data {
365 const void *password;
366 const char *prompt_info;
369 int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data);
371 int setup_ui_method(void);
372 void destroy_ui_method(void);
374 int chopup_args(ARGS *arg, char *buf);
375 # ifdef HEADER_X509_H
376 int dump_cert_text(BIO *out, X509 *x);
377 void print_name(BIO *out, const char *title, X509_NAME *nm,
378 unsigned long lflags);
380 void print_bignum_var(BIO *, BIGNUM *, const char*, int, unsigned char *);
381 void print_array(BIO *, const char *, int, const unsigned char *);
382 int set_cert_ex(unsigned long *flags, const char *arg);
383 int set_name_ex(unsigned long *flags, const char *arg);
384 int set_ext_copy(int *copy_type, const char *arg);
385 int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
386 int app_passwd(char *arg1, char *arg2, char **pass1, char **pass2);
387 int add_oid_section(CONF *conf);
388 X509 *load_cert(const char *file, int format, const char *cert_descrip);
389 X509_CRL *load_crl(const char *infile, int format);
390 EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
391 const char *pass, ENGINE *e, const char *key_descrip);
392 EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
393 const char *pass, ENGINE *e, const char *key_descrip);
394 int load_certs(const char *file, STACK_OF(X509) **certs, int format,
395 const char *pass, const char *cert_descrip);
396 int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format,
397 const char *pass, const char *cert_descrip);
398 X509_STORE *setup_verify(char *CAfile, char *CApath,
399 int noCAfile, int noCApath);
400 __owur int ctx_set_verify_locations(SSL_CTX *ctx, const char *CAfile,
401 const char *CApath, int noCAfile,
404 #ifndef OPENSSL_NO_CT
407 * Sets the file to load the Certificate Transparency log list from.
408 * If path is NULL, loads from the default file path.
409 * Returns 1 on success, 0 otherwise.
411 __owur int ctx_set_ctlog_list_file(SSL_CTX *ctx, const char *path);
415 # ifdef OPENSSL_NO_ENGINE
416 # define setup_engine(engine, debug) NULL
418 ENGINE *setup_engine(const char *engine, int debug);
420 # ifndef OPENSSL_NO_OCSP
421 OCSP_RESPONSE *process_responder(OCSP_REQUEST *req,
422 const char *host, const char *path,
423 const char *port, int use_ssl,
424 STACK_OF(CONF_VALUE) *headers,
428 /* Functions defined in ca.c and also used in ocsp.c */
429 int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
430 ASN1_GENERALIZEDTIME **pinvtm, const char *str);
433 # define DB_exp_date 1
434 # define DB_rev_date 2
435 # define DB_serial 3 /* index - unique */
437 # define DB_name 5 /* index - unique when active and not
441 # define DB_TYPE_REV 'R'
442 # define DB_TYPE_EXP 'E'
443 # define DB_TYPE_VAL 'V'
445 typedef struct db_attr_st {
448 typedef struct ca_db_st {
453 void* app_malloc(int sz, const char *what);
454 BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
455 int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
456 ASN1_INTEGER **retai);
457 int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
458 int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
459 CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
460 int index_index(CA_DB *db);
461 int save_index(const char *dbfile, const char *suffix, CA_DB *db);
462 int rotate_index(const char *dbfile, const char *new_suffix,
463 const char *old_suffix);
464 void free_index(CA_DB *db);
465 # define index_name_cmp_noconst(a, b) \
466 index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
467 (const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
468 int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
469 int parse_yesno(const char *str, int def);
471 X509_NAME *parse_name(const char *str, long chtype, int multirdn);
472 int args_verify(char ***pargs, int *pargc,
473 int *badarg, X509_VERIFY_PARAM **pm);
474 void policies_print(X509_STORE_CTX *ctx);
475 int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
476 int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value);
477 int init_gen_str(EVP_PKEY_CTX **pctx,
478 const char *algname, ENGINE *e, int do_param);
479 int do_X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
480 STACK_OF(OPENSSL_STRING) *sigopts);
481 int do_X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md,
482 STACK_OF(OPENSSL_STRING) *sigopts);
483 int do_X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md,
484 STACK_OF(OPENSSL_STRING) *sigopts);
485 # ifndef OPENSSL_NO_PSK
486 extern char *psk_key;
489 unsigned char *next_protos_parse(size_t *outlen, const char *in);
491 void print_cert_checks(BIO *bio, X509 *x,
492 const char *checkhost,
493 const char *checkemail, const char *checkip);
495 void store_setup_crl_download(X509_STORE *st);
497 /* See OPT_FMT_xxx, above. */
498 /* On some platforms, it's important to distinguish between text and binary
499 * files. On some, there might even be specific file formats for different
500 * contents. The FORMAT_xxx macros are meant to express an intent with the
501 * file being read or created.
503 # define B_FORMAT_TEXT 0x8000
504 # define FORMAT_UNDEF 0
505 # define FORMAT_TEXT (1 | B_FORMAT_TEXT) /* Generic text */
506 # define FORMAT_BINARY 2 /* Generic binary */
507 # define FORMAT_BASE64 (3 | B_FORMAT_TEXT) /* Base64 */
508 # define FORMAT_ASN1 4 /* ASN.1/DER */
509 # define FORMAT_PEM (5 | B_FORMAT_TEXT)
510 # define FORMAT_PKCS12 6
511 # define FORMAT_SMIME (7 | B_FORMAT_TEXT)
512 # define FORMAT_ENGINE 8 /* Not really a file format */
513 # define FORMAT_PEMRSA (9 | B_FORMAT_TEXT) /* PEM RSAPubicKey format */
514 # define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
515 # define FORMAT_MSBLOB 11 /* MS Key blob format */
516 # define FORMAT_PVK 12 /* MS PVK file format */
517 # define FORMAT_HTTP 13 /* Download using HTTP */
518 # define FORMAT_NSS 14 /* NSS keylog format */
520 # define EXT_COPY_NONE 0
521 # define EXT_COPY_ADD 1
522 # define EXT_COPY_ALL 2
524 # define NETSCAPE_CERT_HDR "certificate"
526 # define APP_PASS_LEN 1024
528 # define SERIAL_RAND_BITS 64
530 int app_isdir(const char *);
531 int app_access(const char *, int flag);
532 int raw_read_stdin(void *, int);
533 int raw_write_stdout(const void *, int);
537 double app_tminterval(int stop, int usertime);
539 /* this is an accident waiting to happen (-Wshadow is your friend) */
540 extern int verify_depth;
541 extern int verify_quiet;
542 extern int verify_error;
543 extern int verify_return_error;