williamr@2
|
1 |
/* x509v3.h */
|
williamr@2
|
2 |
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
|
williamr@2
|
3 |
* project 1999.
|
williamr@2
|
4 |
*/
|
williamr@2
|
5 |
/* ====================================================================
|
williamr@2
|
6 |
* Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
|
williamr@2
|
7 |
*
|
williamr@2
|
8 |
* Redistribution and use in source and binary forms, with or without
|
williamr@2
|
9 |
* modification, are permitted provided that the following conditions
|
williamr@2
|
10 |
* are met:
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* 1. Redistributions of source code must retain the above copyright
|
williamr@2
|
13 |
* notice, this list of conditions and the following disclaimer.
|
williamr@2
|
14 |
*
|
williamr@2
|
15 |
* 2. Redistributions in binary form must reproduce the above copyright
|
williamr@2
|
16 |
* notice, this list of conditions and the following disclaimer in
|
williamr@2
|
17 |
* the documentation and/or other materials provided with the
|
williamr@2
|
18 |
* distribution.
|
williamr@2
|
19 |
*
|
williamr@2
|
20 |
* 3. All advertising materials mentioning features or use of this
|
williamr@2
|
21 |
* software must display the following acknowledgment:
|
williamr@2
|
22 |
* "This product includes software developed by the OpenSSL Project
|
williamr@2
|
23 |
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
williamr@2
|
24 |
*
|
williamr@2
|
25 |
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
williamr@2
|
26 |
* endorse or promote products derived from this software without
|
williamr@2
|
27 |
* prior written permission. For written permission, please contact
|
williamr@2
|
28 |
* licensing@OpenSSL.org.
|
williamr@2
|
29 |
*
|
williamr@2
|
30 |
* 5. Products derived from this software may not be called "OpenSSL"
|
williamr@2
|
31 |
* nor may "OpenSSL" appear in their names without prior written
|
williamr@2
|
32 |
* permission of the OpenSSL Project.
|
williamr@2
|
33 |
*
|
williamr@2
|
34 |
* 6. Redistributions of any form whatsoever must retain the following
|
williamr@2
|
35 |
* acknowledgment:
|
williamr@2
|
36 |
* "This product includes software developed by the OpenSSL Project
|
williamr@2
|
37 |
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
williamr@2
|
38 |
*
|
williamr@2
|
39 |
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
williamr@2
|
40 |
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
williamr@2
|
41 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
williamr@2
|
42 |
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
williamr@2
|
43 |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
williamr@2
|
44 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
williamr@2
|
45 |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
williamr@2
|
46 |
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
williamr@2
|
47 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
williamr@2
|
48 |
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
williamr@2
|
49 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
williamr@2
|
50 |
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
williamr@2
|
51 |
* ====================================================================
|
williamr@2
|
52 |
*
|
williamr@2
|
53 |
* This product includes cryptographic software written by Eric Young
|
williamr@2
|
54 |
* (eay@cryptsoft.com). This product includes software written by Tim
|
williamr@2
|
55 |
* Hudson (tjh@cryptsoft.com).
|
williamr@2
|
56 |
*
|
williamr@2
|
57 |
*/
|
williamr@2
|
58 |
/*
|
williamr@2
|
59 |
© Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
|
williamr@2
|
62 |
#ifndef HEADER_X509V3_H
|
williamr@2
|
63 |
#define HEADER_X509V3_H
|
williamr@2
|
64 |
|
williamr@2
|
65 |
#if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
|
williamr@2
|
66 |
#define SYMBIAN
|
williamr@2
|
67 |
#endif
|
williamr@2
|
68 |
|
williamr@2
|
69 |
#ifdef SYMBIAN
|
williamr@2
|
70 |
#include <e32def.h>
|
williamr@2
|
71 |
#endif
|
williamr@2
|
72 |
#include <openssl/bio.h>
|
williamr@2
|
73 |
#include <openssl/x509.h>
|
williamr@2
|
74 |
#include <openssl/conf.h>
|
williamr@2
|
75 |
|
williamr@2
|
76 |
#ifdef __cplusplus
|
williamr@2
|
77 |
extern "C" {
|
williamr@2
|
78 |
#endif
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/* Forward reference */
|
williamr@2
|
81 |
struct v3_ext_method;
|
williamr@2
|
82 |
struct v3_ext_ctx;
|
williamr@2
|
83 |
|
williamr@2
|
84 |
/* Useful typedefs */
|
williamr@2
|
85 |
|
williamr@2
|
86 |
typedef void * (*X509V3_EXT_NEW)(void);
|
williamr@2
|
87 |
typedef void (*X509V3_EXT_FREE)(void *);
|
williamr@2
|
88 |
typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long);
|
williamr@2
|
89 |
typedef int (*X509V3_EXT_I2D)(void *, unsigned char **);
|
williamr@2
|
90 |
typedef STACK_OF(CONF_VALUE) * (*X509V3_EXT_I2V)(struct v3_ext_method *method, void *ext, STACK_OF(CONF_VALUE) *extlist);
|
williamr@2
|
91 |
typedef void * (*X509V3_EXT_V2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, STACK_OF(CONF_VALUE) *values);
|
williamr@2
|
92 |
typedef char * (*X509V3_EXT_I2S)(struct v3_ext_method *method, void *ext);
|
williamr@2
|
93 |
typedef void * (*X509V3_EXT_S2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str);
|
williamr@2
|
94 |
typedef int (*X509V3_EXT_I2R)(struct v3_ext_method *method, void *ext, BIO *out, int indent);
|
williamr@2
|
95 |
typedef void * (*X509V3_EXT_R2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str);
|
williamr@2
|
96 |
|
williamr@2
|
97 |
/* V3 extension structure */
|
williamr@2
|
98 |
|
williamr@2
|
99 |
struct v3_ext_method {
|
williamr@2
|
100 |
int ext_nid;
|
williamr@2
|
101 |
int ext_flags;
|
williamr@2
|
102 |
/* If this is set the following four fields are ignored */
|
williamr@2
|
103 |
ASN1_ITEM_EXP *it;
|
williamr@2
|
104 |
/* Old style ASN1 calls */
|
williamr@2
|
105 |
X509V3_EXT_NEW ext_new;
|
williamr@2
|
106 |
X509V3_EXT_FREE ext_free;
|
williamr@2
|
107 |
X509V3_EXT_D2I d2i;
|
williamr@2
|
108 |
X509V3_EXT_I2D i2d;
|
williamr@2
|
109 |
|
williamr@2
|
110 |
/* The following pair is used for string extensions */
|
williamr@2
|
111 |
X509V3_EXT_I2S i2s;
|
williamr@2
|
112 |
X509V3_EXT_S2I s2i;
|
williamr@2
|
113 |
|
williamr@2
|
114 |
/* The following pair is used for multi-valued extensions */
|
williamr@2
|
115 |
X509V3_EXT_I2V i2v;
|
williamr@2
|
116 |
X509V3_EXT_V2I v2i;
|
williamr@2
|
117 |
|
williamr@2
|
118 |
/* The following are used for raw extensions */
|
williamr@2
|
119 |
X509V3_EXT_I2R i2r;
|
williamr@2
|
120 |
X509V3_EXT_R2I r2i;
|
williamr@2
|
121 |
|
williamr@2
|
122 |
void *usr_data; /* Any extension specific data */
|
williamr@2
|
123 |
};
|
williamr@2
|
124 |
|
williamr@2
|
125 |
typedef struct X509V3_CONF_METHOD_st {
|
williamr@2
|
126 |
char * (*get_string)(void *db, char *section, char *value);
|
williamr@2
|
127 |
STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section);
|
williamr@2
|
128 |
void (*free_string)(void *db, char * string);
|
williamr@2
|
129 |
void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section);
|
williamr@2
|
130 |
} X509V3_CONF_METHOD;
|
williamr@2
|
131 |
|
williamr@2
|
132 |
/* Context specific info */
|
williamr@2
|
133 |
struct v3_ext_ctx {
|
williamr@2
|
134 |
#define CTX_TEST 0x1
|
williamr@2
|
135 |
int flags;
|
williamr@2
|
136 |
X509 *issuer_cert;
|
williamr@2
|
137 |
X509 *subject_cert;
|
williamr@2
|
138 |
X509_REQ *subject_req;
|
williamr@2
|
139 |
X509_CRL *crl;
|
williamr@2
|
140 |
X509V3_CONF_METHOD *db_meth;
|
williamr@2
|
141 |
void *db;
|
williamr@2
|
142 |
/* Maybe more here */
|
williamr@2
|
143 |
};
|
williamr@2
|
144 |
|
williamr@2
|
145 |
typedef struct v3_ext_method X509V3_EXT_METHOD;
|
williamr@2
|
146 |
|
williamr@2
|
147 |
DECLARE_STACK_OF(X509V3_EXT_METHOD)
|
williamr@2
|
148 |
|
williamr@2
|
149 |
/* ext_flags values */
|
williamr@2
|
150 |
#define X509V3_EXT_DYNAMIC 0x1
|
williamr@2
|
151 |
#define X509V3_EXT_CTX_DEP 0x2
|
williamr@2
|
152 |
#define X509V3_EXT_MULTILINE 0x4
|
williamr@2
|
153 |
|
williamr@2
|
154 |
typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
|
williamr@2
|
155 |
|
williamr@2
|
156 |
typedef struct BASIC_CONSTRAINTS_st {
|
williamr@2
|
157 |
int ca;
|
williamr@2
|
158 |
ASN1_INTEGER *pathlen;
|
williamr@2
|
159 |
} BASIC_CONSTRAINTS;
|
williamr@2
|
160 |
|
williamr@2
|
161 |
|
williamr@2
|
162 |
typedef struct PKEY_USAGE_PERIOD_st {
|
williamr@2
|
163 |
ASN1_GENERALIZEDTIME *notBefore;
|
williamr@2
|
164 |
ASN1_GENERALIZEDTIME *notAfter;
|
williamr@2
|
165 |
} PKEY_USAGE_PERIOD;
|
williamr@2
|
166 |
|
williamr@2
|
167 |
typedef struct otherName_st {
|
williamr@2
|
168 |
ASN1_OBJECT *type_id;
|
williamr@2
|
169 |
ASN1_TYPE *value;
|
williamr@2
|
170 |
} OTHERNAME;
|
williamr@2
|
171 |
|
williamr@2
|
172 |
typedef struct EDIPartyName_st {
|
williamr@2
|
173 |
ASN1_STRING *nameAssigner;
|
williamr@2
|
174 |
ASN1_STRING *partyName;
|
williamr@2
|
175 |
} EDIPARTYNAME;
|
williamr@2
|
176 |
|
williamr@2
|
177 |
typedef struct GENERAL_NAME_st {
|
williamr@2
|
178 |
|
williamr@2
|
179 |
#define GEN_OTHERNAME 0
|
williamr@2
|
180 |
#define GEN_EMAIL 1
|
williamr@2
|
181 |
#define GEN_DNS 2
|
williamr@2
|
182 |
#define GEN_X400 3
|
williamr@2
|
183 |
#define GEN_DIRNAME 4
|
williamr@2
|
184 |
#define GEN_EDIPARTY 5
|
williamr@2
|
185 |
#define GEN_URI 6
|
williamr@2
|
186 |
#define GEN_IPADD 7
|
williamr@2
|
187 |
#define GEN_RID 8
|
williamr@2
|
188 |
|
williamr@2
|
189 |
int type;
|
williamr@2
|
190 |
union {
|
williamr@2
|
191 |
char *ptr;
|
williamr@2
|
192 |
OTHERNAME *otherName; /* otherName */
|
williamr@2
|
193 |
ASN1_IA5STRING *rfc822Name;
|
williamr@2
|
194 |
ASN1_IA5STRING *dNSName;
|
williamr@2
|
195 |
ASN1_TYPE *x400Address;
|
williamr@2
|
196 |
X509_NAME *directoryName;
|
williamr@2
|
197 |
EDIPARTYNAME *ediPartyName;
|
williamr@2
|
198 |
ASN1_IA5STRING *uniformResourceIdentifier;
|
williamr@2
|
199 |
ASN1_OCTET_STRING *iPAddress;
|
williamr@2
|
200 |
ASN1_OBJECT *registeredID;
|
williamr@2
|
201 |
|
williamr@2
|
202 |
/* Old names */
|
williamr@2
|
203 |
ASN1_OCTET_STRING *ip; /* iPAddress */
|
williamr@2
|
204 |
X509_NAME *dirn; /* dirn */
|
williamr@2
|
205 |
ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */
|
williamr@2
|
206 |
ASN1_OBJECT *rid; /* registeredID */
|
williamr@2
|
207 |
ASN1_TYPE *other; /* x400Address */
|
williamr@2
|
208 |
} d;
|
williamr@2
|
209 |
} GENERAL_NAME;
|
williamr@2
|
210 |
|
williamr@2
|
211 |
typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
|
williamr@2
|
212 |
|
williamr@2
|
213 |
typedef struct ACCESS_DESCRIPTION_st {
|
williamr@2
|
214 |
ASN1_OBJECT *method;
|
williamr@2
|
215 |
GENERAL_NAME *location;
|
williamr@2
|
216 |
} ACCESS_DESCRIPTION;
|
williamr@2
|
217 |
|
williamr@2
|
218 |
typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
|
williamr@2
|
219 |
|
williamr@2
|
220 |
typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
|
williamr@2
|
221 |
|
williamr@2
|
222 |
DECLARE_STACK_OF(GENERAL_NAME)
|
williamr@2
|
223 |
DECLARE_ASN1_SET_OF(GENERAL_NAME)
|
williamr@2
|
224 |
|
williamr@2
|
225 |
DECLARE_STACK_OF(ACCESS_DESCRIPTION)
|
williamr@2
|
226 |
DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
|
williamr@2
|
227 |
|
williamr@2
|
228 |
typedef struct DIST_POINT_NAME_st {
|
williamr@2
|
229 |
int type;
|
williamr@2
|
230 |
union {
|
williamr@2
|
231 |
GENERAL_NAMES *fullname;
|
williamr@2
|
232 |
STACK_OF(X509_NAME_ENTRY) *relativename;
|
williamr@2
|
233 |
} name;
|
williamr@2
|
234 |
} DIST_POINT_NAME;
|
williamr@2
|
235 |
|
williamr@2
|
236 |
typedef struct DIST_POINT_st {
|
williamr@2
|
237 |
DIST_POINT_NAME *distpoint;
|
williamr@2
|
238 |
ASN1_BIT_STRING *reasons;
|
williamr@2
|
239 |
GENERAL_NAMES *CRLissuer;
|
williamr@2
|
240 |
} DIST_POINT;
|
williamr@2
|
241 |
|
williamr@2
|
242 |
typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
|
williamr@2
|
243 |
|
williamr@2
|
244 |
DECLARE_STACK_OF(DIST_POINT)
|
williamr@2
|
245 |
DECLARE_ASN1_SET_OF(DIST_POINT)
|
williamr@2
|
246 |
|
williamr@2
|
247 |
typedef struct AUTHORITY_KEYID_st {
|
williamr@2
|
248 |
ASN1_OCTET_STRING *keyid;
|
williamr@2
|
249 |
GENERAL_NAMES *issuer;
|
williamr@2
|
250 |
ASN1_INTEGER *serial;
|
williamr@2
|
251 |
} AUTHORITY_KEYID;
|
williamr@2
|
252 |
|
williamr@2
|
253 |
/* Strong extranet structures */
|
williamr@2
|
254 |
|
williamr@2
|
255 |
typedef struct SXNET_ID_st {
|
williamr@2
|
256 |
ASN1_INTEGER *zone;
|
williamr@2
|
257 |
ASN1_OCTET_STRING *user;
|
williamr@2
|
258 |
} SXNETID;
|
williamr@2
|
259 |
|
williamr@2
|
260 |
DECLARE_STACK_OF(SXNETID)
|
williamr@2
|
261 |
DECLARE_ASN1_SET_OF(SXNETID)
|
williamr@2
|
262 |
|
williamr@2
|
263 |
typedef struct SXNET_st {
|
williamr@2
|
264 |
ASN1_INTEGER *version;
|
williamr@2
|
265 |
STACK_OF(SXNETID) *ids;
|
williamr@2
|
266 |
} SXNET;
|
williamr@2
|
267 |
|
williamr@2
|
268 |
typedef struct NOTICEREF_st {
|
williamr@2
|
269 |
ASN1_STRING *organization;
|
williamr@2
|
270 |
STACK_OF(ASN1_INTEGER) *noticenos;
|
williamr@2
|
271 |
} NOTICEREF;
|
williamr@2
|
272 |
|
williamr@2
|
273 |
typedef struct USERNOTICE_st {
|
williamr@2
|
274 |
NOTICEREF *noticeref;
|
williamr@2
|
275 |
ASN1_STRING *exptext;
|
williamr@2
|
276 |
} USERNOTICE;
|
williamr@2
|
277 |
|
williamr@2
|
278 |
typedef struct POLICYQUALINFO_st {
|
williamr@2
|
279 |
ASN1_OBJECT *pqualid;
|
williamr@2
|
280 |
union {
|
williamr@2
|
281 |
ASN1_IA5STRING *cpsuri;
|
williamr@2
|
282 |
USERNOTICE *usernotice;
|
williamr@2
|
283 |
ASN1_TYPE *other;
|
williamr@2
|
284 |
} d;
|
williamr@2
|
285 |
} POLICYQUALINFO;
|
williamr@2
|
286 |
|
williamr@2
|
287 |
DECLARE_STACK_OF(POLICYQUALINFO)
|
williamr@2
|
288 |
DECLARE_ASN1_SET_OF(POLICYQUALINFO)
|
williamr@2
|
289 |
|
williamr@2
|
290 |
typedef struct POLICYINFO_st {
|
williamr@2
|
291 |
ASN1_OBJECT *policyid;
|
williamr@2
|
292 |
STACK_OF(POLICYQUALINFO) *qualifiers;
|
williamr@2
|
293 |
} POLICYINFO;
|
williamr@2
|
294 |
|
williamr@2
|
295 |
typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
|
williamr@2
|
296 |
|
williamr@2
|
297 |
DECLARE_STACK_OF(POLICYINFO)
|
williamr@2
|
298 |
DECLARE_ASN1_SET_OF(POLICYINFO)
|
williamr@2
|
299 |
|
williamr@2
|
300 |
typedef struct POLICY_MAPPING_st {
|
williamr@2
|
301 |
ASN1_OBJECT *issuerDomainPolicy;
|
williamr@2
|
302 |
ASN1_OBJECT *subjectDomainPolicy;
|
williamr@2
|
303 |
} POLICY_MAPPING;
|
williamr@2
|
304 |
|
williamr@2
|
305 |
DECLARE_STACK_OF(POLICY_MAPPING)
|
williamr@2
|
306 |
|
williamr@2
|
307 |
typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
|
williamr@2
|
308 |
|
williamr@2
|
309 |
typedef struct GENERAL_SUBTREE_st {
|
williamr@2
|
310 |
GENERAL_NAME *base;
|
williamr@2
|
311 |
ASN1_INTEGER *minimum;
|
williamr@2
|
312 |
ASN1_INTEGER *maximum;
|
williamr@2
|
313 |
} GENERAL_SUBTREE;
|
williamr@2
|
314 |
|
williamr@2
|
315 |
DECLARE_STACK_OF(GENERAL_SUBTREE)
|
williamr@2
|
316 |
|
williamr@2
|
317 |
typedef struct NAME_CONSTRAINTS_st {
|
williamr@2
|
318 |
STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
|
williamr@2
|
319 |
STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
|
williamr@2
|
320 |
} NAME_CONSTRAINTS;
|
williamr@2
|
321 |
|
williamr@2
|
322 |
typedef struct POLICY_CONSTRAINTS_st {
|
williamr@2
|
323 |
ASN1_INTEGER *requireExplicitPolicy;
|
williamr@2
|
324 |
ASN1_INTEGER *inhibitPolicyMapping;
|
williamr@2
|
325 |
} POLICY_CONSTRAINTS;
|
williamr@2
|
326 |
|
williamr@2
|
327 |
/* Proxy certificate structures, see RFC 3820 */
|
williamr@2
|
328 |
typedef struct PROXY_POLICY_st
|
williamr@2
|
329 |
{
|
williamr@2
|
330 |
ASN1_OBJECT *policyLanguage;
|
williamr@2
|
331 |
ASN1_OCTET_STRING *policy;
|
williamr@2
|
332 |
} PROXY_POLICY;
|
williamr@2
|
333 |
|
williamr@2
|
334 |
typedef struct PROXY_CERT_INFO_EXTENSION_st
|
williamr@2
|
335 |
{
|
williamr@2
|
336 |
ASN1_INTEGER *pcPathLengthConstraint;
|
williamr@2
|
337 |
PROXY_POLICY *proxyPolicy;
|
williamr@2
|
338 |
} PROXY_CERT_INFO_EXTENSION;
|
williamr@2
|
339 |
|
williamr@2
|
340 |
DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
|
williamr@2
|
341 |
DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
|
williamr@2
|
342 |
|
williamr@2
|
343 |
|
williamr@2
|
344 |
#define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \
|
williamr@2
|
345 |
",name:", val->name, ",value:", val->value);
|
williamr@2
|
346 |
|
williamr@2
|
347 |
#define X509V3_set_ctx_test(ctx) \
|
williamr@2
|
348 |
X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
|
williamr@2
|
349 |
#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
|
williamr@2
|
350 |
|
williamr@2
|
351 |
#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
|
williamr@2
|
352 |
0,0,0,0, \
|
williamr@2
|
353 |
0,0, \
|
williamr@2
|
354 |
(X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
|
williamr@2
|
355 |
(X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
|
williamr@2
|
356 |
NULL, NULL, \
|
williamr@2
|
357 |
table}
|
williamr@2
|
358 |
|
williamr@2
|
359 |
#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
|
williamr@2
|
360 |
0,0,0,0, \
|
williamr@2
|
361 |
(X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
|
williamr@2
|
362 |
(X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
|
williamr@2
|
363 |
0,0,0,0, \
|
williamr@2
|
364 |
NULL}
|
williamr@2
|
365 |
|
williamr@2
|
366 |
#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
williamr@2
|
367 |
|
williamr@2
|
368 |
|
williamr@2
|
369 |
/* X509_PURPOSE stuff */
|
williamr@2
|
370 |
|
williamr@2
|
371 |
#define EXFLAG_BCONS 0x1
|
williamr@2
|
372 |
#define EXFLAG_KUSAGE 0x2
|
williamr@2
|
373 |
#define EXFLAG_XKUSAGE 0x4
|
williamr@2
|
374 |
#define EXFLAG_NSCERT 0x8
|
williamr@2
|
375 |
|
williamr@2
|
376 |
#define EXFLAG_CA 0x10
|
williamr@2
|
377 |
#define EXFLAG_SS 0x20
|
williamr@2
|
378 |
#define EXFLAG_V1 0x40
|
williamr@2
|
379 |
#define EXFLAG_INVALID 0x80
|
williamr@2
|
380 |
#define EXFLAG_SET 0x100
|
williamr@2
|
381 |
#define EXFLAG_CRITICAL 0x200
|
williamr@2
|
382 |
#define EXFLAG_PROXY 0x400
|
williamr@2
|
383 |
|
williamr@2
|
384 |
#define EXFLAG_INVALID_POLICY 0x400
|
williamr@2
|
385 |
|
williamr@2
|
386 |
#define KU_DIGITAL_SIGNATURE 0x0080
|
williamr@2
|
387 |
#define KU_NON_REPUDIATION 0x0040
|
williamr@2
|
388 |
#define KU_KEY_ENCIPHERMENT 0x0020
|
williamr@2
|
389 |
#define KU_DATA_ENCIPHERMENT 0x0010
|
williamr@2
|
390 |
#define KU_KEY_AGREEMENT 0x0008
|
williamr@2
|
391 |
#define KU_KEY_CERT_SIGN 0x0004
|
williamr@2
|
392 |
#define KU_CRL_SIGN 0x0002
|
williamr@2
|
393 |
#define KU_ENCIPHER_ONLY 0x0001
|
williamr@2
|
394 |
#define KU_DECIPHER_ONLY 0x8000
|
williamr@2
|
395 |
|
williamr@2
|
396 |
#define NS_SSL_CLIENT 0x80
|
williamr@2
|
397 |
#define NS_SSL_SERVER 0x40
|
williamr@2
|
398 |
#define NS_SMIME 0x20
|
williamr@2
|
399 |
#define NS_OBJSIGN 0x10
|
williamr@2
|
400 |
#define NS_SSL_CA 0x04
|
williamr@2
|
401 |
#define NS_SMIME_CA 0x02
|
williamr@2
|
402 |
#define NS_OBJSIGN_CA 0x01
|
williamr@2
|
403 |
#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
|
williamr@2
|
404 |
|
williamr@2
|
405 |
#define XKU_SSL_SERVER 0x1
|
williamr@2
|
406 |
#define XKU_SSL_CLIENT 0x2
|
williamr@2
|
407 |
#define XKU_SMIME 0x4
|
williamr@2
|
408 |
#define XKU_CODE_SIGN 0x8
|
williamr@2
|
409 |
#define XKU_SGC 0x10
|
williamr@2
|
410 |
#define XKU_OCSP_SIGN 0x20
|
williamr@2
|
411 |
#define XKU_TIMESTAMP 0x40
|
williamr@2
|
412 |
#define XKU_DVCS 0x80
|
williamr@2
|
413 |
|
williamr@2
|
414 |
#define X509_PURPOSE_DYNAMIC 0x1
|
williamr@2
|
415 |
#define X509_PURPOSE_DYNAMIC_NAME 0x2
|
williamr@2
|
416 |
|
williamr@2
|
417 |
typedef struct x509_purpose_st {
|
williamr@2
|
418 |
int purpose;
|
williamr@2
|
419 |
int trust; /* Default trust ID */
|
williamr@2
|
420 |
int flags;
|
williamr@2
|
421 |
int (*check_purpose)(const struct x509_purpose_st *,
|
williamr@2
|
422 |
const X509 *, int);
|
williamr@2
|
423 |
char *name;
|
williamr@2
|
424 |
char *sname;
|
williamr@2
|
425 |
void *usr_data;
|
williamr@2
|
426 |
} X509_PURPOSE;
|
williamr@2
|
427 |
|
williamr@2
|
428 |
#define X509_PURPOSE_SSL_CLIENT 1
|
williamr@2
|
429 |
#define X509_PURPOSE_SSL_SERVER 2
|
williamr@2
|
430 |
#define X509_PURPOSE_NS_SSL_SERVER 3
|
williamr@2
|
431 |
#define X509_PURPOSE_SMIME_SIGN 4
|
williamr@2
|
432 |
#define X509_PURPOSE_SMIME_ENCRYPT 5
|
williamr@2
|
433 |
#define X509_PURPOSE_CRL_SIGN 6
|
williamr@2
|
434 |
#define X509_PURPOSE_ANY 7
|
williamr@2
|
435 |
#define X509_PURPOSE_OCSP_HELPER 8
|
williamr@2
|
436 |
|
williamr@2
|
437 |
#define X509_PURPOSE_MIN 1
|
williamr@2
|
438 |
#define X509_PURPOSE_MAX 8
|
williamr@2
|
439 |
|
williamr@2
|
440 |
/* Flags for X509V3_EXT_print() */
|
williamr@2
|
441 |
|
williamr@2
|
442 |
#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
|
williamr@2
|
443 |
/* Return error for unknown extensions */
|
williamr@2
|
444 |
#define X509V3_EXT_DEFAULT 0
|
williamr@2
|
445 |
/* Print error for unknown extensions */
|
williamr@2
|
446 |
#define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
|
williamr@2
|
447 |
/* ASN1 parse unknown extensions */
|
williamr@2
|
448 |
#define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
|
williamr@2
|
449 |
/* BIO_dump unknown extensions */
|
williamr@2
|
450 |
#define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
|
williamr@2
|
451 |
|
williamr@2
|
452 |
/* Flags for X509V3_add1_i2d */
|
williamr@2
|
453 |
|
williamr@2
|
454 |
#define X509V3_ADD_OP_MASK 0xfL
|
williamr@2
|
455 |
#define X509V3_ADD_DEFAULT 0L
|
williamr@2
|
456 |
#define X509V3_ADD_APPEND 1L
|
williamr@2
|
457 |
#define X509V3_ADD_REPLACE 2L
|
williamr@2
|
458 |
#define X509V3_ADD_REPLACE_EXISTING 3L
|
williamr@2
|
459 |
#define X509V3_ADD_KEEP_EXISTING 4L
|
williamr@2
|
460 |
#define X509V3_ADD_DELETE 5L
|
williamr@2
|
461 |
#define X509V3_ADD_SILENT 0x10
|
williamr@2
|
462 |
|
williamr@2
|
463 |
DECLARE_STACK_OF(X509_PURPOSE)
|
williamr@2
|
464 |
|
williamr@2
|
465 |
DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
|
williamr@2
|
466 |
|
williamr@2
|
467 |
DECLARE_ASN1_FUNCTIONS(SXNET)
|
williamr@2
|
468 |
DECLARE_ASN1_FUNCTIONS(SXNETID)
|
williamr@2
|
469 |
|
williamr@2
|
470 |
IMPORT_C int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
|
williamr@2
|
471 |
IMPORT_C int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen);
|
williamr@2
|
472 |
IMPORT_C int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen);
|
williamr@2
|
473 |
|
williamr@2
|
474 |
IMPORT_C ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);
|
williamr@2
|
475 |
IMPORT_C ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
|
williamr@2
|
476 |
IMPORT_C ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);
|
williamr@2
|
477 |
|
williamr@2
|
478 |
DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)
|
williamr@2
|
479 |
|
williamr@2
|
480 |
DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
|
williamr@2
|
481 |
|
williamr@2
|
482 |
DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
|
williamr@2
|
483 |
|
williamr@2
|
484 |
|
williamr@2
|
485 |
IMPORT_C ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
|
williamr@2
|
486 |
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
|
williamr@2
|
487 |
IMPORT_C STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
|
williamr@2
|
488 |
ASN1_BIT_STRING *bits,
|
williamr@2
|
489 |
STACK_OF(CONF_VALUE) *extlist);
|
williamr@2
|
490 |
|
williamr@2
|
491 |
IMPORT_C STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret);
|
williamr@2
|
492 |
IMPORT_C int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
|
williamr@2
|
493 |
|
williamr@2
|
494 |
DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
|
williamr@2
|
495 |
|
williamr@2
|
496 |
IMPORT_C STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
|
williamr@2
|
497 |
GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist);
|
williamr@2
|
498 |
GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
|
williamr@2
|
499 |
X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
|
williamr@2
|
500 |
|
williamr@2
|
501 |
DECLARE_ASN1_FUNCTIONS(OTHERNAME)
|
williamr@2
|
502 |
DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
|
williamr@2
|
503 |
|
williamr@2
|
504 |
IMPORT_C char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5);
|
williamr@2
|
505 |
ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
|
williamr@2
|
506 |
|
williamr@2
|
507 |
DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
|
williamr@2
|
508 |
IMPORT_C int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a);
|
williamr@2
|
509 |
|
williamr@2
|
510 |
DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
|
williamr@2
|
511 |
DECLARE_ASN1_FUNCTIONS(POLICYINFO)
|
williamr@2
|
512 |
DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO)
|
williamr@2
|
513 |
DECLARE_ASN1_FUNCTIONS(USERNOTICE)
|
williamr@2
|
514 |
DECLARE_ASN1_FUNCTIONS(NOTICEREF)
|
williamr@2
|
515 |
|
williamr@2
|
516 |
DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)
|
williamr@2
|
517 |
DECLARE_ASN1_FUNCTIONS(DIST_POINT)
|
williamr@2
|
518 |
DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)
|
williamr@2
|
519 |
|
williamr@2
|
520 |
DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
|
williamr@2
|
521 |
DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
|
williamr@2
|
522 |
|
williamr@2
|
523 |
DECLARE_ASN1_ITEM(POLICY_MAPPING)
|
williamr@2
|
524 |
DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)
|
williamr@2
|
525 |
DECLARE_ASN1_ITEM(POLICY_MAPPINGS)
|
williamr@2
|
526 |
|
williamr@2
|
527 |
DECLARE_ASN1_ITEM(GENERAL_SUBTREE)
|
williamr@2
|
528 |
DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)
|
williamr@2
|
529 |
|
williamr@2
|
530 |
DECLARE_ASN1_ITEM(NAME_CONSTRAINTS)
|
williamr@2
|
531 |
DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
|
williamr@2
|
532 |
|
williamr@2
|
533 |
DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
|
williamr@2
|
534 |
DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
|
williamr@2
|
535 |
|
williamr@2
|
536 |
#ifdef HEADER_CONF_H
|
williamr@2
|
537 |
IMPORT_C GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
williamr@2
|
538 |
CONF_VALUE *cnf);
|
williamr@2
|
539 |
IMPORT_C GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_EXT_METHOD *method,
|
williamr@2
|
540 |
X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc);
|
williamr@2
|
541 |
IMPORT_C void X509V3_conf_free(CONF_VALUE *val);
|
williamr@2
|
542 |
|
williamr@2
|
543 |
IMPORT_C X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value);
|
williamr@2
|
544 |
IMPORT_C X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value);
|
williamr@2
|
545 |
IMPORT_C int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk);
|
williamr@2
|
546 |
IMPORT_C int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert);
|
williamr@2
|
547 |
IMPORT_C int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req);
|
williamr@2
|
548 |
IMPORT_C int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
|
williamr@2
|
549 |
|
williamr@2
|
550 |
IMPORT_C X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value);
|
williamr@2
|
551 |
IMPORT_C X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value);
|
williamr@2
|
552 |
IMPORT_C int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert);
|
williamr@2
|
553 |
IMPORT_C int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req);
|
williamr@2
|
554 |
IMPORT_C int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
|
williamr@2
|
555 |
|
williamr@2
|
556 |
IMPORT_C int X509V3_add_value_bool_nf(char *name, int asn1_bool,
|
williamr@2
|
557 |
STACK_OF(CONF_VALUE) **extlist);
|
williamr@2
|
558 |
IMPORT_C int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
|
williamr@2
|
559 |
IMPORT_C int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
|
williamr@2
|
560 |
IMPORT_C void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
|
williamr@2
|
561 |
IMPORT_C void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash);
|
williamr@2
|
562 |
#endif
|
williamr@2
|
563 |
|
williamr@2
|
564 |
IMPORT_C char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section);
|
williamr@2
|
565 |
IMPORT_C STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section);
|
williamr@2
|
566 |
IMPORT_C void X509V3_string_free(X509V3_CTX *ctx, char *str);
|
williamr@2
|
567 |
IMPORT_C void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section);
|
williamr@2
|
568 |
IMPORT_C void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
|
williamr@2
|
569 |
X509_REQ *req, X509_CRL *crl, int flags);
|
williamr@2
|
570 |
|
williamr@2
|
571 |
IMPORT_C int X509V3_add_value(const char *name, const char *value,
|
williamr@2
|
572 |
STACK_OF(CONF_VALUE) **extlist);
|
williamr@2
|
573 |
IMPORT_C int X509V3_add_value_uchar(const char *name, const unsigned char *value,
|
williamr@2
|
574 |
STACK_OF(CONF_VALUE) **extlist);
|
williamr@2
|
575 |
IMPORT_C int X509V3_add_value_bool(const char *name, int asn1_bool,
|
williamr@2
|
576 |
STACK_OF(CONF_VALUE) **extlist);
|
williamr@2
|
577 |
IMPORT_C int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
|
williamr@2
|
578 |
STACK_OF(CONF_VALUE) **extlist);
|
williamr@2
|
579 |
IMPORT_C char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
|
williamr@2
|
580 |
IMPORT_C ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value);
|
williamr@2
|
581 |
IMPORT_C char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
|
williamr@2
|
582 |
IMPORT_C char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
|
williamr@2
|
583 |
IMPORT_C int X509V3_EXT_add(X509V3_EXT_METHOD *ext);
|
williamr@2
|
584 |
IMPORT_C int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);
|
williamr@2
|
585 |
IMPORT_C int X509V3_EXT_add_alias(int nid_to, int nid_from);
|
williamr@2
|
586 |
IMPORT_C void X509V3_EXT_cleanup(void);
|
williamr@2
|
587 |
|
williamr@2
|
588 |
IMPORT_C X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
|
williamr@2
|
589 |
IMPORT_C X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
|
williamr@2
|
590 |
IMPORT_C int X509V3_add_standard_extensions(void);
|
williamr@2
|
591 |
IMPORT_C STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
|
williamr@2
|
592 |
IMPORT_C void *X509V3_EXT_d2i(X509_EXTENSION *ext);
|
williamr@2
|
593 |
IMPORT_C void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx);
|
williamr@2
|
594 |
|
williamr@2
|
595 |
|
williamr@2
|
596 |
IMPORT_C X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
|
williamr@2
|
597 |
IMPORT_C int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags);
|
williamr@2
|
598 |
|
williamr@2
|
599 |
IMPORT_C char *hex_to_string(unsigned char *buffer, long len);
|
williamr@2
|
600 |
IMPORT_C unsigned char *string_to_hex(char *str, long *len);
|
williamr@2
|
601 |
IMPORT_C int name_cmp(const char *name, const char *cmp);
|
williamr@2
|
602 |
|
williamr@2
|
603 |
IMPORT_C void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
|
williamr@2
|
604 |
int ml);
|
williamr@2
|
605 |
IMPORT_C int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
|
williamr@2
|
606 |
IMPORT_C int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
|
williamr@2
|
607 |
|
williamr@2
|
608 |
IMPORT_C int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent);
|
williamr@2
|
609 |
|
williamr@2
|
610 |
IMPORT_C int X509_check_ca(X509 *x);
|
williamr@2
|
611 |
IMPORT_C int X509_check_purpose(X509 *x, int id, int ca);
|
williamr@2
|
612 |
IMPORT_C int X509_supported_extension(X509_EXTENSION *ex);
|
williamr@2
|
613 |
IMPORT_C int X509_PURPOSE_set(int *p, int purpose);
|
williamr@2
|
614 |
IMPORT_C int X509_check_issued(X509 *issuer, X509 *subject);
|
williamr@2
|
615 |
IMPORT_C int X509_PURPOSE_get_count(void);
|
williamr@2
|
616 |
IMPORT_C X509_PURPOSE * X509_PURPOSE_get0(int idx);
|
williamr@2
|
617 |
IMPORT_C int X509_PURPOSE_get_by_sname(char *sname);
|
williamr@2
|
618 |
IMPORT_C int X509_PURPOSE_get_by_id(int id);
|
williamr@2
|
619 |
IMPORT_C int X509_PURPOSE_add(int id, int trust, int flags,
|
williamr@2
|
620 |
int (*ck)(const X509_PURPOSE *, const X509 *, int),
|
williamr@2
|
621 |
char *name, char *sname, void *arg);
|
williamr@2
|
622 |
IMPORT_C char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
|
williamr@2
|
623 |
IMPORT_C char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
|
williamr@2
|
624 |
IMPORT_C int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
|
williamr@2
|
625 |
IMPORT_C void X509_PURPOSE_cleanup(void);
|
williamr@2
|
626 |
IMPORT_C int X509_PURPOSE_get_id(X509_PURPOSE *);
|
williamr@2
|
627 |
|
williamr@2
|
628 |
IMPORT_C STACK *X509_get1_email(X509 *x);
|
williamr@2
|
629 |
IMPORT_C STACK *X509_REQ_get1_email(X509_REQ *x);
|
williamr@2
|
630 |
IMPORT_C void X509_email_free(STACK *sk);
|
williamr@2
|
631 |
|
williamr@2
|
632 |
IMPORT_C ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
|
williamr@2
|
633 |
IMPORT_C ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
|
williamr@2
|
634 |
IMPORT_C int a2i_ipadd(unsigned char *ipout, const char *ipasc);
|
williamr@2
|
635 |
IMPORT_C int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
|
williamr@2
|
636 |
unsigned long chtype);
|
williamr@2
|
637 |
|
williamr@2
|
638 |
IMPORT_C void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
|
williamr@2
|
639 |
|
williamr@2
|
640 |
|
williamr@2
|
641 |
/* BEGIN ERROR CODES */
|
williamr@2
|
642 |
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
williamr@2
|
643 |
* made after this point may be overwritten when the script is next run.
|
williamr@2
|
644 |
*/
|
williamr@2
|
645 |
IMPORT_C void ERR_load_X509V3_strings(void);
|
williamr@2
|
646 |
|
williamr@2
|
647 |
/* Error codes for the X509V3 functions. */
|
williamr@2
|
648 |
|
williamr@2
|
649 |
/* Function codes. */
|
williamr@2
|
650 |
#define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 156
|
williamr@2
|
651 |
#define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 157
|
williamr@2
|
652 |
#define X509V3_F_COPY_EMAIL 122
|
williamr@2
|
653 |
#define X509V3_F_COPY_ISSUER 123
|
williamr@2
|
654 |
#define X509V3_F_DO_DIRNAME 144
|
williamr@2
|
655 |
#define X509V3_F_DO_EXT_CONF 124
|
williamr@2
|
656 |
#define X509V3_F_DO_EXT_I2D 135
|
williamr@2
|
657 |
#define X509V3_F_DO_EXT_NCONF 151
|
williamr@2
|
658 |
#define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148
|
williamr@2
|
659 |
#define X509V3_F_HEX_TO_STRING 111
|
williamr@2
|
660 |
#define X509V3_F_I2S_ASN1_ENUMERATED 121
|
williamr@2
|
661 |
#define X509V3_F_I2S_ASN1_IA5STRING 149
|
williamr@2
|
662 |
#define X509V3_F_I2S_ASN1_INTEGER 120
|
williamr@2
|
663 |
#define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138
|
williamr@2
|
664 |
#define X509V3_F_NOTICE_SECTION 132
|
williamr@2
|
665 |
#define X509V3_F_NREF_NOS 133
|
williamr@2
|
666 |
#define X509V3_F_POLICY_SECTION 131
|
williamr@2
|
667 |
#define X509V3_F_PROCESS_PCI_VALUE 150
|
williamr@2
|
668 |
#define X509V3_F_R2I_CERTPOL 130
|
williamr@2
|
669 |
#define X509V3_F_R2I_PCI 155
|
williamr@2
|
670 |
#define X509V3_F_S2I_ASN1_IA5STRING 100
|
williamr@2
|
671 |
#define X509V3_F_S2I_ASN1_INTEGER 108
|
williamr@2
|
672 |
#define X509V3_F_S2I_ASN1_OCTET_STRING 112
|
williamr@2
|
673 |
#define X509V3_F_S2I_ASN1_SKEY_ID 114
|
williamr@2
|
674 |
#define X509V3_F_S2I_SKEY_ID 115
|
williamr@2
|
675 |
#define X509V3_F_STRING_TO_HEX 113
|
williamr@2
|
676 |
#define X509V3_F_SXNET_ADD_ID_ASC 125
|
williamr@2
|
677 |
#define X509V3_F_SXNET_ADD_ID_INTEGER 126
|
williamr@2
|
678 |
#define X509V3_F_SXNET_ADD_ID_ULONG 127
|
williamr@2
|
679 |
#define X509V3_F_SXNET_GET_ID_ASC 128
|
williamr@2
|
680 |
#define X509V3_F_SXNET_GET_ID_ULONG 129
|
williamr@2
|
681 |
#define X509V3_F_V2I_ASIDENTIFIERS 158
|
williamr@2
|
682 |
#define X509V3_F_V2I_ASN1_BIT_STRING 101
|
williamr@2
|
683 |
#define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139
|
williamr@2
|
684 |
#define X509V3_F_V2I_AUTHORITY_KEYID 119
|
williamr@2
|
685 |
#define X509V3_F_V2I_BASIC_CONSTRAINTS 102
|
williamr@2
|
686 |
#define X509V3_F_V2I_CRLD 134
|
williamr@2
|
687 |
#define X509V3_F_V2I_EXTENDED_KEY_USAGE 103
|
williamr@2
|
688 |
#define X509V3_F_V2I_GENERAL_NAMES 118
|
williamr@2
|
689 |
#define X509V3_F_V2I_GENERAL_NAME_EX 117
|
williamr@2
|
690 |
#define X509V3_F_V2I_IPADDRBLOCKS 159
|
williamr@2
|
691 |
#define X509V3_F_V2I_ISSUER_ALT 153
|
williamr@2
|
692 |
#define X509V3_F_V2I_NAME_CONSTRAINTS 147
|
williamr@2
|
693 |
#define X509V3_F_V2I_POLICY_CONSTRAINTS 146
|
williamr@2
|
694 |
#define X509V3_F_V2I_POLICY_MAPPINGS 145
|
williamr@2
|
695 |
#define X509V3_F_V2I_SUBJECT_ALT 154
|
williamr@2
|
696 |
#define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160
|
williamr@2
|
697 |
#define X509V3_F_V3_GENERIC_EXTENSION 116
|
williamr@2
|
698 |
#define X509V3_F_X509V3_ADD1_I2D 140
|
williamr@2
|
699 |
#define X509V3_F_X509V3_ADD_VALUE 105
|
williamr@2
|
700 |
#define X509V3_F_X509V3_EXT_ADD 104
|
williamr@2
|
701 |
#define X509V3_F_X509V3_EXT_ADD_ALIAS 106
|
williamr@2
|
702 |
#define X509V3_F_X509V3_EXT_CONF 107
|
williamr@2
|
703 |
#define X509V3_F_X509V3_EXT_I2D 136
|
williamr@2
|
704 |
#define X509V3_F_X509V3_EXT_NCONF 152
|
williamr@2
|
705 |
#define X509V3_F_X509V3_GET_SECTION 142
|
williamr@2
|
706 |
#define X509V3_F_X509V3_GET_STRING 143
|
williamr@2
|
707 |
#define X509V3_F_X509V3_GET_VALUE_BOOL 110
|
williamr@2
|
708 |
#define X509V3_F_X509V3_PARSE_LIST 109
|
williamr@2
|
709 |
#define X509V3_F_X509_PURPOSE_ADD 137
|
williamr@2
|
710 |
#define X509V3_F_X509_PURPOSE_SET 141
|
williamr@2
|
711 |
|
williamr@2
|
712 |
/* Reason codes. */
|
williamr@2
|
713 |
#define X509V3_R_BAD_IP_ADDRESS 118
|
williamr@2
|
714 |
#define X509V3_R_BAD_OBJECT 119
|
williamr@2
|
715 |
#define X509V3_R_BN_DEC2BN_ERROR 100
|
williamr@2
|
716 |
#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
|
williamr@2
|
717 |
#define X509V3_R_DIRNAME_ERROR 149
|
williamr@2
|
718 |
#define X509V3_R_DUPLICATE_ZONE_ID 133
|
williamr@2
|
719 |
#define X509V3_R_ERROR_CONVERTING_ZONE 131
|
williamr@2
|
720 |
#define X509V3_R_ERROR_CREATING_EXTENSION 144
|
williamr@2
|
721 |
#define X509V3_R_ERROR_IN_EXTENSION 128
|
williamr@2
|
722 |
#define X509V3_R_EXPECTED_A_SECTION_NAME 137
|
williamr@2
|
723 |
#define X509V3_R_EXTENSION_EXISTS 145
|
williamr@2
|
724 |
#define X509V3_R_EXTENSION_NAME_ERROR 115
|
williamr@2
|
725 |
#define X509V3_R_EXTENSION_NOT_FOUND 102
|
williamr@2
|
726 |
#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
|
williamr@2
|
727 |
#define X509V3_R_EXTENSION_VALUE_ERROR 116
|
williamr@2
|
728 |
#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
|
williamr@2
|
729 |
#define X509V3_R_ILLEGAL_HEX_DIGIT 113
|
williamr@2
|
730 |
#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
|
williamr@2
|
731 |
#define X509V3_R_INVALID_ASNUMBER 160
|
williamr@2
|
732 |
#define X509V3_R_INVALID_ASRANGE 161
|
williamr@2
|
733 |
#define X509V3_R_INVALID_BOOLEAN_STRING 104
|
williamr@2
|
734 |
#define X509V3_R_INVALID_EXTENSION_STRING 105
|
williamr@2
|
735 |
#define X509V3_R_INVALID_INHERITANCE 162
|
williamr@2
|
736 |
#define X509V3_R_INVALID_IPADDRESS 163
|
williamr@2
|
737 |
#define X509V3_R_INVALID_NAME 106
|
williamr@2
|
738 |
#define X509V3_R_INVALID_NULL_ARGUMENT 107
|
williamr@2
|
739 |
#define X509V3_R_INVALID_NULL_NAME 108
|
williamr@2
|
740 |
#define X509V3_R_INVALID_NULL_VALUE 109
|
williamr@2
|
741 |
#define X509V3_R_INVALID_NUMBER 140
|
williamr@2
|
742 |
#define X509V3_R_INVALID_NUMBERS 141
|
williamr@2
|
743 |
#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
|
williamr@2
|
744 |
#define X509V3_R_INVALID_OPTION 138
|
williamr@2
|
745 |
#define X509V3_R_INVALID_POLICY_IDENTIFIER 134
|
williamr@2
|
746 |
#define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
|
williamr@2
|
747 |
#define X509V3_R_INVALID_PURPOSE 146
|
williamr@2
|
748 |
#define X509V3_R_INVALID_SAFI 164
|
williamr@2
|
749 |
#define X509V3_R_INVALID_SECTION 135
|
williamr@2
|
750 |
#define X509V3_R_INVALID_SYNTAX 143
|
williamr@2
|
751 |
#define X509V3_R_ISSUER_DECODE_ERROR 126
|
williamr@2
|
752 |
#define X509V3_R_MISSING_VALUE 124
|
williamr@2
|
753 |
#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
|
williamr@2
|
754 |
#define X509V3_R_NO_CONFIG_DATABASE 136
|
williamr@2
|
755 |
#define X509V3_R_NO_ISSUER_CERTIFICATE 121
|
williamr@2
|
756 |
#define X509V3_R_NO_ISSUER_DETAILS 127
|
williamr@2
|
757 |
#define X509V3_R_NO_POLICY_IDENTIFIER 139
|
williamr@2
|
758 |
#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
|
williamr@2
|
759 |
#define X509V3_R_NO_PUBLIC_KEY 114
|
williamr@2
|
760 |
#define X509V3_R_NO_SUBJECT_DETAILS 125
|
williamr@2
|
761 |
#define X509V3_R_ODD_NUMBER_OF_DIGITS 112
|
williamr@2
|
762 |
#define X509V3_R_OPERATION_NOT_DEFINED 148
|
williamr@2
|
763 |
#define X509V3_R_OTHERNAME_ERROR 147
|
williamr@2
|
764 |
#define X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED 155
|
williamr@2
|
765 |
#define X509V3_R_POLICY_PATH_LENGTH 156
|
williamr@2
|
766 |
#define X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED 157
|
williamr@2
|
767 |
#define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158
|
williamr@2
|
768 |
#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
|
williamr@2
|
769 |
#define X509V3_R_SECTION_NOT_FOUND 150
|
williamr@2
|
770 |
#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
|
williamr@2
|
771 |
#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
|
williamr@2
|
772 |
#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
|
williamr@2
|
773 |
#define X509V3_R_UNKNOWN_EXTENSION 129
|
williamr@2
|
774 |
#define X509V3_R_UNKNOWN_EXTENSION_NAME 130
|
williamr@2
|
775 |
#define X509V3_R_UNKNOWN_OPTION 120
|
williamr@2
|
776 |
#define X509V3_R_UNSUPPORTED_OPTION 117
|
williamr@2
|
777 |
#define X509V3_R_USER_TOO_LONG 132
|
williamr@2
|
778 |
|
williamr@2
|
779 |
#ifdef __cplusplus
|
williamr@2
|
780 |
}
|
williamr@2
|
781 |
#endif
|
williamr@2
|
782 |
#endif
|