xref: /minix3/crypto/external/bsd/openssl/dist/apps/apps.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc /* apps/apps.h */
2ebfedea0SLionel Sambuc /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3ebfedea0SLionel Sambuc  * All rights reserved.
4ebfedea0SLionel Sambuc  *
5ebfedea0SLionel Sambuc  * This package is an SSL implementation written
6ebfedea0SLionel Sambuc  * by Eric Young (eay@cryptsoft.com).
7ebfedea0SLionel Sambuc  * The implementation was written so as to conform with Netscapes SSL.
8ebfedea0SLionel Sambuc  *
9ebfedea0SLionel Sambuc  * This library is free for commercial and non-commercial use as long as
10ebfedea0SLionel Sambuc  * the following conditions are aheared to.  The following conditions
11ebfedea0SLionel Sambuc  * apply to all code found in this distribution, be it the RC4, RSA,
12ebfedea0SLionel Sambuc  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13ebfedea0SLionel Sambuc  * included with this distribution is covered by the same copyright terms
14ebfedea0SLionel Sambuc  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15ebfedea0SLionel Sambuc  *
16ebfedea0SLionel Sambuc  * Copyright remains Eric Young's, and as such any Copyright notices in
17ebfedea0SLionel Sambuc  * the code are not to be removed.
18ebfedea0SLionel Sambuc  * If this package is used in a product, Eric Young should be given attribution
19ebfedea0SLionel Sambuc  * as the author of the parts of the library used.
20ebfedea0SLionel Sambuc  * This can be in the form of a textual message at program startup or
21ebfedea0SLionel Sambuc  * in documentation (online or textual) provided with the package.
22ebfedea0SLionel Sambuc  *
23ebfedea0SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
24ebfedea0SLionel Sambuc  * modification, are permitted provided that the following conditions
25ebfedea0SLionel Sambuc  * are met:
26ebfedea0SLionel Sambuc  * 1. Redistributions of source code must retain the copyright
27ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
28ebfedea0SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
29ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
30ebfedea0SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
31ebfedea0SLionel Sambuc  * 3. All advertising materials mentioning features or use of this software
32ebfedea0SLionel Sambuc  *    must display the following acknowledgement:
33ebfedea0SLionel Sambuc  *    "This product includes cryptographic software written by
34ebfedea0SLionel Sambuc  *     Eric Young (eay@cryptsoft.com)"
35ebfedea0SLionel Sambuc  *    The word 'cryptographic' can be left out if the rouines from the library
36ebfedea0SLionel Sambuc  *    being used are not cryptographic related :-).
37ebfedea0SLionel Sambuc  * 4. If you include any Windows specific code (or a derivative thereof) from
38ebfedea0SLionel Sambuc  *    the apps directory (application code) you must include an acknowledgement:
39ebfedea0SLionel Sambuc  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40ebfedea0SLionel Sambuc  *
41ebfedea0SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42ebfedea0SLionel Sambuc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43ebfedea0SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44ebfedea0SLionel Sambuc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45ebfedea0SLionel Sambuc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46ebfedea0SLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47ebfedea0SLionel Sambuc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48ebfedea0SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49ebfedea0SLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50ebfedea0SLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51ebfedea0SLionel Sambuc  * SUCH DAMAGE.
52ebfedea0SLionel Sambuc  *
53ebfedea0SLionel Sambuc  * The licence and distribution terms for any publically available version or
54ebfedea0SLionel Sambuc  * derivative of this code cannot be changed.  i.e. this code cannot simply be
55ebfedea0SLionel Sambuc  * copied and put under another distribution licence
56ebfedea0SLionel Sambuc  * [including the GNU Public Licence.]
57ebfedea0SLionel Sambuc  */
58ebfedea0SLionel Sambuc /* ====================================================================
59ebfedea0SLionel Sambuc  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
60ebfedea0SLionel Sambuc  *
61ebfedea0SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
62ebfedea0SLionel Sambuc  * modification, are permitted provided that the following conditions
63ebfedea0SLionel Sambuc  * are met:
64ebfedea0SLionel Sambuc  *
65ebfedea0SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
66ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
67ebfedea0SLionel Sambuc  *
68ebfedea0SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
69ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in
70ebfedea0SLionel Sambuc  *    the documentation and/or other materials provided with the
71ebfedea0SLionel Sambuc  *    distribution.
72ebfedea0SLionel Sambuc  *
73ebfedea0SLionel Sambuc  * 3. All advertising materials mentioning features or use of this
74ebfedea0SLionel Sambuc  *    software must display the following acknowledgment:
75ebfedea0SLionel Sambuc  *    "This product includes software developed by the OpenSSL Project
76ebfedea0SLionel Sambuc  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77ebfedea0SLionel Sambuc  *
78ebfedea0SLionel Sambuc  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79ebfedea0SLionel Sambuc  *    endorse or promote products derived from this software without
80ebfedea0SLionel Sambuc  *    prior written permission. For written permission, please contact
81ebfedea0SLionel Sambuc  *    openssl-core@openssl.org.
82ebfedea0SLionel Sambuc  *
83ebfedea0SLionel Sambuc  * 5. Products derived from this software may not be called "OpenSSL"
84ebfedea0SLionel Sambuc  *    nor may "OpenSSL" appear in their names without prior written
85ebfedea0SLionel Sambuc  *    permission of the OpenSSL Project.
86ebfedea0SLionel Sambuc  *
87ebfedea0SLionel Sambuc  * 6. Redistributions of any form whatsoever must retain the following
88ebfedea0SLionel Sambuc  *    acknowledgment:
89ebfedea0SLionel Sambuc  *    "This product includes software developed by the OpenSSL Project
90ebfedea0SLionel Sambuc  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91ebfedea0SLionel Sambuc  *
92ebfedea0SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93ebfedea0SLionel Sambuc  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94ebfedea0SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95ebfedea0SLionel Sambuc  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
96ebfedea0SLionel Sambuc  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97ebfedea0SLionel Sambuc  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98ebfedea0SLionel Sambuc  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99ebfedea0SLionel Sambuc  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100ebfedea0SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101ebfedea0SLionel Sambuc  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102ebfedea0SLionel Sambuc  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103ebfedea0SLionel Sambuc  * OF THE POSSIBILITY OF SUCH DAMAGE.
104ebfedea0SLionel Sambuc  * ====================================================================
105ebfedea0SLionel Sambuc  *
106ebfedea0SLionel Sambuc  * This product includes cryptographic software written by Eric Young
107ebfedea0SLionel Sambuc  * (eay@cryptsoft.com).  This product includes software written by Tim
108ebfedea0SLionel Sambuc  * Hudson (tjh@cryptsoft.com).
109ebfedea0SLionel Sambuc  *
110ebfedea0SLionel Sambuc  */
111ebfedea0SLionel Sambuc 
112ebfedea0SLionel Sambuc #ifndef HEADER_APPS_H
113ebfedea0SLionel Sambuc # define HEADER_APPS_H
114ebfedea0SLionel Sambuc 
115ebfedea0SLionel Sambuc # include "e_os.h"
116ebfedea0SLionel Sambuc 
117ebfedea0SLionel Sambuc # include <openssl/bio.h>
118ebfedea0SLionel Sambuc # include <openssl/x509.h>
119ebfedea0SLionel Sambuc # include <openssl/lhash.h>
120ebfedea0SLionel Sambuc # include <openssl/conf.h>
121ebfedea0SLionel Sambuc # include <openssl/txt_db.h>
122ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_ENGINE
123ebfedea0SLionel Sambuc #  include <openssl/engine.h>
124ebfedea0SLionel Sambuc # endif
125ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_OCSP
126ebfedea0SLionel Sambuc #  include <openssl/ocsp.h>
127ebfedea0SLionel Sambuc # endif
128ebfedea0SLionel Sambuc # include <openssl/ossl_typ.h>
129ebfedea0SLionel Sambuc 
130ebfedea0SLionel Sambuc int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
131ebfedea0SLionel Sambuc int app_RAND_write_file(const char *file, BIO *bio_e);
132*0a6a1f1dSLionel Sambuc /*
133*0a6a1f1dSLionel Sambuc  * When `file' is NULL, use defaults. `bio_e' is for error messages.
134*0a6a1f1dSLionel Sambuc  */
135ebfedea0SLionel Sambuc void app_RAND_allow_write_file(void);
136ebfedea0SLionel Sambuc long app_RAND_load_files(char *file); /* `file' is a list of files to read,
137ebfedea0SLionel Sambuc                                        * separated by LIST_SEPARATOR_CHAR
138ebfedea0SLionel Sambuc                                        * (see e_os.h).  The string is
139ebfedea0SLionel Sambuc                                        * destroyed! */
140ebfedea0SLionel Sambuc 
141ebfedea0SLionel Sambuc # ifndef MONOLITH
142ebfedea0SLionel Sambuc 
143ebfedea0SLionel Sambuc #  define MAIN(a,v)       main(a,v)
144ebfedea0SLionel Sambuc 
145ebfedea0SLionel Sambuc #  ifndef NON_MAIN
146ebfedea0SLionel Sambuc CONF *config = NULL;
147ebfedea0SLionel Sambuc BIO *bio_err = NULL;
148ebfedea0SLionel Sambuc #  else
149ebfedea0SLionel Sambuc extern CONF *config;
150ebfedea0SLionel Sambuc extern BIO *bio_err;
151ebfedea0SLionel Sambuc #  endif
152ebfedea0SLionel Sambuc 
153ebfedea0SLionel Sambuc # else
154ebfedea0SLionel Sambuc 
155ebfedea0SLionel Sambuc #  define MAIN(a,v)       PROG(a,v)
156ebfedea0SLionel Sambuc extern CONF *config;
157ebfedea0SLionel Sambuc extern char *default_config_file;
158ebfedea0SLionel Sambuc extern BIO *bio_err;
159ebfedea0SLionel Sambuc 
160ebfedea0SLionel Sambuc # endif
161ebfedea0SLionel Sambuc 
162ebfedea0SLionel Sambuc # ifndef OPENSSL_SYS_NETWARE
163ebfedea0SLionel Sambuc #  include <signal.h>
164ebfedea0SLionel Sambuc # endif
165ebfedea0SLionel Sambuc 
166ebfedea0SLionel Sambuc # ifdef SIGPIPE
167ebfedea0SLionel Sambuc #  define do_pipe_sig()   signal(SIGPIPE,SIG_IGN)
168ebfedea0SLionel Sambuc # else
169ebfedea0SLionel Sambuc #  define do_pipe_sig()
170ebfedea0SLionel Sambuc # endif
171ebfedea0SLionel Sambuc 
172ebfedea0SLionel Sambuc # ifdef OPENSSL_NO_COMP
173ebfedea0SLionel Sambuc #  define zlib_cleanup()
174ebfedea0SLionel Sambuc # else
175ebfedea0SLionel Sambuc #  define zlib_cleanup() COMP_zlib_cleanup()
176ebfedea0SLionel Sambuc # endif
177ebfedea0SLionel Sambuc 
178ebfedea0SLionel Sambuc # if defined(MONOLITH) && !defined(OPENSSL_C)
179ebfedea0SLionel Sambuc #  define apps_startup() \
180ebfedea0SLionel Sambuc                 do_pipe_sig()
181ebfedea0SLionel Sambuc #  define apps_shutdown()
182ebfedea0SLionel Sambuc # else
183ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_ENGINE
184ebfedea0SLionel Sambuc #   define apps_startup() \
185ebfedea0SLionel Sambuc                         do { do_pipe_sig(); CRYPTO_malloc_init(); \
186ebfedea0SLionel Sambuc                         ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
187ebfedea0SLionel Sambuc                         ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
188ebfedea0SLionel Sambuc #   define apps_shutdown() \
189ebfedea0SLionel Sambuc                         do { CONF_modules_unload(1); destroy_ui_method(); \
190ebfedea0SLionel Sambuc                         OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \
191ebfedea0SLionel Sambuc                         CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
192*0a6a1f1dSLionel Sambuc                         RAND_cleanup(); \
193ebfedea0SLionel Sambuc                         ERR_free_strings(); zlib_cleanup();} while(0)
194ebfedea0SLionel Sambuc #  else
195ebfedea0SLionel Sambuc #   define apps_startup() \
196ebfedea0SLionel Sambuc                         do { do_pipe_sig(); CRYPTO_malloc_init(); \
197ebfedea0SLionel Sambuc                         ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
198ebfedea0SLionel Sambuc                         setup_ui_method(); } while(0)
199ebfedea0SLionel Sambuc #   define apps_shutdown() \
200ebfedea0SLionel Sambuc                         do { CONF_modules_unload(1); destroy_ui_method(); \
201ebfedea0SLionel Sambuc                         OBJ_cleanup(); EVP_cleanup(); \
202ebfedea0SLionel Sambuc                         CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \
203*0a6a1f1dSLionel Sambuc                         RAND_cleanup(); \
204ebfedea0SLionel Sambuc                         ERR_free_strings(); zlib_cleanup(); } while(0)
205ebfedea0SLionel Sambuc #  endif
206ebfedea0SLionel Sambuc # endif
207ebfedea0SLionel Sambuc 
208ebfedea0SLionel Sambuc # ifdef OPENSSL_SYSNAME_WIN32
209ebfedea0SLionel Sambuc #  define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
210ebfedea0SLionel Sambuc # else
211ebfedea0SLionel Sambuc #  define openssl_fdset(a,b) FD_SET(a, b)
212ebfedea0SLionel Sambuc # endif
213ebfedea0SLionel Sambuc 
214*0a6a1f1dSLionel Sambuc typedef struct args_st {
215ebfedea0SLionel Sambuc     char **data;
216ebfedea0SLionel Sambuc     int count;
217ebfedea0SLionel Sambuc } ARGS;
218ebfedea0SLionel Sambuc 
219ebfedea0SLionel Sambuc # define PW_MIN_LENGTH 4
220*0a6a1f1dSLionel Sambuc typedef struct pw_cb_data {
221ebfedea0SLionel Sambuc     const void *password;
222ebfedea0SLionel Sambuc     const char *prompt_info;
223ebfedea0SLionel Sambuc } PW_CB_DATA;
224ebfedea0SLionel Sambuc 
225*0a6a1f1dSLionel Sambuc int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data);
226ebfedea0SLionel Sambuc 
227ebfedea0SLionel Sambuc int setup_ui_method(void);
228ebfedea0SLionel Sambuc void destroy_ui_method(void);
229ebfedea0SLionel Sambuc 
230ebfedea0SLionel Sambuc int should_retry(int i);
231ebfedea0SLionel Sambuc int args_from_file(char *file, int *argc, char **argv[]);
232ebfedea0SLionel Sambuc int str2fmt(char *s);
233ebfedea0SLionel Sambuc void program_name(char *in, char *out, int size);
234ebfedea0SLionel Sambuc int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]);
235ebfedea0SLionel Sambuc # ifdef HEADER_X509_H
236ebfedea0SLionel Sambuc int dump_cert_text(BIO *out, X509 *x);
237*0a6a1f1dSLionel Sambuc void print_name(BIO *out, const char *title, X509_NAME *nm,
238*0a6a1f1dSLionel Sambuc                 unsigned long lflags);
239ebfedea0SLionel Sambuc # endif
240ebfedea0SLionel Sambuc int set_cert_ex(unsigned long *flags, const char *arg);
241ebfedea0SLionel Sambuc int set_name_ex(unsigned long *flags, const char *arg);
242ebfedea0SLionel Sambuc int set_ext_copy(int *copy_type, const char *arg);
243ebfedea0SLionel Sambuc int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
244ebfedea0SLionel Sambuc int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
245ebfedea0SLionel Sambuc int add_oid_section(BIO *err, CONF *conf);
246ebfedea0SLionel Sambuc X509 *load_cert(BIO *err, const char *file, int format,
247ebfedea0SLionel Sambuc                 const char *pass, ENGINE *e, const char *cert_descrip);
248ebfedea0SLionel Sambuc EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
249ebfedea0SLionel Sambuc                    const char *pass, ENGINE *e, const char *key_descrip);
250ebfedea0SLionel Sambuc EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
251ebfedea0SLionel Sambuc                       const char *pass, ENGINE *e, const char *key_descrip);
252ebfedea0SLionel Sambuc STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
253*0a6a1f1dSLionel Sambuc                            const char *pass, ENGINE *e,
254*0a6a1f1dSLionel Sambuc                            const char *cert_descrip);
255ebfedea0SLionel Sambuc STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
256*0a6a1f1dSLionel Sambuc                               const char *pass, ENGINE *e,
257*0a6a1f1dSLionel Sambuc                               const char *cert_descrip);
258ebfedea0SLionel Sambuc X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
259ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_ENGINE
260ebfedea0SLionel Sambuc ENGINE *setup_engine(BIO *err, const char *engine, int debug);
261ebfedea0SLionel Sambuc # endif
262ebfedea0SLionel Sambuc 
263ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_OCSP
264ebfedea0SLionel Sambuc OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req,
265*0a6a1f1dSLionel Sambuc                                  char *host, char *path, char *port,
266*0a6a1f1dSLionel Sambuc                                  int use_ssl, STACK_OF(CONF_VALUE) *headers,
267ebfedea0SLionel Sambuc                                  int req_timeout);
268ebfedea0SLionel Sambuc # endif
269ebfedea0SLionel Sambuc 
270ebfedea0SLionel Sambuc int load_config(BIO *err, CONF *cnf);
271ebfedea0SLionel Sambuc char *make_config_name(void);
272ebfedea0SLionel Sambuc 
273ebfedea0SLionel Sambuc /* Functions defined in ca.c and also used in ocsp.c */
274ebfedea0SLionel Sambuc int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
275ebfedea0SLionel Sambuc                    ASN1_GENERALIZEDTIME **pinvtm, const char *str);
276ebfedea0SLionel Sambuc 
277ebfedea0SLionel Sambuc # define DB_type         0
278ebfedea0SLionel Sambuc # define DB_exp_date     1
279ebfedea0SLionel Sambuc # define DB_rev_date     2
280ebfedea0SLionel Sambuc # define DB_serial       3      /* index - unique */
281ebfedea0SLionel Sambuc # define DB_file         4
282*0a6a1f1dSLionel Sambuc # define DB_name         5      /* index - unique when active and not
283*0a6a1f1dSLionel Sambuc                                  * disabled */
284ebfedea0SLionel Sambuc # define DB_NUMBER       6
285ebfedea0SLionel Sambuc 
286ebfedea0SLionel Sambuc # define DB_TYPE_REV     'R'
287ebfedea0SLionel Sambuc # define DB_TYPE_EXP     'E'
288ebfedea0SLionel Sambuc # define DB_TYPE_VAL     'V'
289ebfedea0SLionel Sambuc 
290*0a6a1f1dSLionel Sambuc typedef struct db_attr_st {
291ebfedea0SLionel Sambuc     int unique_subject;
292ebfedea0SLionel Sambuc } DB_ATTR;
293*0a6a1f1dSLionel Sambuc typedef struct ca_db_st {
294ebfedea0SLionel Sambuc     DB_ATTR attributes;
295ebfedea0SLionel Sambuc     TXT_DB *db;
296ebfedea0SLionel Sambuc } CA_DB;
297ebfedea0SLionel Sambuc 
298ebfedea0SLionel Sambuc BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
299*0a6a1f1dSLionel Sambuc int save_serial(char *serialfile, char *suffix, BIGNUM *serial,
300*0a6a1f1dSLionel Sambuc                 ASN1_INTEGER **retai);
301ebfedea0SLionel Sambuc int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
302ebfedea0SLionel Sambuc int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
303ebfedea0SLionel Sambuc CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
304ebfedea0SLionel Sambuc int index_index(CA_DB *db);
305ebfedea0SLionel Sambuc int save_index(const char *dbfile, const char *suffix, CA_DB *db);
306*0a6a1f1dSLionel Sambuc int rotate_index(const char *dbfile, const char *new_suffix,
307*0a6a1f1dSLionel Sambuc                  const char *old_suffix);
308ebfedea0SLionel Sambuc void free_index(CA_DB *db);
309ebfedea0SLionel Sambuc # define index_name_cmp_noconst(a, b) \
310ebfedea0SLionel Sambuc         index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
311ebfedea0SLionel Sambuc         (const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
312ebfedea0SLionel Sambuc int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
313ebfedea0SLionel Sambuc int parse_yesno(const char *str, int def);
314ebfedea0SLionel Sambuc 
315ebfedea0SLionel Sambuc X509_NAME *parse_name(char *str, long chtype, int multirdn);
316ebfedea0SLionel Sambuc int args_verify(char ***pargs, int *pargc,
317ebfedea0SLionel Sambuc                 int *badarg, BIO *err, X509_VERIFY_PARAM **pm);
318ebfedea0SLionel Sambuc void policies_print(BIO *out, X509_STORE_CTX *ctx);
319ebfedea0SLionel Sambuc int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
320ebfedea0SLionel Sambuc int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value);
321ebfedea0SLionel Sambuc int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx,
322ebfedea0SLionel Sambuc                  const char *algname, ENGINE *e, int do_param);
323ebfedea0SLionel Sambuc int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
324ebfedea0SLionel Sambuc                  STACK_OF(OPENSSL_STRING) *sigopts);
325ebfedea0SLionel Sambuc int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md,
326ebfedea0SLionel Sambuc                      STACK_OF(OPENSSL_STRING) *sigopts);
327ebfedea0SLionel Sambuc int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md,
328ebfedea0SLionel Sambuc                      STACK_OF(OPENSSL_STRING) *sigopts);
329ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_PSK
330ebfedea0SLionel Sambuc extern char *psk_key;
331ebfedea0SLionel Sambuc # endif
332ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_JPAKE
333ebfedea0SLionel Sambuc void jpake_client_auth(BIO *out, BIO *conn, const char *secret);
334ebfedea0SLionel Sambuc void jpake_server_auth(BIO *out, BIO *conn, const char *secret);
335ebfedea0SLionel Sambuc # endif
336ebfedea0SLionel Sambuc 
337ebfedea0SLionel Sambuc # if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
338ebfedea0SLionel Sambuc unsigned char *next_protos_parse(unsigned short *outlen, const char *in);
339*0a6a1f1dSLionel Sambuc # endif                         /* !OPENSSL_NO_TLSEXT &&
340*0a6a1f1dSLionel Sambuc                                  * !OPENSSL_NO_NEXTPROTONEG */
341ebfedea0SLionel Sambuc 
342ebfedea0SLionel Sambuc # define FORMAT_UNDEF    0
343ebfedea0SLionel Sambuc # define FORMAT_ASN1     1
344ebfedea0SLionel Sambuc # define FORMAT_TEXT     2
345ebfedea0SLionel Sambuc # define FORMAT_PEM      3
346ebfedea0SLionel Sambuc # define FORMAT_NETSCAPE 4
347ebfedea0SLionel Sambuc # define FORMAT_PKCS12   5
348ebfedea0SLionel Sambuc # define FORMAT_SMIME    6
349ebfedea0SLionel Sambuc # define FORMAT_ENGINE   7
350ebfedea0SLionel Sambuc # define FORMAT_IISSGC   8      /* XXX this stupid macro helps us to avoid
351ebfedea0SLionel Sambuc                                  * adding yet another param to load_*key() */
352ebfedea0SLionel Sambuc # define FORMAT_PEMRSA   9      /* PEM RSAPubicKey format */
353ebfedea0SLionel Sambuc # define FORMAT_ASN1RSA  10     /* DER RSAPubicKey format */
354ebfedea0SLionel Sambuc # define FORMAT_MSBLOB   11     /* MS Key blob format */
355ebfedea0SLionel Sambuc # define FORMAT_PVK      12     /* MS PVK file format */
356ebfedea0SLionel Sambuc 
357ebfedea0SLionel Sambuc # define EXT_COPY_NONE   0
358ebfedea0SLionel Sambuc # define EXT_COPY_ADD    1
359ebfedea0SLionel Sambuc # define EXT_COPY_ALL    2
360ebfedea0SLionel Sambuc 
361ebfedea0SLionel Sambuc # define NETSCAPE_CERT_HDR       "certificate"
362ebfedea0SLionel Sambuc 
363ebfedea0SLionel Sambuc # define APP_PASS_LEN    1024
364ebfedea0SLionel Sambuc 
365ebfedea0SLionel Sambuc # define SERIAL_RAND_BITS        64
366ebfedea0SLionel Sambuc 
367ebfedea0SLionel Sambuc int app_isdir(const char *);
368ebfedea0SLionel Sambuc int raw_read_stdin(void *, int);
369ebfedea0SLionel Sambuc int raw_write_stdout(const void *, int);
370ebfedea0SLionel Sambuc 
371ebfedea0SLionel Sambuc # define TM_START        0
372ebfedea0SLionel Sambuc # define TM_STOP         1
373ebfedea0SLionel Sambuc double app_tminterval(int stop, int usertime);
374ebfedea0SLionel Sambuc 
375ebfedea0SLionel Sambuc # define OPENSSL_NO_SSL_INTERN
376ebfedea0SLionel Sambuc 
377ebfedea0SLionel Sambuc #endif
378