epoc32/include/stdapis/openssl/x509_vfy.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/openssl/x509_vfy.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/openssl/x509_vfy.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,542 @@
     1.4 -x509_vfy.h
     1.5 +/* crypto/x509/x509_vfy.h */
     1.6 +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
     1.7 + * All rights reserved.
     1.8 + *
     1.9 + * This package is an SSL implementation written
    1.10 + * by Eric Young (eay@cryptsoft.com).
    1.11 + * The implementation was written so as to conform with Netscapes SSL.
    1.12 + * 
    1.13 + * This library is free for commercial and non-commercial use as long as
    1.14 + * the following conditions are aheared to.  The following conditions
    1.15 + * apply to all code found in this distribution, be it the RC4, RSA,
    1.16 + * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
    1.17 + * included with this distribution is covered by the same copyright terms
    1.18 + * except that the holder is Tim Hudson (tjh@cryptsoft.com).
    1.19 + * 
    1.20 + * Copyright remains Eric Young's, and as such any Copyright notices in
    1.21 + * the code are not to be removed.
    1.22 + * If this package is used in a product, Eric Young should be given attribution
    1.23 + * as the author of the parts of the library used.
    1.24 + * This can be in the form of a textual message at program startup or
    1.25 + * in documentation (online or textual) provided with the package.
    1.26 + * 
    1.27 + * Redistribution and use in source and binary forms, with or without
    1.28 + * modification, are permitted provided that the following conditions
    1.29 + * are met:
    1.30 + * 1. Redistributions of source code must retain the copyright
    1.31 + *    notice, this list of conditions and the following disclaimer.
    1.32 + * 2. Redistributions in binary form must reproduce the above copyright
    1.33 + *    notice, this list of conditions and the following disclaimer in the
    1.34 + *    documentation and/or other materials provided with the distribution.
    1.35 + * 3. All advertising materials mentioning features or use of this software
    1.36 + *    must display the following acknowledgement:
    1.37 + *    "This product includes cryptographic software written by
    1.38 + *     Eric Young (eay@cryptsoft.com)"
    1.39 + *    The word 'cryptographic' can be left out if the rouines from the library
    1.40 + *    being used are not cryptographic related :-).
    1.41 + * 4. If you include any Windows specific code (or a derivative thereof) from 
    1.42 + *    the apps directory (application code) you must include an acknowledgement:
    1.43 + *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
    1.44 + * 
    1.45 + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
    1.46 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.47 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    1.48 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
    1.49 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.50 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
    1.51 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.52 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.53 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.54 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.55 + * SUCH DAMAGE.
    1.56 + * 
    1.57 + * The licence and distribution terms for any publically available version or
    1.58 + * derivative of this code cannot be changed.  i.e. this code cannot simply be
    1.59 + * copied and put under another distribution licence
    1.60 + * [including the GNU Public Licence.]
    1.61 + */
    1.62 +/*
    1.63 + © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
    1.64 + */
    1.65 +
    1.66 +#ifndef HEADER_X509_H
    1.67 +
    1.68 +#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
    1.69 +#define SYMBIAN
    1.70 +#endif
    1.71 +
    1.72 +#ifdef SYMBIAN
    1.73 +#include <e32def.h>
    1.74 +#endif
    1.75 +#include <openssl/x509.h>
    1.76 +/* openssl/x509.h ends up #include-ing this file at about the only
    1.77 + * appropriate moment. */
    1.78 +#endif
    1.79 +
    1.80 +#ifndef HEADER_X509_VFY_H
    1.81 +#define HEADER_X509_VFY_H
    1.82 +
    1.83 +#include <openssl/opensslconf.h>
    1.84 +#ifndef OPENSSL_NO_LHASH
    1.85 +#include <openssl/lhash.h>
    1.86 +#endif
    1.87 +#include <openssl/bio.h>
    1.88 +#include <openssl/crypto.h>
    1.89 +#include <openssl/symhacks.h>
    1.90 +
    1.91 +#ifdef  __cplusplus
    1.92 +extern "C" {
    1.93 +#endif
    1.94 +
    1.95 +/* Outer object */
    1.96 +typedef struct x509_hash_dir_st
    1.97 +	{
    1.98 +	int num_dirs;
    1.99 +	char **dirs;
   1.100 +	int *dirs_type;
   1.101 +	int num_dirs_alloced;
   1.102 +	} X509_HASH_DIR_CTX;
   1.103 +
   1.104 +typedef struct x509_file_st
   1.105 +	{
   1.106 +	int num_paths;	/* number of paths to files or directories */
   1.107 +	int num_alloced;
   1.108 +	char **paths;	/* the list of paths or directories */
   1.109 +	int *path_type;
   1.110 +	} X509_CERT_FILE_CTX;
   1.111 +
   1.112 +/*******************************/
   1.113 +/*
   1.114 +SSL_CTX -> X509_STORE    
   1.115 +		-> X509_LOOKUP
   1.116 +			->X509_LOOKUP_METHOD
   1.117 +		-> X509_LOOKUP
   1.118 +			->X509_LOOKUP_METHOD
   1.119 + 
   1.120 +SSL	-> X509_STORE_CTX
   1.121 +		->X509_STORE    
   1.122 +
   1.123 +The X509_STORE holds the tables etc for verification stuff.
   1.124 +A X509_STORE_CTX is used while validating a single certificate.
   1.125 +The X509_STORE has X509_LOOKUPs for looking up certs.
   1.126 +The X509_STORE then calls a function to actually verify the
   1.127 +certificate chain.
   1.128 +*/
   1.129 +
   1.130 +#define X509_LU_RETRY		-1
   1.131 +#define X509_LU_FAIL		0
   1.132 +#define X509_LU_X509		1
   1.133 +#define X509_LU_CRL		2
   1.134 +#define X509_LU_PKEY		3
   1.135 +
   1.136 +typedef struct x509_object_st
   1.137 +	{
   1.138 +	/* one of the above types */
   1.139 +	int type;
   1.140 +	union	{
   1.141 +		char *ptr;
   1.142 +		X509 *x509;
   1.143 +		X509_CRL *crl;
   1.144 +		EVP_PKEY *pkey;
   1.145 +		} data;
   1.146 +	} X509_OBJECT;
   1.147 +
   1.148 +typedef struct x509_lookup_st X509_LOOKUP;
   1.149 +
   1.150 +DECLARE_STACK_OF(X509_LOOKUP)
   1.151 +DECLARE_STACK_OF(X509_OBJECT)
   1.152 +
   1.153 +/* This is a static that defines the function interface */
   1.154 +typedef struct x509_lookup_method_st
   1.155 +	{
   1.156 +	const char *name;
   1.157 +	int (*new_item)(X509_LOOKUP *ctx);
   1.158 +	void (*free)(X509_LOOKUP *ctx);
   1.159 +	int (*init)(X509_LOOKUP *ctx);
   1.160 +	int (*shutdown)(X509_LOOKUP *ctx);
   1.161 +	int (*ctrl)(X509_LOOKUP *ctx,int cmd,const char *argc,long argl,
   1.162 +			char **ret);
   1.163 +	int (*get_by_subject)(X509_LOOKUP *ctx,int type,X509_NAME *name,
   1.164 +			      X509_OBJECT *ret);
   1.165 +	int (*get_by_issuer_serial)(X509_LOOKUP *ctx,int type,X509_NAME *name,
   1.166 +				    ASN1_INTEGER *serial,X509_OBJECT *ret);
   1.167 +	int (*get_by_fingerprint)(X509_LOOKUP *ctx,int type,
   1.168 +				  unsigned char *bytes,int len,
   1.169 +				  X509_OBJECT *ret);
   1.170 +	int (*get_by_alias)(X509_LOOKUP *ctx,int type,char *str,int len,
   1.171 +			    X509_OBJECT *ret);
   1.172 +	} X509_LOOKUP_METHOD;
   1.173 +
   1.174 +/* This structure hold all parameters associated with a verify operation
   1.175 + * by including an X509_VERIFY_PARAM structure in related structures the
   1.176 + * parameters used can be customized
   1.177 + */
   1.178 +
   1.179 +typedef struct X509_VERIFY_PARAM_st
   1.180 +	{
   1.181 +	char *name;
   1.182 +	time_t check_time;	/* Time to use */
   1.183 +	unsigned long inh_flags; /* Inheritance flags */
   1.184 +	unsigned long flags;	/* Various verify flags */
   1.185 +	int purpose;		/* purpose to check untrusted certificates */
   1.186 +	int trust;		/* trust setting to check */
   1.187 +	int depth;		/* Verify depth */
   1.188 +	STACK_OF(ASN1_OBJECT) *policies;	/* Permissible policies */
   1.189 +	} X509_VERIFY_PARAM;
   1.190 +
   1.191 +DECLARE_STACK_OF(X509_VERIFY_PARAM)
   1.192 +
   1.193 +/* This is used to hold everything.  It is used for all certificate
   1.194 + * validation.  Once we have a certificate chain, the 'verify'
   1.195 + * function is then called to actually check the cert chain. */
   1.196 +struct x509_store_st
   1.197 +	{
   1.198 +	/* The following is a cache of trusted certs */
   1.199 +	int cache; 	/* if true, stash any hits */
   1.200 +	STACK_OF(X509_OBJECT) *objs;	/* Cache of all objects */
   1.201 +
   1.202 +	/* These are external lookup methods */
   1.203 +	STACK_OF(X509_LOOKUP) *get_cert_methods;
   1.204 +
   1.205 +	X509_VERIFY_PARAM *param;
   1.206 +
   1.207 +	/* Callbacks for various operations */
   1.208 +	int (*verify)(X509_STORE_CTX *ctx);	/* called to verify a certificate */
   1.209 +	int (*verify_cb)(int ok,X509_STORE_CTX *ctx);	/* error callback */
   1.210 +	int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);	/* get issuers cert from ctx */
   1.211 +	int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
   1.212 +	int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
   1.213 +	int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
   1.214 +	int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
   1.215 +	int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
   1.216 +	int (*cleanup)(X509_STORE_CTX *ctx);
   1.217 +
   1.218 +	CRYPTO_EX_DATA ex_data;
   1.219 +	int references;
   1.220 +	} /* X509_STORE */;
   1.221 +
   1.222 +int X509_STORE_set_depth(X509_STORE *store, int depth);
   1.223 +
   1.224 +#define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func))
   1.225 +#define X509_STORE_set_verify_func(ctx,func)	((ctx)->verify=(func))
   1.226 +
   1.227 +/* This is the functions plus an instance of the local variables. */
   1.228 +struct x509_lookup_st
   1.229 +	{
   1.230 +	int init;			/* have we been started */
   1.231 +	int skip;			/* don't use us. */
   1.232 +	X509_LOOKUP_METHOD *method;	/* the functions */
   1.233 +	char *method_data;		/* method data */
   1.234 +
   1.235 +	X509_STORE *store_ctx;	/* who owns us */
   1.236 +	} /* X509_LOOKUP */;
   1.237 +
   1.238 +/* This is a used when verifying cert chains.  Since the
   1.239 + * gathering of the cert chain can take some time (and have to be
   1.240 + * 'retried', this needs to be kept and passed around. */
   1.241 +struct x509_store_ctx_st      /* X509_STORE_CTX */
   1.242 +	{
   1.243 +	X509_STORE *ctx;
   1.244 +	int current_method;	/* used when looking up certs */
   1.245 +
   1.246 +	/* The following are set by the caller */
   1.247 +	X509 *cert;		/* The cert to check */
   1.248 +	STACK_OF(X509) *untrusted;	/* chain of X509s - untrusted - passed in */
   1.249 +	STACK_OF(X509_CRL) *crls;	/* set of CRLs passed in */
   1.250 +
   1.251 +	X509_VERIFY_PARAM *param;
   1.252 +	void *other_ctx;	/* Other info for use with get_issuer() */
   1.253 +
   1.254 +	/* Callbacks for various operations */
   1.255 +	int (*verify)(X509_STORE_CTX *ctx);	/* called to verify a certificate */
   1.256 +	int (*verify_cb)(int ok,X509_STORE_CTX *ctx);		/* error callback */
   1.257 +	int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);	/* get issuers cert from ctx */
   1.258 +	int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
   1.259 +	int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
   1.260 +	int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
   1.261 +	int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
   1.262 +	int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
   1.263 +	int (*check_policy)(X509_STORE_CTX *ctx);
   1.264 +	int (*cleanup)(X509_STORE_CTX *ctx);
   1.265 +
   1.266 +	/* The following is built up */
   1.267 +	int valid;		/* if 0, rebuild chain */
   1.268 +	int last_untrusted;	/* index of last untrusted cert */
   1.269 +	STACK_OF(X509) *chain; 		/* chain of X509s - built up and trusted */
   1.270 +	X509_POLICY_TREE *tree;	/* Valid policy tree */
   1.271 +
   1.272 +	int explicit_policy;	/* Require explicit policy value */
   1.273 +
   1.274 +	/* When something goes wrong, this is why */
   1.275 +	int error_depth;
   1.276 +	int error;
   1.277 +	X509 *current_cert;
   1.278 +	X509 *current_issuer;	/* cert currently being tested as valid issuer */
   1.279 +	X509_CRL *current_crl;	/* current CRL */
   1.280 +
   1.281 +	CRYPTO_EX_DATA ex_data;
   1.282 +	} /* X509_STORE_CTX */;
   1.283 +
   1.284 +IMPORT_C void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
   1.285 +
   1.286 +#define X509_STORE_CTX_set_app_data(ctx,data) \
   1.287 +	X509_STORE_CTX_set_ex_data(ctx,0,data)
   1.288 +#define X509_STORE_CTX_get_app_data(ctx) \
   1.289 +	X509_STORE_CTX_get_ex_data(ctx,0)
   1.290 +
   1.291 +#define X509_L_FILE_LOAD	1
   1.292 +#define X509_L_ADD_DIR		2
   1.293 +
   1.294 +#define X509_LOOKUP_load_file(x,name,type) \
   1.295 +		X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
   1.296 +
   1.297 +#define X509_LOOKUP_add_dir(x,name,type) \
   1.298 +		X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
   1.299 +
   1.300 +#define		X509_V_OK					0
   1.301 +/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */
   1.302 +
   1.303 +#define		X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT		2
   1.304 +#define		X509_V_ERR_UNABLE_TO_GET_CRL			3
   1.305 +#define		X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE	4
   1.306 +#define		X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE	5
   1.307 +#define		X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY	6
   1.308 +#define		X509_V_ERR_CERT_SIGNATURE_FAILURE		7
   1.309 +#define		X509_V_ERR_CRL_SIGNATURE_FAILURE		8
   1.310 +#define		X509_V_ERR_CERT_NOT_YET_VALID			9
   1.311 +#define		X509_V_ERR_CERT_HAS_EXPIRED			10
   1.312 +#define		X509_V_ERR_CRL_NOT_YET_VALID			11
   1.313 +#define		X509_V_ERR_CRL_HAS_EXPIRED			12
   1.314 +#define		X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD	13
   1.315 +#define		X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD	14
   1.316 +#define		X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD	15
   1.317 +#define		X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD	16
   1.318 +#define		X509_V_ERR_OUT_OF_MEM				17
   1.319 +#define		X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT		18
   1.320 +#define		X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN		19
   1.321 +#define		X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY	20
   1.322 +#define		X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE	21
   1.323 +#define		X509_V_ERR_CERT_CHAIN_TOO_LONG			22
   1.324 +#define		X509_V_ERR_CERT_REVOKED				23
   1.325 +#define		X509_V_ERR_INVALID_CA				24
   1.326 +#define		X509_V_ERR_PATH_LENGTH_EXCEEDED			25
   1.327 +#define		X509_V_ERR_INVALID_PURPOSE			26
   1.328 +#define		X509_V_ERR_CERT_UNTRUSTED			27
   1.329 +#define		X509_V_ERR_CERT_REJECTED			28
   1.330 +/* These are 'informational' when looking for issuer cert */
   1.331 +#define		X509_V_ERR_SUBJECT_ISSUER_MISMATCH		29
   1.332 +#define		X509_V_ERR_AKID_SKID_MISMATCH			30
   1.333 +#define		X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH		31
   1.334 +#define		X509_V_ERR_KEYUSAGE_NO_CERTSIGN			32
   1.335 +
   1.336 +#define		X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER		33
   1.337 +#define		X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION		34
   1.338 +#define		X509_V_ERR_KEYUSAGE_NO_CRL_SIGN			35
   1.339 +#define		X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION	36
   1.340 +#define		X509_V_ERR_INVALID_NON_CA			37
   1.341 +#define		X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED		38
   1.342 +#define		X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE	39
   1.343 +#define		X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED	40
   1.344 +
   1.345 +#define		X509_V_ERR_INVALID_EXTENSION			41
   1.346 +#define		X509_V_ERR_INVALID_POLICY_EXTENSION		42
   1.347 +#define		X509_V_ERR_NO_EXPLICIT_POLICY			43
   1.348 +
   1.349 +#define		X509_V_ERR_UNNESTED_RESOURCE			44
   1.350 +
   1.351 +/* The application is not happy */
   1.352 +#define		X509_V_ERR_APPLICATION_VERIFICATION		50
   1.353 +
   1.354 +/* Certificate verify flags */
   1.355 +
   1.356 +/* Send issuer+subject checks to verify_cb */
   1.357 +#define	X509_V_FLAG_CB_ISSUER_CHECK		0x1
   1.358 +/* Use check time instead of current time */
   1.359 +#define	X509_V_FLAG_USE_CHECK_TIME		0x2
   1.360 +/* Lookup CRLs */
   1.361 +#define	X509_V_FLAG_CRL_CHECK			0x4
   1.362 +/* Lookup CRLs for whole chain */
   1.363 +#define	X509_V_FLAG_CRL_CHECK_ALL		0x8
   1.364 +/* Ignore unhandled critical extensions */
   1.365 +#define	X509_V_FLAG_IGNORE_CRITICAL		0x10
   1.366 +/* Disable workarounds for broken certificates */
   1.367 +#define	X509_V_FLAG_X509_STRICT			0x20
   1.368 +/* Enable proxy certificate validation */
   1.369 +#define	X509_V_FLAG_ALLOW_PROXY_CERTS		0x40
   1.370 +/* Enable policy checking */
   1.371 +#define X509_V_FLAG_POLICY_CHECK		0x80
   1.372 +/* Policy variable require-explicit-policy */
   1.373 +#define X509_V_FLAG_EXPLICIT_POLICY		0x100
   1.374 +/* Policy variable inhibit-any-policy */
   1.375 +#define	X509_V_FLAG_INHIBIT_ANY			0x200
   1.376 +/* Policy variable inhibit-policy-mapping */
   1.377 +#define X509_V_FLAG_INHIBIT_MAP			0x400
   1.378 +/* Notify callback that policy is OK */
   1.379 +#define X509_V_FLAG_NOTIFY_POLICY		0x800
   1.380 +
   1.381 +#define X509_VP_FLAG_DEFAULT			0x1
   1.382 +#define X509_VP_FLAG_OVERWRITE			0x2
   1.383 +#define X509_VP_FLAG_RESET_FLAGS		0x4
   1.384 +#define X509_VP_FLAG_LOCKED			0x8
   1.385 +#define X509_VP_FLAG_ONCE			0x10
   1.386 +
   1.387 +/* Internal use: mask of policy related options */
   1.388 +#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
   1.389 +				| X509_V_FLAG_EXPLICIT_POLICY \
   1.390 +				| X509_V_FLAG_INHIBIT_ANY \
   1.391 +				| X509_V_FLAG_INHIBIT_MAP)
   1.392 +
   1.393 +IMPORT_C int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
   1.394 +	     X509_NAME *name);
   1.395 +IMPORT_C X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name);
   1.396 +IMPORT_C X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x);
   1.397 +IMPORT_C void X509_OBJECT_up_ref_count(X509_OBJECT *a);
   1.398 +IMPORT_C void X509_OBJECT_free_contents(X509_OBJECT *a);
   1.399 +IMPORT_C X509_STORE *X509_STORE_new(void );
   1.400 +IMPORT_C void X509_STORE_free(X509_STORE *v);
   1.401 +
   1.402 +IMPORT_C int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);
   1.403 +IMPORT_C int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
   1.404 +IMPORT_C int X509_STORE_set_trust(X509_STORE *ctx, int trust);
   1.405 +IMPORT_C int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm);
   1.406 +
   1.407 +IMPORT_C X509_STORE_CTX *X509_STORE_CTX_new(void);
   1.408 +
   1.409 +IMPORT_C int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
   1.410 +
   1.411 +IMPORT_C void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
   1.412 +IMPORT_C int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
   1.413 +			 X509 *x509, STACK_OF(X509) *chain);
   1.414 +IMPORT_C void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
   1.415 +IMPORT_C void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
   1.416 +
   1.417 +IMPORT_C X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
   1.418 +
   1.419 +IMPORT_C X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
   1.420 +IMPORT_C X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
   1.421 +
   1.422 +IMPORT_C int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
   1.423 +IMPORT_C int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
   1.424 +
   1.425 +IMPORT_C int X509_STORE_get_by_subject(X509_STORE_CTX *vs,int type,X509_NAME *name,
   1.426 +	X509_OBJECT *ret);
   1.427 +
   1.428 +IMPORT_C int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
   1.429 +	long argl, char **ret);
   1.430 +
   1.431 +#ifndef OPENSSL_NO_STDIO
   1.432 +IMPORT_C int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
   1.433 +IMPORT_C int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
   1.434 +IMPORT_C int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
   1.435 +#endif
   1.436 +
   1.437 +
   1.438 +IMPORT_C X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
   1.439 +IMPORT_C void X509_LOOKUP_free(X509_LOOKUP *ctx);
   1.440 +IMPORT_C int X509_LOOKUP_init(X509_LOOKUP *ctx);
   1.441 +IMPORT_C int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
   1.442 +	X509_OBJECT *ret);
   1.443 +IMPORT_C int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,
   1.444 +	ASN1_INTEGER *serial, X509_OBJECT *ret);
   1.445 +IMPORT_C int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type,
   1.446 +	unsigned char *bytes, int len, X509_OBJECT *ret);
   1.447 +IMPORT_C int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str,
   1.448 +	int len, X509_OBJECT *ret);
   1.449 +IMPORT_C int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
   1.450 +
   1.451 +#ifndef OPENSSL_NO_STDIO
   1.452 +IMPORT_C int	X509_STORE_load_locations (X509_STORE *ctx,
   1.453 +		const char *file, const char *dir);
   1.454 +IMPORT_C int	X509_STORE_set_default_paths(X509_STORE *ctx);
   1.455 +#endif
   1.456 +
   1.457 +IMPORT_C int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
   1.458 +	CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
   1.459 +IMPORT_C int	X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,int idx,void *data);
   1.460 +IMPORT_C void *	X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx);
   1.461 +IMPORT_C int	X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
   1.462 +IMPORT_C void	X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s);
   1.463 +IMPORT_C int	X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
   1.464 +IMPORT_C X509 *	X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
   1.465 +IMPORT_C STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
   1.466 +IMPORT_C STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx);
   1.467 +IMPORT_C void	X509_STORE_CTX_set_cert(X509_STORE_CTX *c,X509 *x);
   1.468 +IMPORT_C void	X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk);
   1.469 +IMPORT_C void	X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk);
   1.470 +IMPORT_C int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
   1.471 +IMPORT_C int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
   1.472 +IMPORT_C int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
   1.473 +				int purpose, int trust);
   1.474 +IMPORT_C void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
   1.475 +IMPORT_C void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
   1.476 +								time_t t);
   1.477 +IMPORT_C void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
   1.478 +				  int (*verify_cb)(int, X509_STORE_CTX *));
   1.479 +  
   1.480 +IMPORT_C X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx);
   1.481 +IMPORT_C int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx);
   1.482 +
   1.483 +IMPORT_C X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);
   1.484 +IMPORT_C void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
   1.485 +IMPORT_C int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
   1.486 +
   1.487 +/* X509_VERIFY_PARAM functions */
   1.488 +
   1.489 +IMPORT_C X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
   1.490 +IMPORT_C void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
   1.491 +IMPORT_C int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
   1.492 +						const X509_VERIFY_PARAM *from);
   1.493 +IMPORT_C int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, 
   1.494 +						const X509_VERIFY_PARAM *from);
   1.495 +IMPORT_C int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
   1.496 +IMPORT_C int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags);
   1.497 +IMPORT_C int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
   1.498 +							unsigned long flags);
   1.499 +IMPORT_C unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
   1.500 +IMPORT_C int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
   1.501 +IMPORT_C int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
   1.502 +IMPORT_C void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
   1.503 +IMPORT_C void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
   1.504 +IMPORT_C int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
   1.505 +						ASN1_OBJECT *policy);
   1.506 +IMPORT_C int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, 
   1.507 +					STACK_OF(ASN1_OBJECT) *policies);
   1.508 +IMPORT_C int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
   1.509 +
   1.510 +IMPORT_C int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
   1.511 +IMPORT_C const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
   1.512 +IMPORT_C void X509_VERIFY_PARAM_table_cleanup(void);
   1.513 +
   1.514 +IMPORT_C int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
   1.515 +			STACK_OF(X509) *certs,
   1.516 +			STACK_OF(ASN1_OBJECT) *policy_oids,
   1.517 +			unsigned int flags);
   1.518 +
   1.519 +IMPORT_C void X509_policy_tree_free(X509_POLICY_TREE *tree);
   1.520 +
   1.521 +IMPORT_C int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
   1.522 +IMPORT_C X509_POLICY_LEVEL *
   1.523 +	X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, int i);
   1.524 +
   1.525 +IMPORT_C STACK_OF(X509_POLICY_NODE) *
   1.526 +	X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree);
   1.527 +
   1.528 +IMPORT_C STACK_OF(X509_POLICY_NODE) *
   1.529 +	X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree);
   1.530 +
   1.531 +IMPORT_C int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
   1.532 +
   1.533 +IMPORT_C X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i);
   1.534 +
   1.535 +IMPORT_C const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
   1.536 +
   1.537 +IMPORT_C STACK_OF(POLICYQUALINFO) *
   1.538 +	X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
   1.539 +IMPORT_C const X509_POLICY_NODE *
   1.540 +	X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
   1.541 +
   1.542 +#ifdef  __cplusplus
   1.543 +}
   1.544 +#endif
   1.545 +#endif
   1.546 +