diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/x509/x509.h | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/x509/x509.h')
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 627 |
1 files changed, 232 insertions, 395 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 95114f7c43..35f9484f8b 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -63,28 +63,34 @@ | |||
63 | extern "C" { | 63 | extern "C" { |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #include "stack.h" | 66 | #ifdef VMS |
67 | #include "asn1.h" | 67 | #undef X509_REVOKED_get_ext_by_critical |
68 | #define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic | ||
69 | #endif | ||
70 | |||
71 | #include <openssl/stack.h> | ||
72 | #include <openssl/asn1.h> | ||
73 | #include <openssl/safestack.h> | ||
68 | 74 | ||
69 | #ifndef NO_RSA | 75 | #ifndef NO_RSA |
70 | #include "rsa.h" | 76 | #include <openssl/rsa.h> |
71 | #else | ||
72 | #define RSA long | ||
73 | #endif | 77 | #endif |
74 | 78 | ||
75 | #ifndef NO_DSA | 79 | #ifndef NO_DSA |
76 | #include "dsa.h" | 80 | #include <openssl/dsa.h> |
77 | #else | ||
78 | #define DSA long | ||
79 | #endif | 81 | #endif |
80 | 82 | ||
81 | #ifndef NO_DH | 83 | #ifndef NO_DH |
82 | #include "dh.h" | 84 | #include <openssl/dh.h> |
83 | #else | ||
84 | #define DH long | ||
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #include "evp.h" | 87 | #include <openssl/evp.h> |
88 | |||
89 | |||
90 | #ifdef WIN32 | ||
91 | /* Under Win32 this is defined in wincrypt.h */ | ||
92 | #undef X509_NAME | ||
93 | #endif | ||
88 | 94 | ||
89 | #define X509_FILETYPE_PEM 1 | 95 | #define X509_FILETYPE_PEM 1 |
90 | #define X509_FILETYPE_ASN1 2 | 96 | #define X509_FILETYPE_ASN1 2 |
@@ -114,6 +120,9 @@ typedef struct X509_algor_st | |||
114 | ASN1_TYPE *parameter; | 120 | ASN1_TYPE *parameter; |
115 | } X509_ALGOR; | 121 | } X509_ALGOR; |
116 | 122 | ||
123 | DECLARE_STACK_OF(X509_ALGOR) | ||
124 | DECLARE_ASN1_SET_OF(X509_ALGOR) | ||
125 | |||
117 | typedef struct X509_val_st | 126 | typedef struct X509_val_st |
118 | { | 127 | { |
119 | ASN1_UTCTIME *notBefore; | 128 | ASN1_UTCTIME *notBefore; |
@@ -124,7 +133,7 @@ typedef struct X509_pubkey_st | |||
124 | { | 133 | { |
125 | X509_ALGOR *algor; | 134 | X509_ALGOR *algor; |
126 | ASN1_BIT_STRING *public_key; | 135 | ASN1_BIT_STRING *public_key; |
127 | struct evp_pkey_st /* EVP_PKEY*/ *pkey; | 136 | EVP_PKEY *pkey; |
128 | } X509_PUBKEY; | 137 | } X509_PUBKEY; |
129 | 138 | ||
130 | typedef struct X509_sig_st | 139 | typedef struct X509_sig_st |
@@ -141,10 +150,13 @@ typedef struct X509_name_entry_st | |||
141 | int size; /* temp variable */ | 150 | int size; /* temp variable */ |
142 | } X509_NAME_ENTRY; | 151 | } X509_NAME_ENTRY; |
143 | 152 | ||
153 | DECLARE_STACK_OF(X509_NAME_ENTRY) | ||
154 | DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) | ||
155 | |||
144 | /* we always keep X509_NAMEs in 2 forms. */ | 156 | /* we always keep X509_NAMEs in 2 forms. */ |
145 | typedef struct X509_name_st | 157 | typedef struct X509_name_st |
146 | { | 158 | { |
147 | STACK *entries; /* of X509_NAME_ENTRY */ | 159 | STACK_OF(X509_NAME_ENTRY) *entries; |
148 | int modified; /* true if 'bytes' needs to be built */ | 160 | int modified; /* true if 'bytes' needs to be built */ |
149 | #ifdef HEADER_BUFFER_H | 161 | #ifdef HEADER_BUFFER_H |
150 | BUF_MEM *bytes; | 162 | BUF_MEM *bytes; |
@@ -154,6 +166,8 @@ typedef struct X509_name_st | |||
154 | unsigned long hash; /* Keep the hash around for lookups */ | 166 | unsigned long hash; /* Keep the hash around for lookups */ |
155 | } X509_NAME; | 167 | } X509_NAME; |
156 | 168 | ||
169 | DECLARE_STACK_OF(X509_NAME) | ||
170 | |||
157 | #define X509_EX_V_NETSCAPE_HACK 0x8000 | 171 | #define X509_EX_V_NETSCAPE_HACK 0x8000 |
158 | #define X509_EX_V_INIT 0x0001 | 172 | #define X509_EX_V_INIT 0x0001 |
159 | typedef struct X509_extension_st | 173 | typedef struct X509_extension_st |
@@ -167,23 +181,23 @@ typedef struct X509_extension_st | |||
167 | void (*ex_free)(); /* clear argp stuff */ | 181 | void (*ex_free)(); /* clear argp stuff */ |
168 | } X509_EXTENSION; | 182 | } X509_EXTENSION; |
169 | 183 | ||
170 | /* #if 1 */ | 184 | DECLARE_STACK_OF(X509_EXTENSION) |
171 | typedef struct x509_extension_method_st | 185 | DECLARE_ASN1_SET_OF(X509_EXTENSION) |
186 | |||
187 | /* a sequence of these are used */ | ||
188 | typedef struct x509_attributes_st | ||
172 | { | 189 | { |
173 | int nid; | 190 | ASN1_OBJECT *object; |
174 | int data_type; | 191 | int set; /* 1 for a set, 0 for a single item (which is wrong) */ |
175 | int pack_type; | 192 | union { |
176 | void (*ex_clear)(); | 193 | char *ptr; |
177 | int (*ex_get_bool)(); | 194 | /* 1 */ STACK_OF(ASN1_TYPE) *set; |
178 | int (*ex_set_bool)(); | 195 | /* 0 */ ASN1_TYPE *single; |
179 | int (*ex_get_str)(); | 196 | } value; |
180 | int (*ex_set_str)(); | 197 | } X509_ATTRIBUTE; |
181 | char *(*ex_get_struct)(); | 198 | |
182 | int (*ex_set_struct)(); | 199 | DECLARE_STACK_OF(X509_ATTRIBUTE) |
183 | int (*a2i)(); | 200 | DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) |
184 | int (*i2a)(); | ||
185 | } X509_EXTENSION_METHOD; | ||
186 | /* #endif */ | ||
187 | 201 | ||
188 | typedef struct X509_req_info_st | 202 | typedef struct X509_req_info_st |
189 | { | 203 | { |
@@ -191,7 +205,7 @@ typedef struct X509_req_info_st | |||
191 | X509_NAME *subject; | 205 | X509_NAME *subject; |
192 | X509_PUBKEY *pubkey; | 206 | X509_PUBKEY *pubkey; |
193 | /* d=2 hl=2 l= 0 cons: cont: 00 */ | 207 | /* d=2 hl=2 l= 0 cons: cont: 00 */ |
194 | STACK /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */ | 208 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
195 | int req_kludge; | 209 | int req_kludge; |
196 | } X509_REQ_INFO; | 210 | } X509_REQ_INFO; |
197 | 211 | ||
@@ -214,7 +228,7 @@ typedef struct x509_cinf_st | |||
214 | X509_PUBKEY *key; | 228 | X509_PUBKEY *key; |
215 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ | 229 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ |
216 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ | 230 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ |
217 | STACK /* X509_EXTENSION */ *extensions; /* [ 3 ] optional in v3 */ | 231 | STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ |
218 | } X509_CINF; | 232 | } X509_CINF; |
219 | 233 | ||
220 | typedef struct x509_st | 234 | typedef struct x509_st |
@@ -227,14 +241,20 @@ typedef struct x509_st | |||
227 | char *name; | 241 | char *name; |
228 | } X509; | 242 | } X509; |
229 | 243 | ||
244 | DECLARE_STACK_OF(X509) | ||
245 | DECLARE_ASN1_SET_OF(X509) | ||
246 | |||
230 | typedef struct X509_revoked_st | 247 | typedef struct X509_revoked_st |
231 | { | 248 | { |
232 | ASN1_INTEGER *serialNumber; | 249 | ASN1_INTEGER *serialNumber; |
233 | ASN1_UTCTIME *revocationDate; | 250 | ASN1_UTCTIME *revocationDate; |
234 | STACK /* optional X509_EXTENSION */ *extensions; | 251 | STACK_OF(X509_EXTENSION) /* optional */ *extensions; |
235 | int sequence; /* load sequence */ | 252 | int sequence; /* load sequence */ |
236 | } X509_REVOKED; | 253 | } X509_REVOKED; |
237 | 254 | ||
255 | DECLARE_STACK_OF(X509_REVOKED) | ||
256 | DECLARE_ASN1_SET_OF(X509_REVOKED) | ||
257 | |||
238 | typedef struct X509_crl_info_st | 258 | typedef struct X509_crl_info_st |
239 | { | 259 | { |
240 | ASN1_INTEGER *version; | 260 | ASN1_INTEGER *version; |
@@ -242,8 +262,8 @@ typedef struct X509_crl_info_st | |||
242 | X509_NAME *issuer; | 262 | X509_NAME *issuer; |
243 | ASN1_UTCTIME *lastUpdate; | 263 | ASN1_UTCTIME *lastUpdate; |
244 | ASN1_UTCTIME *nextUpdate; | 264 | ASN1_UTCTIME *nextUpdate; |
245 | STACK /* X509_REVOKED */ *revoked; | 265 | STACK_OF(X509_REVOKED) *revoked; |
246 | STACK /* [0] X509_EXTENSION */ *extensions; | 266 | STACK_OF(X509_EXTENSION) /* [0] */ *extensions; |
247 | } X509_CRL_INFO; | 267 | } X509_CRL_INFO; |
248 | 268 | ||
249 | typedef struct X509_crl_st | 269 | typedef struct X509_crl_st |
@@ -255,17 +275,8 @@ typedef struct X509_crl_st | |||
255 | int references; | 275 | int references; |
256 | } X509_CRL; | 276 | } X509_CRL; |
257 | 277 | ||
258 | /* a sequence of these are used */ | 278 | DECLARE_STACK_OF(X509_CRL) |
259 | typedef struct x509_attributes_st | 279 | DECLARE_ASN1_SET_OF(X509_CRL) |
260 | { | ||
261 | ASN1_OBJECT *object; | ||
262 | int set; /* 1 for a set, 0 for a single item (which is wrong) */ | ||
263 | union { | ||
264 | char *ptr; | ||
265 | /* 1 */ STACK /* ASN1_TYPE */ *set; | ||
266 | /* 0 */ ASN1_TYPE *single; | ||
267 | } value; | ||
268 | } X509_ATTRIBUTE; | ||
269 | 280 | ||
270 | typedef struct private_key_st | 281 | typedef struct private_key_st |
271 | { | 282 | { |
@@ -301,6 +312,8 @@ typedef struct X509_info_st | |||
301 | 312 | ||
302 | int references; | 313 | int references; |
303 | } X509_INFO; | 314 | } X509_INFO; |
315 | |||
316 | DECLARE_STACK_OF(X509_INFO) | ||
304 | #endif | 317 | #endif |
305 | 318 | ||
306 | /* The next 2 structures and their 8 routines were sent to me by | 319 | /* The next 2 structures and their 8 routines were sent to me by |
@@ -320,17 +333,55 @@ typedef struct Netscape_spki_st | |||
320 | ASN1_BIT_STRING *signature; | 333 | ASN1_BIT_STRING *signature; |
321 | } NETSCAPE_SPKI; | 334 | } NETSCAPE_SPKI; |
322 | 335 | ||
323 | #ifndef HEADER_BN_H | 336 | /* Netscape certificate sequence structure */ |
324 | #define BIGNUM char | 337 | typedef struct Netscape_certificate_sequence |
325 | #endif | 338 | { |
339 | ASN1_OBJECT *type; | ||
340 | STACK_OF(X509) *certs; | ||
341 | } NETSCAPE_CERT_SEQUENCE; | ||
326 | 342 | ||
327 | typedef struct CBCParameter_st | 343 | typedef struct CBCParameter_st |
328 | { | 344 | { |
329 | unsigned char iv[8]; | 345 | unsigned char iv[8]; |
330 | } CBC_PARAM; | 346 | } CBC_PARAM; |
331 | 347 | ||
332 | #include "x509_vfy.h" | 348 | /* Password based encryption structure */ |
333 | #include "pkcs7.h" | 349 | |
350 | typedef struct PBEPARAM_st { | ||
351 | ASN1_OCTET_STRING *salt; | ||
352 | ASN1_INTEGER *iter; | ||
353 | } PBEPARAM; | ||
354 | |||
355 | /* Password based encryption V2 structures */ | ||
356 | |||
357 | typedef struct PBE2PARAM_st { | ||
358 | X509_ALGOR *keyfunc; | ||
359 | X509_ALGOR *encryption; | ||
360 | } PBE2PARAM; | ||
361 | |||
362 | typedef struct PBKDF2PARAM_st { | ||
363 | ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */ | ||
364 | ASN1_INTEGER *iter; | ||
365 | ASN1_INTEGER *keylength; | ||
366 | X509_ALGOR *prf; | ||
367 | } PBKDF2PARAM; | ||
368 | |||
369 | |||
370 | /* PKCS#8 private key info structure */ | ||
371 | |||
372 | typedef struct pkcs8_priv_key_info_st | ||
373 | { | ||
374 | int broken; /* Flag for various broken formats */ | ||
375 | #define PKCS8_OK 0 | ||
376 | #define PKCS8_NO_OCTET 1 | ||
377 | ASN1_INTEGER *version; | ||
378 | X509_ALGOR *pkeyalg; | ||
379 | ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ | ||
380 | STACK_OF(X509_ATTRIBUTE) *attributes; | ||
381 | } PKCS8_PRIV_KEY_INFO; | ||
382 | |||
383 | #include <openssl/x509_vfy.h> | ||
384 | #include <openssl/pkcs7.h> | ||
334 | 385 | ||
335 | #ifdef SSLEAY_MACROS | 386 | #ifdef SSLEAY_MACROS |
336 | #define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ | 387 | #define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ |
@@ -355,6 +406,9 @@ typedef struct CBCParameter_st | |||
355 | 406 | ||
356 | #define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ | 407 | #define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ |
357 | (char *(*)())d2i_X509,(char *)x509) | 408 | (char *(*)())d2i_X509,(char *)x509) |
409 | #define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\ | ||
410 | (int (*)())i2d_X509_ATTRIBUTE, \ | ||
411 | (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa) | ||
358 | #define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ | 412 | #define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ |
359 | (int (*)())i2d_X509_EXTENSION, \ | 413 | (int (*)())i2d_X509_EXTENSION, \ |
360 | (char *(*)())d2i_X509_EXTENSION,(char *)ex) | 414 | (char *(*)())d2i_X509_EXTENSION,(char *)ex) |
@@ -442,6 +496,9 @@ typedef struct CBCParameter_st | |||
442 | #define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ | 496 | #define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ |
443 | (unsigned char *)dsa) | 497 | (unsigned char *)dsa) |
444 | 498 | ||
499 | #define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\ | ||
500 | (char *(*)())d2i_X509_ALGOR,(char *)xn) | ||
501 | |||
445 | #define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ | 502 | #define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ |
446 | (char *(*)())d2i_X509_NAME,(char *)xn) | 503 | (char *(*)())d2i_X509_NAME,(char *)xn) |
447 | #define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ | 504 | #define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ |
@@ -453,10 +510,12 @@ typedef struct CBCParameter_st | |||
453 | ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) | 510 | ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) |
454 | #define X509_NAME_digest(data,type,md,len) \ | 511 | #define X509_NAME_digest(data,type,md,len) \ |
455 | ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) | 512 | ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) |
513 | #ifndef PKCS7_ISSUER_AND_SERIAL_digest | ||
456 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ | 514 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ |
457 | ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ | 515 | ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ |
458 | (char *)data,md,len) | 516 | (char *)data,md,len) |
459 | #endif | 517 | #endif |
518 | #endif | ||
460 | 519 | ||
461 | #define X509_EXT_PACK_UNKNOWN 1 | 520 | #define X509_EXT_PACK_UNKNOWN 1 |
462 | #define X509_EXT_PACK_STRING 2 | 521 | #define X509_EXT_PACK_STRING 2 |
@@ -472,25 +531,31 @@ typedef struct CBCParameter_st | |||
472 | #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) | 531 | #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) |
473 | #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) | 532 | #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) |
474 | 533 | ||
534 | #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) | ||
535 | #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) | ||
536 | #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) | ||
537 | #define X509_CRL_get_issuer(x) ((x)->crl->issuer) | ||
538 | #define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) | ||
539 | |||
475 | /* This one is only used so that a binary form can output, as in | 540 | /* This one is only used so that a binary form can output, as in |
476 | * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ | 541 | * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ |
477 | #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) | 542 | #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) |
478 | 543 | ||
479 | #ifndef NOPROTO | 544 | |
545 | const char *X509_verify_cert_error_string(long n); | ||
480 | 546 | ||
481 | #ifndef SSLEAY_MACROS | 547 | #ifndef SSLEAY_MACROS |
482 | #ifdef HEADER_ENVELOPE_H | 548 | #ifdef HEADER_ENVELOPE_H |
483 | int X509_verify(X509 *a, EVP_PKEY *r); | 549 | int X509_verify(X509 *a, EVP_PKEY *r); |
484 | char *X509_verify_cert_error_string(long n); | ||
485 | 550 | ||
486 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); | 551 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); |
487 | int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); | 552 | int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); |
488 | int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); | 553 | int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); |
489 | 554 | ||
490 | int X509_sign(X509 *x, EVP_PKEY *pkey, EVP_MD *md); | 555 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
491 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, EVP_MD *md); | 556 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); |
492 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, EVP_MD *md); | 557 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); |
493 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, EVP_MD *md); | 558 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); |
494 | 559 | ||
495 | int X509_digest(X509 *data,EVP_MD *type,unsigned char *md,unsigned int *len); | 560 | int X509_digest(X509 *data,EVP_MD *type,unsigned char *md,unsigned int *len); |
496 | int X509_NAME_digest(X509_NAME *data,EVP_MD *type, | 561 | int X509_NAME_digest(X509_NAME *data,EVP_MD *type, |
@@ -498,55 +563,77 @@ int X509_NAME_digest(X509_NAME *data,EVP_MD *type, | |||
498 | #endif | 563 | #endif |
499 | 564 | ||
500 | #ifndef NO_FP_API | 565 | #ifndef NO_FP_API |
501 | X509 *d2i_X509_fp(FILE *fp, X509 *x509); | 566 | X509 *d2i_X509_fp(FILE *fp, X509 **x509); |
502 | int i2d_X509_fp(FILE *fp,X509 *x509); | 567 | int i2d_X509_fp(FILE *fp,X509 *x509); |
503 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL *crl); | 568 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); |
504 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); | 569 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); |
505 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ *req); | 570 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); |
506 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); | 571 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); |
507 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA *rsa); | 572 | #ifndef NO_RSA |
573 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); | ||
508 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); | 574 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); |
509 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | 575 | RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); |
510 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | ||
511 | RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA *rsa); | ||
512 | int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); | 576 | int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); |
513 | #endif | 577 | #endif |
578 | #ifndef NO_DSA | ||
579 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); | ||
580 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | ||
581 | X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); | ||
582 | int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); | ||
583 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, | ||
584 | PKCS8_PRIV_KEY_INFO **p8inf); | ||
585 | int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); | ||
586 | #endif | ||
587 | #endif | ||
514 | 588 | ||
515 | #ifdef HEADER_BIO_H | 589 | #ifdef HEADER_BIO_H |
516 | X509 *d2i_X509_bio(BIO *bp,X509 *x509); | 590 | X509 *d2i_X509_bio(BIO *bp,X509 **x509); |
517 | int i2d_X509_bio(BIO *bp,X509 *x509); | 591 | int i2d_X509_bio(BIO *bp,X509 *x509); |
518 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL *crl); | 592 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); |
519 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); | 593 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); |
520 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ *req); | 594 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); |
521 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); | 595 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); |
522 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA *rsa); | 596 | #ifndef NO_RSA |
597 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); | ||
523 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); | 598 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); |
524 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA *dsa); | 599 | RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); |
525 | int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); | ||
526 | RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA *rsa); | ||
527 | int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); | 600 | int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); |
528 | #endif | 601 | #endif |
602 | #ifndef NO_DSA | ||
603 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); | ||
604 | int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); | ||
605 | #endif | ||
606 | X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); | ||
607 | int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); | ||
608 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, | ||
609 | PKCS8_PRIV_KEY_INFO **p8inf); | ||
610 | int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); | ||
611 | #endif | ||
529 | 612 | ||
530 | X509 *X509_dup(X509 *x509); | 613 | X509 *X509_dup(X509 *x509); |
614 | X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); | ||
531 | X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); | 615 | X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); |
532 | X509_CRL *X509_CRL_dup(X509_CRL *crl); | 616 | X509_CRL *X509_CRL_dup(X509_CRL *crl); |
533 | X509_REQ *X509_REQ_dup(X509_REQ *req); | 617 | X509_REQ *X509_REQ_dup(X509_REQ *req); |
618 | X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); | ||
534 | X509_NAME *X509_NAME_dup(X509_NAME *xn); | 619 | X509_NAME *X509_NAME_dup(X509_NAME *xn); |
535 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); | 620 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); |
621 | #ifndef NO_RSA | ||
536 | RSA *RSAPublicKey_dup(RSA *rsa); | 622 | RSA *RSAPublicKey_dup(RSA *rsa); |
537 | RSA *RSAPrivateKey_dup(RSA *rsa); | 623 | RSA *RSAPrivateKey_dup(RSA *rsa); |
624 | #endif | ||
538 | 625 | ||
539 | #endif /* !SSLEAY_MACROS */ | 626 | #endif /* !SSLEAY_MACROS */ |
540 | 627 | ||
541 | int X509_cmp_current_time(ASN1_UTCTIME *s); | 628 | int X509_cmp_current_time(ASN1_UTCTIME *s); |
542 | ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj); | 629 | ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj); |
543 | 630 | ||
544 | char * X509_get_default_cert_area(void ); | 631 | const char * X509_get_default_cert_area(void ); |
545 | char * X509_get_default_cert_dir(void ); | 632 | const char * X509_get_default_cert_dir(void ); |
546 | char * X509_get_default_cert_file(void ); | 633 | const char * X509_get_default_cert_file(void ); |
547 | char * X509_get_default_cert_dir_env(void ); | 634 | const char * X509_get_default_cert_dir_env(void ); |
548 | char * X509_get_default_cert_file_env(void ); | 635 | const char * X509_get_default_cert_file_env(void ); |
549 | char * X509_get_default_private_dir(void ); | 636 | const char * X509_get_default_private_dir(void ); |
550 | 637 | ||
551 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md); | 638 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md); |
552 | X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); | 639 | X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); |
@@ -571,7 +658,8 @@ X509_PUBKEY * d2i_X509_PUBKEY(X509_PUBKEY **a,unsigned char **pp, | |||
571 | long length); | 658 | long length); |
572 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); | 659 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); |
573 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); | 660 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); |
574 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK *chain); | 661 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, |
662 | STACK_OF(X509) *chain); | ||
575 | 663 | ||
576 | 664 | ||
577 | X509_SIG * X509_SIG_new(void ); | 665 | X509_SIG * X509_SIG_new(void ); |
@@ -595,6 +683,8 @@ void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a); | |||
595 | int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp); | 683 | int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp); |
596 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp, | 684 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp, |
597 | long length); | 685 | long length); |
686 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); | ||
687 | |||
598 | 688 | ||
599 | X509_EXTENSION *X509_EXTENSION_new(void ); | 689 | X509_EXTENSION *X509_EXTENSION_new(void ); |
600 | void X509_EXTENSION_free(X509_EXTENSION *a); | 690 | void X509_EXTENSION_free(X509_EXTENSION *a); |
@@ -658,6 +748,12 @@ int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a,unsigned char **pp); | |||
658 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a,unsigned char **pp, | 748 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a,unsigned char **pp, |
659 | long length); | 749 | long length); |
660 | 750 | ||
751 | |||
752 | int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp); | ||
753 | NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void); | ||
754 | NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length); | ||
755 | void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a); | ||
756 | |||
661 | #ifdef HEADER_ENVELOPE_H | 757 | #ifdef HEADER_ENVELOPE_H |
662 | X509_INFO * X509_INFO_new(void); | 758 | X509_INFO * X509_INFO_new(void); |
663 | void X509_INFO_free(X509_INFO *a); | 759 | void X509_INFO_free(X509_INFO *a); |
@@ -671,7 +767,7 @@ int ASN1_digest(int (*i2d)(),EVP_MD *type,char *data, | |||
671 | 767 | ||
672 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | 768 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, |
673 | ASN1_BIT_STRING *signature, | 769 | ASN1_BIT_STRING *signature, |
674 | char *data,EVP_PKEY *pkey, EVP_MD *type); | 770 | char *data,EVP_PKEY *pkey, const EVP_MD *type); |
675 | #endif | 771 | #endif |
676 | 772 | ||
677 | int X509_set_version(X509 *x,long version); | 773 | int X509_set_version(X509 *x,long version); |
@@ -709,12 +805,14 @@ unsigned long X509_NAME_hash(X509_NAME *x); | |||
709 | int X509_CRL_cmp(X509_CRL *a,X509_CRL *b); | 805 | int X509_CRL_cmp(X509_CRL *a,X509_CRL *b); |
710 | #ifndef NO_FP_API | 806 | #ifndef NO_FP_API |
711 | int X509_print_fp(FILE *bp,X509 *x); | 807 | int X509_print_fp(FILE *bp,X509 *x); |
808 | int X509_CRL_print_fp(FILE *bp,X509_CRL *x); | ||
712 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); | 809 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); |
713 | #endif | 810 | #endif |
714 | 811 | ||
715 | #ifdef HEADER_BIO_H | 812 | #ifdef HEADER_BIO_H |
716 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); | 813 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); |
717 | int X509_print(BIO *bp,X509 *x); | 814 | int X509_print(BIO *bp,X509 *x); |
815 | int X509_CRL_print(BIO *bp,X509_CRL *x); | ||
718 | int X509_REQ_print(BIO *bp,X509_REQ *req); | 816 | int X509_REQ_print(BIO *bp,X509_REQ *req); |
719 | #endif | 817 | #endif |
720 | 818 | ||
@@ -745,18 +843,17 @@ int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, | |||
745 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); | 843 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); |
746 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); | 844 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); |
747 | 845 | ||
748 | int X509v3_get_ext_count(STACK *x); | 846 | int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); |
749 | int X509v3_get_ext_by_NID(STACK *x, int nid, int lastpos); | 847 | int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, |
750 | int X509v3_get_ext_by_OBJ(STACK *x,ASN1_OBJECT *obj,int lastpos); | 848 | int nid, int lastpos); |
751 | int X509v3_get_ext_by_critical(STACK *x, int crit, int lastpos); | 849 | int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, |
752 | X509_EXTENSION *X509v3_get_ext(STACK *x, int loc); | 850 | ASN1_OBJECT *obj,int lastpos); |
753 | X509_EXTENSION *X509v3_delete_ext(STACK *x, int loc); | 851 | int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, |
754 | STACK * X509v3_add_ext(STACK **x, X509_EXTENSION *ex, int loc); | 852 | int crit, int lastpos); |
755 | 853 | X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); | |
756 | int X509v3_data_type_by_OBJ(ASN1_OBJECT *obj); | 854 | X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); |
757 | int X509v3_data_type_by_NID(int nid); | 855 | STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, |
758 | int X509v3_pack_type_by_OBJ(ASN1_OBJECT *obj); | 856 | X509_EXTENSION *ex, int loc); |
759 | int X509v3_pack_type_by_NID(int nid); | ||
760 | 857 | ||
761 | int X509_get_ext_count(X509 *x); | 858 | int X509_get_ext_count(X509 *x); |
762 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); | 859 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); |
@@ -793,311 +890,49 @@ int X509_EXTENSION_set_data(X509_EXTENSION *ex, | |||
793 | ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); | 890 | ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); |
794 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); | 891 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); |
795 | int X509_EXTENSION_get_critical(X509_EXTENSION *ex); | 892 | int X509_EXTENSION_get_critical(X509_EXTENSION *ex); |
796 | ASN1_OCTET_STRING *X509v3_pack_string(ASN1_OCTET_STRING **ex,int type, | ||
797 | unsigned char *bytes, int len); | ||
798 | ASN1_STRING * X509v3_unpack_string(ASN1_STRING **ex,int type, | ||
799 | ASN1_OCTET_STRING *os); | ||
800 | 893 | ||
801 | int X509_verify_cert(X509_STORE_CTX *ctx); | 894 | int X509_verify_cert(X509_STORE_CTX *ctx); |
802 | 895 | ||
803 | /* lookup a cert from a X509 STACK */ | 896 | /* lookup a cert from a X509 STACK */ |
804 | X509 *X509_find_by_issuer_and_serial(STACK *sk,X509_NAME *name, | 897 | X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, |
805 | ASN1_INTEGER *serial); | 898 | ASN1_INTEGER *serial); |
806 | X509 *X509_find_by_subject(STACK *sk,X509_NAME *name); | 899 | X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); |
807 | 900 | ||
808 | #else | 901 | int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp); |
809 | 902 | PBEPARAM *PBEPARAM_new(void); | |
810 | #ifndef SSLEAY_MACROS | 903 | PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length); |
811 | #ifdef HEADER_ENVELOPE_H | 904 | void PBEPARAM_free(PBEPARAM *a); |
812 | int X509_verify(); | 905 | X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); |
813 | int X509_REQ_verify(); | 906 | X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, |
814 | int X509_CRL_verify(); | 907 | unsigned char *salt, int saltlen); |
815 | int NETSCAPE_SPKI_verify(); | 908 | |
816 | 909 | int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp); | |
817 | int X509_sign(); | 910 | PBKDF2PARAM *PBKDF2PARAM_new(void); |
818 | int X509_REQ_sign(); | 911 | PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp, long length); |
819 | int X509_CRL_sign(); | 912 | void PBKDF2PARAM_free(PBKDF2PARAM *a); |
820 | int NETSCAPE_SPKI_sign(); | 913 | |
821 | 914 | int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp); | |
822 | int X509_digest(); | 915 | PBE2PARAM *PBE2PARAM_new(void); |
823 | int X509_NAME_digest(); | 916 | PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length); |
824 | #endif | 917 | void PBE2PARAM_free(PBE2PARAM *a); |
825 | 918 | ||
826 | #ifndef NO_FP_API | 919 | /* PKCS#8 utilities */ |
827 | X509 *d2i_X509_fp(); | 920 | |
828 | int i2d_X509_fp(); | 921 | int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **pp); |
829 | X509_CRL *d2i_X509_CRL_fp(); | 922 | PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void); |
830 | int i2d_X509_CRL_fp(); | 923 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, |
831 | X509_REQ *d2i_X509_REQ_fp(); | 924 | unsigned char **pp, long length); |
832 | int i2d_X509_REQ_fp(); | 925 | void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a); |
833 | RSA *d2i_RSAPrivateKey_fp(); | 926 | |
834 | int i2d_RSAPrivateKey_fp(); | 927 | EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); |
835 | DSA *d2i_DSAPrivateKey_fp(); | 928 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); |
836 | int i2d_DSAPrivateKey_fp(); | 929 | PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); |
837 | RSA *d2i_RSAPublicKey_fp(); | ||
838 | int i2d_RSAPublicKey_fp(); | ||
839 | #endif | ||
840 | |||
841 | X509 *d2i_X509_bio(); | ||
842 | int i2d_X509_bio(); | ||
843 | X509_CRL *d2i_X509_CRL_bio(); | ||
844 | int i2d_X509_CRL_bio(); | ||
845 | X509_REQ *d2i_X509_REQ_bio(); | ||
846 | int i2d_X509_REQ_bio(); | ||
847 | RSA *d2i_RSAPrivateKey_bio(); | ||
848 | int i2d_RSAPrivateKey_bio(); | ||
849 | DSA *d2i_DSAPrivateKey_bio(); | ||
850 | int i2d_DSAPrivateKey_bio(); | ||
851 | RSA *d2i_RSAPublicKey_bio(); | ||
852 | int i2d_RSAPublicKey_bio(); | ||
853 | |||
854 | X509 *X509_dup(); | ||
855 | X509_EXTENSION *X509_EXTENSION_dup(); | ||
856 | X509_CRL *X509_CRL_dup(); | ||
857 | X509_REQ *X509_REQ_dup(); | ||
858 | X509_NAME *X509_NAME_dup(); | ||
859 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(); | ||
860 | RSA *RSAPublicKey_dup(); | ||
861 | RSA *RSAPrivateKey_dup(); | ||
862 | |||
863 | #endif /* !SSLEAY_MACROS */ | ||
864 | |||
865 | int X509_cmp_current_time(); | ||
866 | ASN1_UTCTIME * X509_gmtime_adj(); | ||
867 | |||
868 | char * X509_get_default_cert_area(); | ||
869 | char * X509_get_default_cert_dir(); | ||
870 | char * X509_get_default_cert_file(); | ||
871 | char * X509_get_default_cert_dir_env(); | ||
872 | char * X509_get_default_cert_file_env(); | ||
873 | char * X509_get_default_private_dir(); | ||
874 | |||
875 | X509_REQ * X509_to_X509_REQ(); | ||
876 | X509 * X509_REQ_to_X509(); | ||
877 | void ERR_load_X509_strings(); | ||
878 | |||
879 | X509_ALGOR * X509_ALGOR_new(); | ||
880 | void X509_ALGOR_free(); | ||
881 | int i2d_X509_ALGOR(); | ||
882 | X509_ALGOR * d2i_X509_ALGOR(); | ||
883 | |||
884 | X509_VAL * X509_VAL_new(); | ||
885 | void X509_VAL_free(); | ||
886 | int i2d_X509_VAL(); | ||
887 | X509_VAL * d2i_X509_VAL(); | ||
888 | |||
889 | X509_PUBKEY * X509_PUBKEY_new(); | ||
890 | void X509_PUBKEY_free(); | ||
891 | int i2d_X509_PUBKEY(); | ||
892 | X509_PUBKEY * d2i_X509_PUBKEY(); | ||
893 | int X509_PUBKEY_set(); | ||
894 | EVP_PKEY * X509_PUBKEY_get(); | ||
895 | int X509_get_pubkey_parameters(); | ||
896 | |||
897 | X509_SIG * X509_SIG_new(); | ||
898 | void X509_SIG_free(); | ||
899 | int i2d_X509_SIG(); | ||
900 | X509_SIG * d2i_X509_SIG(); | ||
901 | |||
902 | X509_REQ_INFO *X509_REQ_INFO_new(); | ||
903 | void X509_REQ_INFO_free(); | ||
904 | int i2d_X509_REQ_INFO(); | ||
905 | X509_REQ_INFO *d2i_X509_REQ_INFO(); | ||
906 | |||
907 | X509_REQ * X509_REQ_new(); | ||
908 | void X509_REQ_free(); | ||
909 | int i2d_X509_REQ(); | ||
910 | X509_REQ * d2i_X509_REQ(); | ||
911 | |||
912 | X509_ATTRIBUTE *X509_ATTRIBUTE_new(); | ||
913 | void X509_ATTRIBUTE_free(); | ||
914 | int i2d_X509_ATTRIBUTE(); | ||
915 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(); | ||
916 | |||
917 | X509_EXTENSION *X509_EXTENSION_new(); | ||
918 | void X509_EXTENSION_free(); | ||
919 | int i2d_X509_EXTENSION(); | ||
920 | X509_EXTENSION *d2i_X509_EXTENSION(); | ||
921 | |||
922 | X509_NAME_ENTRY *X509_NAME_ENTRY_new(); | ||
923 | void X509_NAME_ENTRY_free(); | ||
924 | int i2d_X509_NAME_ENTRY(); | ||
925 | X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(); | ||
926 | |||
927 | X509_NAME * X509_NAME_new(); | ||
928 | void X509_NAME_free(); | ||
929 | int i2d_X509_NAME(); | ||
930 | X509_NAME * d2i_X509_NAME(); | ||
931 | int X509_NAME_set(); | ||
932 | |||
933 | |||
934 | X509_CINF * X509_CINF_new(); | ||
935 | void X509_CINF_free(); | ||
936 | int i2d_X509_CINF(); | ||
937 | X509_CINF * d2i_X509_CINF(); | ||
938 | |||
939 | X509 * X509_new(); | ||
940 | void X509_free(); | ||
941 | int i2d_X509(); | ||
942 | X509 * d2i_X509(); | ||
943 | |||
944 | X509_REVOKED * X509_REVOKED_new(); | ||
945 | void X509_REVOKED_free(); | ||
946 | int i2d_X509_REVOKED(); | ||
947 | X509_REVOKED * d2i_X509_REVOKED(); | ||
948 | |||
949 | X509_CRL_INFO *X509_CRL_INFO_new(); | ||
950 | void X509_CRL_INFO_free(); | ||
951 | int i2d_X509_CRL_INFO(); | ||
952 | X509_CRL_INFO *d2i_X509_CRL_INFO(); | ||
953 | |||
954 | X509_CRL * X509_CRL_new(); | ||
955 | void X509_CRL_free(); | ||
956 | int i2d_X509_CRL(); | ||
957 | X509_CRL * d2i_X509_CRL(); | ||
958 | |||
959 | X509_PKEY * X509_PKEY_new(); | ||
960 | void X509_PKEY_free(); | ||
961 | int i2d_X509_PKEY(); | ||
962 | X509_PKEY * d2i_X509_PKEY(); | ||
963 | |||
964 | NETSCAPE_SPKI * NETSCAPE_SPKI_new(); | ||
965 | void NETSCAPE_SPKI_free(); | ||
966 | int i2d_NETSCAPE_SPKI(); | ||
967 | NETSCAPE_SPKI * d2i_NETSCAPE_SPKI(); | ||
968 | |||
969 | NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(); | ||
970 | void NETSCAPE_SPKAC_free(); | ||
971 | int i2d_NETSCAPE_SPKAC(); | ||
972 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(); | ||
973 | |||
974 | #ifdef HEADER_ENVELOPE_H | ||
975 | X509_INFO * X509_INFO_new(); | ||
976 | void X509_INFO_free(); | ||
977 | #endif | ||
978 | |||
979 | char * X509_NAME_oneline(); | ||
980 | |||
981 | int ASN1_verify(); | ||
982 | int ASN1_digest(); | ||
983 | int ASN1_sign(); | ||
984 | |||
985 | int X509_set_version(); | ||
986 | int X509_set_serialNumber(); | ||
987 | ASN1_INTEGER * X509_get_serialNumber(); | ||
988 | int X509_set_issuer_name(); | ||
989 | X509_NAME * X509_get_issuer_name(); | ||
990 | int X509_set_subject_name(); | ||
991 | X509_NAME * X509_get_subject_name(); | ||
992 | int X509_set_notBefore(); | ||
993 | int X509_set_notAfter(); | ||
994 | int X509_set_pubkey(); | ||
995 | EVP_PKEY * X509_get_pubkey(); | ||
996 | int X509_certificate_type(); | ||
997 | |||
998 | int X509_REQ_set_version(); | ||
999 | int X509_REQ_set_subject_name(); | ||
1000 | int X509_REQ_set_pubkey(); | ||
1001 | EVP_PKEY * X509_REQ_get_pubkey(); | ||
1002 | |||
1003 | int X509_check_private_key(); | ||
1004 | |||
1005 | int X509_issuer_and_serial_cmp(); | ||
1006 | unsigned long X509_issuer_and_serial_hash(); | ||
1007 | |||
1008 | int X509_issuer_name_cmp(); | ||
1009 | unsigned long X509_issuer_name_hash(); | ||
1010 | |||
1011 | int X509_subject_name_cmp(); | ||
1012 | unsigned long X509_subject_name_hash(); | ||
1013 | |||
1014 | int X509_NAME_cmp (); | ||
1015 | unsigned long X509_NAME_hash(); | ||
1016 | |||
1017 | int X509_CRL_cmp(); | ||
1018 | #ifndef NO_FP_API | ||
1019 | int X509_print_fp(); | ||
1020 | int X509_REQ_print_fp(); | ||
1021 | #endif | ||
1022 | |||
1023 | int X509_NAME_print(); | ||
1024 | int X509_print(); | ||
1025 | int X509_REQ_print(); | ||
1026 | |||
1027 | int X509_NAME_entry_count(); | ||
1028 | int X509_NAME_get_text_by_NID(); | ||
1029 | int X509_NAME_get_text_by_OBJ(); | ||
1030 | |||
1031 | int X509_NAME_get_index_by_NID(); | ||
1032 | int X509_NAME_get_index_by_OBJ(); | ||
1033 | X509_NAME_ENTRY *X509_NAME_get_entry(); | ||
1034 | X509_NAME_ENTRY *X509_NAME_delete_entry(); | ||
1035 | int X509_NAME_add_entry(); | ||
1036 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(); | ||
1037 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(); | ||
1038 | int X509_NAME_ENTRY_set_object(); | ||
1039 | int X509_NAME_ENTRY_set_data(); | ||
1040 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(); | ||
1041 | ASN1_STRING * X509_NAME_ENTRY_get_data(); | ||
1042 | |||
1043 | int X509v3_get_ext_count(); | ||
1044 | int X509v3_get_ext_by_NID(); | ||
1045 | int X509v3_get_ext_by_OBJ(); | ||
1046 | int X509v3_get_ext_by_critical(); | ||
1047 | X509_EXTENSION *X509v3_get_ext(); | ||
1048 | X509_EXTENSION *X509v3_delete_ext(); | ||
1049 | STACK * X509v3_add_ext(); | ||
1050 | |||
1051 | int X509v3_data_type_by_OBJ(); | ||
1052 | int X509v3_data_type_by_NID(); | ||
1053 | int X509v3_pack_type_by_OBJ(); | ||
1054 | int X509v3_pack_type_by_NID(); | ||
1055 | |||
1056 | int X509_get_ext_count(); | ||
1057 | int X509_get_ext_by_NID(); | ||
1058 | int X509_get_ext_by_OBJ(); | ||
1059 | int X509_get_ext_by_critical(); | ||
1060 | X509_EXTENSION *X509_get_ext(); | ||
1061 | X509_EXTENSION *X509_delete_ext(); | ||
1062 | int X509_add_ext(); | ||
1063 | |||
1064 | int X509_CRL_get_ext_count(); | ||
1065 | int X509_CRL_get_ext_by_NID(); | ||
1066 | int X509_CRL_get_ext_by_OBJ(); | ||
1067 | int X509_CRL_get_ext_by_critical(); | ||
1068 | X509_EXTENSION *X509_CRL_get_ext(); | ||
1069 | X509_EXTENSION *X509_CRL_delete_ext(); | ||
1070 | int X509_CRL_add_ext(); | ||
1071 | |||
1072 | int X509_REVOKED_get_ext_count(); | ||
1073 | int X509_REVOKED_get_ext_by_NID(); | ||
1074 | int X509_REVOKED_get_ext_by_OBJ(); | ||
1075 | int X509_REVOKED_get_ext_by_critical(); | ||
1076 | X509_EXTENSION *X509_REVOKED_get_ext(); | ||
1077 | X509_EXTENSION *X509_REVOKED_delete_ext(); | ||
1078 | int X509_REVOKED_add_ext(); | ||
1079 | |||
1080 | X509_EXTENSION *X509_EXTENSION_create_by_NID(); | ||
1081 | X509_EXTENSION *X509_EXTENSION_create_by_OBJ(); | ||
1082 | int X509_EXTENSION_set_object(); | ||
1083 | int X509_EXTENSION_set_critical(); | ||
1084 | int X509_EXTENSION_set_data(); | ||
1085 | ASN1_OBJECT * X509_EXTENSION_get_object(); | ||
1086 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(); | ||
1087 | int X509_EXTENSION_get_critical(); | ||
1088 | ASN1_OCTET_STRING *X509v3_pack_string(); | ||
1089 | ASN1_STRING * X509v3_unpack_string(); | ||
1090 | |||
1091 | int X509_verify_cert(); | ||
1092 | char * X509_verify_cert_error_string(); | ||
1093 | |||
1094 | /* lookup a cert from a X509 STACK */ | ||
1095 | X509 *X509_find_by_issuer_and_serial(); | ||
1096 | X509 *X509_find_by_subject(); | ||
1097 | |||
1098 | #endif | ||
1099 | 930 | ||
1100 | /* BEGIN ERROR CODES */ | 931 | /* BEGIN ERROR CODES */ |
932 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
933 | * made after this point may be overwritten when the script is next run. | ||
934 | */ | ||
935 | |||
1101 | /* Error codes for the X509 functions. */ | 936 | /* Error codes for the X509 functions. */ |
1102 | 937 | ||
1103 | /* Function codes. */ | 938 | /* Function codes. */ |
@@ -1106,9 +941,7 @@ X509 *X509_find_by_subject(); | |||
1106 | #define X509_F_DIR_CTRL 102 | 941 | #define X509_F_DIR_CTRL 102 |
1107 | #define X509_F_GET_CERT_BY_SUBJECT 103 | 942 | #define X509_F_GET_CERT_BY_SUBJECT 103 |
1108 | #define X509_F_X509V3_ADD_EXT 104 | 943 | #define X509_F_X509V3_ADD_EXT 104 |
1109 | #define X509_F_X509V3_ADD_EXTENSION 105 | 944 | #define X509_F_X509_CHECK_PRIVATE_KEY 128 |
1110 | #define X509_F_X509V3_PACK_STRING 106 | ||
1111 | #define X509_F_X509V3_UNPACK_STRING 107 | ||
1112 | #define X509_F_X509_EXTENSION_CREATE_BY_NID 108 | 945 | #define X509_F_X509_EXTENSION_CREATE_BY_NID 108 |
1113 | #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 | 946 | #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 |
1114 | #define X509_F_X509_GET_PUBKEY_PARAMETERS 110 | 947 | #define X509_F_X509_GET_PUBKEY_PARAMETERS 110 |
@@ -1132,19 +965,23 @@ X509 *X509_find_by_subject(); | |||
1132 | 965 | ||
1133 | /* Reason codes. */ | 966 | /* Reason codes. */ |
1134 | #define X509_R_BAD_X509_FILETYPE 100 | 967 | #define X509_R_BAD_X509_FILETYPE 100 |
968 | #define X509_R_CANT_CHECK_DH_KEY 114 | ||
1135 | #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 | 969 | #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 |
1136 | #define X509_R_ERR_ASN1_LIB 102 | 970 | #define X509_R_ERR_ASN1_LIB 102 |
971 | #define X509_R_INVALID_DIRECTORY 113 | ||
972 | #define X509_R_KEY_TYPE_MISMATCH 115 | ||
973 | #define X509_R_KEY_VALUES_MISMATCH 116 | ||
1137 | #define X509_R_LOADING_CERT_DIR 103 | 974 | #define X509_R_LOADING_CERT_DIR 103 |
1138 | #define X509_R_LOADING_DEFAULTS 104 | 975 | #define X509_R_LOADING_DEFAULTS 104 |
1139 | #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 | 976 | #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 |
1140 | #define X509_R_SHOULD_RETRY 106 | 977 | #define X509_R_SHOULD_RETRY 106 |
1141 | #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 | 978 | #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 |
1142 | #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 | 979 | #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 |
980 | #define X509_R_UNKNOWN_KEY_TYPE 117 | ||
1143 | #define X509_R_UNKNOWN_NID 109 | 981 | #define X509_R_UNKNOWN_NID 109 |
1144 | #define X509_R_UNKNOWN_STRING_TYPE 110 | ||
1145 | #define X509_R_UNSUPPORTED_ALGORITHM 111 | 982 | #define X509_R_UNSUPPORTED_ALGORITHM 111 |
1146 | #define X509_R_WRONG_LOOKUP_TYPE 112 | 983 | #define X509_R_WRONG_LOOKUP_TYPE 112 |
1147 | 984 | ||
1148 | #ifdef __cplusplus | 985 | #ifdef __cplusplus |
1149 | } | 986 | } |
1150 | #endif | 987 | #endif |