xref: /onnv-gate/usr/src/common/openssl/apps/apps.h (revision 2139:6243c3338933)
10Sstevel@tonic-gate /* apps/apps.h */
20Sstevel@tonic-gate /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
30Sstevel@tonic-gate  * All rights reserved.
40Sstevel@tonic-gate  *
50Sstevel@tonic-gate  * This package is an SSL implementation written
60Sstevel@tonic-gate  * by Eric Young (eay@cryptsoft.com).
70Sstevel@tonic-gate  * The implementation was written so as to conform with Netscapes SSL.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * This library is free for commercial and non-commercial use as long as
100Sstevel@tonic-gate  * the following conditions are aheared to.  The following conditions
110Sstevel@tonic-gate  * apply to all code found in this distribution, be it the RC4, RSA,
120Sstevel@tonic-gate  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
130Sstevel@tonic-gate  * included with this distribution is covered by the same copyright terms
140Sstevel@tonic-gate  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
150Sstevel@tonic-gate  *
160Sstevel@tonic-gate  * Copyright remains Eric Young's, and as such any Copyright notices in
170Sstevel@tonic-gate  * the code are not to be removed.
180Sstevel@tonic-gate  * If this package is used in a product, Eric Young should be given attribution
190Sstevel@tonic-gate  * as the author of the parts of the library used.
200Sstevel@tonic-gate  * This can be in the form of a textual message at program startup or
210Sstevel@tonic-gate  * in documentation (online or textual) provided with the package.
220Sstevel@tonic-gate  *
230Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
240Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
250Sstevel@tonic-gate  * are met:
260Sstevel@tonic-gate  * 1. Redistributions of source code must retain the copyright
270Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
280Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
290Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in the
300Sstevel@tonic-gate  *    documentation and/or other materials provided with the distribution.
310Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this software
320Sstevel@tonic-gate  *    must display the following acknowledgement:
330Sstevel@tonic-gate  *    "This product includes cryptographic software written by
340Sstevel@tonic-gate  *     Eric Young (eay@cryptsoft.com)"
350Sstevel@tonic-gate  *    The word 'cryptographic' can be left out if the rouines from the library
360Sstevel@tonic-gate  *    being used are not cryptographic related :-).
370Sstevel@tonic-gate  * 4. If you include any Windows specific code (or a derivative thereof) from
380Sstevel@tonic-gate  *    the apps directory (application code) you must include an acknowledgement:
390Sstevel@tonic-gate  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
400Sstevel@tonic-gate  *
410Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
420Sstevel@tonic-gate  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
430Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
440Sstevel@tonic-gate  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
450Sstevel@tonic-gate  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
460Sstevel@tonic-gate  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
470Sstevel@tonic-gate  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
480Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
490Sstevel@tonic-gate  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
500Sstevel@tonic-gate  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
510Sstevel@tonic-gate  * SUCH DAMAGE.
520Sstevel@tonic-gate  *
530Sstevel@tonic-gate  * The licence and distribution terms for any publically available version or
540Sstevel@tonic-gate  * derivative of this code cannot be changed.  i.e. this code cannot simply be
550Sstevel@tonic-gate  * copied and put under another distribution licence
560Sstevel@tonic-gate  * [including the GNU Public Licence.]
570Sstevel@tonic-gate  */
580Sstevel@tonic-gate /* ====================================================================
590Sstevel@tonic-gate  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
600Sstevel@tonic-gate  *
610Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
620Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
630Sstevel@tonic-gate  * are met:
640Sstevel@tonic-gate  *
650Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
660Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
670Sstevel@tonic-gate  *
680Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
690Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in
700Sstevel@tonic-gate  *    the documentation and/or other materials provided with the
710Sstevel@tonic-gate  *    distribution.
720Sstevel@tonic-gate  *
730Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this
740Sstevel@tonic-gate  *    software must display the following acknowledgment:
750Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
760Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
770Sstevel@tonic-gate  *
780Sstevel@tonic-gate  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
790Sstevel@tonic-gate  *    endorse or promote products derived from this software without
800Sstevel@tonic-gate  *    prior written permission. For written permission, please contact
810Sstevel@tonic-gate  *    openssl-core@openssl.org.
820Sstevel@tonic-gate  *
830Sstevel@tonic-gate  * 5. Products derived from this software may not be called "OpenSSL"
840Sstevel@tonic-gate  *    nor may "OpenSSL" appear in their names without prior written
850Sstevel@tonic-gate  *    permission of the OpenSSL Project.
860Sstevel@tonic-gate  *
870Sstevel@tonic-gate  * 6. Redistributions of any form whatsoever must retain the following
880Sstevel@tonic-gate  *    acknowledgment:
890Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
900Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
910Sstevel@tonic-gate  *
920Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
930Sstevel@tonic-gate  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
940Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
950Sstevel@tonic-gate  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
960Sstevel@tonic-gate  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
970Sstevel@tonic-gate  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
980Sstevel@tonic-gate  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
990Sstevel@tonic-gate  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1000Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1010Sstevel@tonic-gate  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1020Sstevel@tonic-gate  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
1030Sstevel@tonic-gate  * OF THE POSSIBILITY OF SUCH DAMAGE.
1040Sstevel@tonic-gate  * ====================================================================
1050Sstevel@tonic-gate  *
1060Sstevel@tonic-gate  * This product includes cryptographic software written by Eric Young
1070Sstevel@tonic-gate  * (eay@cryptsoft.com).  This product includes software written by Tim
1080Sstevel@tonic-gate  * Hudson (tjh@cryptsoft.com).
1090Sstevel@tonic-gate  *
1100Sstevel@tonic-gate  */
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate #ifndef HEADER_APPS_H
1130Sstevel@tonic-gate #define HEADER_APPS_H
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate #include "e_os.h"
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate #include <openssl/bio.h>
1180Sstevel@tonic-gate #include <openssl/x509.h>
1190Sstevel@tonic-gate #include <openssl/lhash.h>
1200Sstevel@tonic-gate #include <openssl/conf.h>
1210Sstevel@tonic-gate #include <openssl/txt_db.h>
1220Sstevel@tonic-gate #ifndef OPENSSL_NO_ENGINE
1230Sstevel@tonic-gate #include <openssl/engine.h>
1240Sstevel@tonic-gate #endif
1250Sstevel@tonic-gate #include <openssl/ossl_typ.h>
1260Sstevel@tonic-gate 
1270Sstevel@tonic-gate int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn);
1280Sstevel@tonic-gate int app_RAND_write_file(const char *file, BIO *bio_e);
1290Sstevel@tonic-gate /* When `file' is NULL, use defaults.
1300Sstevel@tonic-gate  * `bio_e' is for error messages. */
1310Sstevel@tonic-gate void app_RAND_allow_write_file(void);
1320Sstevel@tonic-gate long app_RAND_load_files(char *file); /* `file' is a list of files to read,
1330Sstevel@tonic-gate                                        * separated by LIST_SEPARATOR_CHAR
1340Sstevel@tonic-gate                                        * (see e_os.h).  The string is
1350Sstevel@tonic-gate                                        * destroyed! */
1360Sstevel@tonic-gate 
1370Sstevel@tonic-gate #ifdef OPENSSL_SYS_WIN32
1380Sstevel@tonic-gate #define rename(from,to) WIN32_rename((from),(to))
139*2139Sjp161948 int WIN32_rename(const char *oldname,const char *newname);
1400Sstevel@tonic-gate #endif
1410Sstevel@tonic-gate 
1420Sstevel@tonic-gate #ifndef MONOLITH
1430Sstevel@tonic-gate 
1440Sstevel@tonic-gate #define MAIN(a,v)	main(a,v)
1450Sstevel@tonic-gate 
1460Sstevel@tonic-gate #ifndef NON_MAIN
1470Sstevel@tonic-gate CONF *config=NULL;
1480Sstevel@tonic-gate BIO *bio_err=NULL;
1490Sstevel@tonic-gate #else
1500Sstevel@tonic-gate extern CONF *config;
1510Sstevel@tonic-gate extern BIO *bio_err;
1520Sstevel@tonic-gate #endif
1530Sstevel@tonic-gate 
1540Sstevel@tonic-gate #else
1550Sstevel@tonic-gate 
1560Sstevel@tonic-gate #define MAIN(a,v)	PROG(a,v)
1570Sstevel@tonic-gate extern CONF *config;
1580Sstevel@tonic-gate extern char *default_config_file;
1590Sstevel@tonic-gate extern BIO *bio_err;
1600Sstevel@tonic-gate 
1610Sstevel@tonic-gate #endif
1620Sstevel@tonic-gate 
163*2139Sjp161948 #ifndef OPENSSL_SYS_NETWARE
1640Sstevel@tonic-gate #include <signal.h>
165*2139Sjp161948 #endif
1660Sstevel@tonic-gate 
1670Sstevel@tonic-gate #ifdef SIGPIPE
1680Sstevel@tonic-gate #define do_pipe_sig()	signal(SIGPIPE,SIG_IGN)
1690Sstevel@tonic-gate #else
1700Sstevel@tonic-gate #define do_pipe_sig()
1710Sstevel@tonic-gate #endif
1720Sstevel@tonic-gate 
1730Sstevel@tonic-gate #if defined(MONOLITH) && !defined(OPENSSL_C)
1740Sstevel@tonic-gate #  define apps_startup() \
1750Sstevel@tonic-gate 		do_pipe_sig()
1760Sstevel@tonic-gate #  define apps_shutdown()
1770Sstevel@tonic-gate #else
1780Sstevel@tonic-gate #  ifndef OPENSSL_NO_ENGINE
1790Sstevel@tonic-gate #    if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
1800Sstevel@tonic-gate      defined(OPENSSL_SYS_WIN32)
1810Sstevel@tonic-gate #      ifdef _O_BINARY
1820Sstevel@tonic-gate #        define apps_startup() \
1830Sstevel@tonic-gate 			do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
1840Sstevel@tonic-gate 			ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
1850Sstevel@tonic-gate 			ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
1860Sstevel@tonic-gate #      else
1870Sstevel@tonic-gate #        define apps_startup() \
1880Sstevel@tonic-gate 			do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
1890Sstevel@tonic-gate 			ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
1900Sstevel@tonic-gate 			ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
1910Sstevel@tonic-gate #      endif
1920Sstevel@tonic-gate #    else
1930Sstevel@tonic-gate #      define apps_startup() \
1940Sstevel@tonic-gate 			do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
1950Sstevel@tonic-gate 			ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \
1960Sstevel@tonic-gate 			setup_ui_method(); } while(0)
1970Sstevel@tonic-gate #    endif
1980Sstevel@tonic-gate #    define apps_shutdown() \
1990Sstevel@tonic-gate 			do { CONF_modules_unload(1); destroy_ui_method(); \
2000Sstevel@tonic-gate 			EVP_cleanup(); ENGINE_cleanup(); \
2010Sstevel@tonic-gate 			CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
2020Sstevel@tonic-gate 			ERR_free_strings(); } while(0)
2030Sstevel@tonic-gate #  else
2040Sstevel@tonic-gate #    if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
2050Sstevel@tonic-gate      defined(OPENSSL_SYS_WIN32)
2060Sstevel@tonic-gate #      ifdef _O_BINARY
2070Sstevel@tonic-gate #        define apps_startup() \
2080Sstevel@tonic-gate 			do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
2090Sstevel@tonic-gate 			ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
2100Sstevel@tonic-gate 			setup_ui_method(); } while(0)
2110Sstevel@tonic-gate #      else
2120Sstevel@tonic-gate #        define apps_startup() \
2130Sstevel@tonic-gate 			do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
2140Sstevel@tonic-gate 			ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \
2150Sstevel@tonic-gate 			setup_ui_method(); } while(0)
2160Sstevel@tonic-gate #      endif
2170Sstevel@tonic-gate #    else
2180Sstevel@tonic-gate #      define apps_startup() \
2190Sstevel@tonic-gate 			do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
2200Sstevel@tonic-gate 			ERR_load_crypto_strings(); \
2210Sstevel@tonic-gate 			setup_ui_method(); } while(0)
2220Sstevel@tonic-gate #    endif
2230Sstevel@tonic-gate #    define apps_shutdown() \
2240Sstevel@tonic-gate 			do { CONF_modules_unload(1); destroy_ui_method(); \
2250Sstevel@tonic-gate 			EVP_cleanup(); \
2260Sstevel@tonic-gate 			CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \
2270Sstevel@tonic-gate 			ERR_free_strings(); } while(0)
2280Sstevel@tonic-gate #  endif
2290Sstevel@tonic-gate #endif
2300Sstevel@tonic-gate 
2310Sstevel@tonic-gate typedef struct args_st
2320Sstevel@tonic-gate 	{
2330Sstevel@tonic-gate 	char **data;
2340Sstevel@tonic-gate 	int count;
2350Sstevel@tonic-gate 	} ARGS;
2360Sstevel@tonic-gate 
2370Sstevel@tonic-gate #define PW_MIN_LENGTH 4
2380Sstevel@tonic-gate typedef struct pw_cb_data
2390Sstevel@tonic-gate 	{
2400Sstevel@tonic-gate 	const void *password;
2410Sstevel@tonic-gate 	const char *prompt_info;
2420Sstevel@tonic-gate 	} PW_CB_DATA;
2430Sstevel@tonic-gate 
2440Sstevel@tonic-gate int password_callback(char *buf, int bufsiz, int verify,
2450Sstevel@tonic-gate 	PW_CB_DATA *cb_data);
2460Sstevel@tonic-gate 
2470Sstevel@tonic-gate int setup_ui_method(void);
2480Sstevel@tonic-gate void destroy_ui_method(void);
2490Sstevel@tonic-gate 
2500Sstevel@tonic-gate int should_retry(int i);
2510Sstevel@tonic-gate int args_from_file(char *file, int *argc, char **argv[]);
2520Sstevel@tonic-gate int str2fmt(char *s);
2530Sstevel@tonic-gate void program_name(char *in,char *out,int size);
2540Sstevel@tonic-gate int chopup_args(ARGS *arg,char *buf, int *argc, char **argv[]);
2550Sstevel@tonic-gate #ifdef HEADER_X509_H
2560Sstevel@tonic-gate int dump_cert_text(BIO *out, X509 *x);
257*2139Sjp161948 void print_name(BIO *out, const char *title, X509_NAME *nm, unsigned long lflags);
2580Sstevel@tonic-gate #endif
2590Sstevel@tonic-gate int set_cert_ex(unsigned long *flags, const char *arg);
2600Sstevel@tonic-gate int set_name_ex(unsigned long *flags, const char *arg);
2610Sstevel@tonic-gate int set_ext_copy(int *copy_type, const char *arg);
2620Sstevel@tonic-gate int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
2630Sstevel@tonic-gate int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2);
2640Sstevel@tonic-gate int add_oid_section(BIO *err, CONF *conf);
2650Sstevel@tonic-gate X509 *load_cert(BIO *err, const char *file, int format,
2660Sstevel@tonic-gate 	const char *pass, ENGINE *e, const char *cert_descrip);
2670Sstevel@tonic-gate EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
2680Sstevel@tonic-gate 	const char *pass, ENGINE *e, const char *key_descrip);
2690Sstevel@tonic-gate EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
2700Sstevel@tonic-gate 	const char *pass, ENGINE *e, const char *key_descrip);
2710Sstevel@tonic-gate STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
2720Sstevel@tonic-gate 	const char *pass, ENGINE *e, const char *cert_descrip);
2730Sstevel@tonic-gate X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath);
2740Sstevel@tonic-gate #ifndef OPENSSL_NO_ENGINE
2750Sstevel@tonic-gate ENGINE *setup_engine(BIO *err, const char *engine, int debug);
2760Sstevel@tonic-gate #endif
2770Sstevel@tonic-gate 
2780Sstevel@tonic-gate int load_config(BIO *err, CONF *cnf);
2790Sstevel@tonic-gate char *make_config_name(void);
2800Sstevel@tonic-gate 
2810Sstevel@tonic-gate /* Functions defined in ca.c and also used in ocsp.c */
2820Sstevel@tonic-gate int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
283*2139Sjp161948 			ASN1_GENERALIZEDTIME **pinvtm, const char *str);
2840Sstevel@tonic-gate 
2850Sstevel@tonic-gate #define DB_type         0
2860Sstevel@tonic-gate #define DB_exp_date     1
2870Sstevel@tonic-gate #define DB_rev_date     2
2880Sstevel@tonic-gate #define DB_serial       3       /* index - unique */
2890Sstevel@tonic-gate #define DB_file         4
2900Sstevel@tonic-gate #define DB_name         5       /* index - unique when active and not disabled */
2910Sstevel@tonic-gate #define DB_NUMBER       6
2920Sstevel@tonic-gate 
2930Sstevel@tonic-gate #define DB_TYPE_REV	'R'
2940Sstevel@tonic-gate #define DB_TYPE_EXP	'E'
2950Sstevel@tonic-gate #define DB_TYPE_VAL	'V'
2960Sstevel@tonic-gate 
2970Sstevel@tonic-gate typedef struct db_attr_st
2980Sstevel@tonic-gate 	{
2990Sstevel@tonic-gate 	int unique_subject;
3000Sstevel@tonic-gate 	} DB_ATTR;
3010Sstevel@tonic-gate typedef struct ca_db_st
3020Sstevel@tonic-gate 	{
3030Sstevel@tonic-gate 	DB_ATTR attributes;
3040Sstevel@tonic-gate 	TXT_DB *db;
3050Sstevel@tonic-gate 	} CA_DB;
3060Sstevel@tonic-gate 
3070Sstevel@tonic-gate BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai);
3080Sstevel@tonic-gate int save_serial(char *serialfile, char *suffix, BIGNUM *serial, ASN1_INTEGER **retai);
3090Sstevel@tonic-gate int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix);
310*2139Sjp161948 int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
3110Sstevel@tonic-gate CA_DB *load_index(char *dbfile, DB_ATTR *dbattr);
3120Sstevel@tonic-gate int index_index(CA_DB *db);
313*2139Sjp161948 int save_index(const char *dbfile, const char *suffix, CA_DB *db);
314*2139Sjp161948 int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix);
3150Sstevel@tonic-gate void free_index(CA_DB *db);
3160Sstevel@tonic-gate int index_name_cmp(const char **a, const char **b);
317*2139Sjp161948 int parse_yesno(const char *str, int def);
3180Sstevel@tonic-gate 
319*2139Sjp161948 X509_NAME *parse_name(char *str, long chtype, int multirdn);
320*2139Sjp161948 int args_verify(char ***pargs, int *pargc,
321*2139Sjp161948 			int *badarg, BIO *err, X509_VERIFY_PARAM **pm);
322*2139Sjp161948 void policies_print(BIO *out, X509_STORE_CTX *ctx);
3230Sstevel@tonic-gate 
3240Sstevel@tonic-gate #define FORMAT_UNDEF    0
3250Sstevel@tonic-gate #define FORMAT_ASN1     1
3260Sstevel@tonic-gate #define FORMAT_TEXT     2
3270Sstevel@tonic-gate #define FORMAT_PEM      3
3280Sstevel@tonic-gate #define FORMAT_NETSCAPE 4
3290Sstevel@tonic-gate #define FORMAT_PKCS12   5
3300Sstevel@tonic-gate #define FORMAT_SMIME    6
3310Sstevel@tonic-gate #define FORMAT_ENGINE   7
3320Sstevel@tonic-gate #define FORMAT_IISSGC	8	/* XXX this stupid macro helps us to avoid
3330Sstevel@tonic-gate 				 * adding yet another param to load_*key() */
3340Sstevel@tonic-gate 
3350Sstevel@tonic-gate #define EXT_COPY_NONE	0
3360Sstevel@tonic-gate #define EXT_COPY_ADD	1
3370Sstevel@tonic-gate #define EXT_COPY_ALL	2
3380Sstevel@tonic-gate 
3390Sstevel@tonic-gate #define NETSCAPE_CERT_HDR	"certificate"
3400Sstevel@tonic-gate 
3410Sstevel@tonic-gate #define APP_PASS_LEN	1024
3420Sstevel@tonic-gate 
343*2139Sjp161948 #define SERIAL_RAND_BITS	64
344*2139Sjp161948 
3450Sstevel@tonic-gate #endif
346