diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509.h')
-rw-r--r-- | src/lib/libcrypto/x509/x509.h | 321 |
1 files changed, 143 insertions, 178 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 813c8adffd..c75aa0c717 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -60,47 +60,46 @@ | |||
60 | #define HEADER_X509_H | 60 | #define HEADER_X509_H |
61 | 61 | ||
62 | #include <openssl/symhacks.h> | 62 | #include <openssl/symhacks.h> |
63 | #ifndef NO_BUFFER | 63 | #ifndef OPENSSL_NO_BUFFER |
64 | #include <openssl/buffer.h> | 64 | #include <openssl/buffer.h> |
65 | #endif | 65 | #endif |
66 | #ifndef NO_EVP | 66 | #ifndef OPENSSL_NO_EVP |
67 | #include <openssl/evp.h> | 67 | #include <openssl/evp.h> |
68 | #endif | 68 | #endif |
69 | #ifndef NO_BIO | 69 | #ifndef OPENSSL_NO_BIO |
70 | #include <openssl/bio.h> | 70 | #include <openssl/bio.h> |
71 | #endif | 71 | #endif |
72 | #include <openssl/stack.h> | 72 | #include <openssl/stack.h> |
73 | #include <openssl/asn1.h> | 73 | #include <openssl/asn1.h> |
74 | #include <openssl/safestack.h> | 74 | #include <openssl/safestack.h> |
75 | 75 | ||
76 | #ifndef NO_RSA | 76 | #ifndef OPENSSL_NO_RSA |
77 | #include <openssl/rsa.h> | 77 | #include <openssl/rsa.h> |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | #ifndef NO_DSA | 80 | #ifndef OPENSSL_NO_DSA |
81 | #include <openssl/dsa.h> | 81 | #include <openssl/dsa.h> |
82 | #endif | 82 | #endif |
83 | 83 | ||
84 | #ifndef NO_DH | 84 | #ifndef OPENSSL_NO_DH |
85 | #include <openssl/dh.h> | 85 | #include <openssl/dh.h> |
86 | #endif | 86 | #endif |
87 | 87 | #ifndef OPENSSL_NO_SHA | |
88 | #include <openssl/sha.h> | ||
89 | #endif | ||
88 | #include <openssl/evp.h> | 90 | #include <openssl/evp.h> |
89 | 91 | #include <openssl/e_os2.h> | |
92 | #include <openssl/ossl_typ.h> | ||
90 | 93 | ||
91 | #ifdef __cplusplus | 94 | #ifdef __cplusplus |
92 | extern "C" { | 95 | extern "C" { |
93 | #endif | 96 | #endif |
94 | 97 | ||
95 | #ifdef WIN32 | 98 | #ifdef OPENSSL_SYS_WIN32 |
96 | /* Under Win32 this is defined in wincrypt.h */ | 99 | /* Under Win32 this is defined in wincrypt.h */ |
97 | #undef X509_NAME | 100 | #undef X509_NAME |
98 | #endif | 101 | #endif |
99 | 102 | ||
100 | /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ | ||
101 | #define DECLARE_PKCS12_STACK_OF(type) /* Nothing */ | ||
102 | #define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */ | ||
103 | |||
104 | #define X509_FILETYPE_PEM 1 | 103 | #define X509_FILETYPE_PEM 1 |
105 | #define X509_FILETYPE_ASN1 2 | 104 | #define X509_FILETYPE_ASN1 2 |
106 | #define X509_FILETYPE_DEFAULT 3 | 105 | #define X509_FILETYPE_DEFAULT 3 |
@@ -123,11 +122,11 @@ typedef struct X509_objects_st | |||
123 | int (*i2a)(); | 122 | int (*i2a)(); |
124 | } X509_OBJECTS; | 123 | } X509_OBJECTS; |
125 | 124 | ||
126 | typedef struct X509_algor_st | 125 | struct X509_algor_st |
127 | { | 126 | { |
128 | ASN1_OBJECT *algorithm; | 127 | ASN1_OBJECT *algorithm; |
129 | ASN1_TYPE *parameter; | 128 | ASN1_TYPE *parameter; |
130 | } X509_ALGOR; | 129 | } /* X509_ALGOR */; |
131 | 130 | ||
132 | DECLARE_STACK_OF(X509_ALGOR) | 131 | DECLARE_STACK_OF(X509_ALGOR) |
133 | DECLARE_ASN1_SET_OF(X509_ALGOR) | 132 | DECLARE_ASN1_SET_OF(X509_ALGOR) |
@@ -163,17 +162,17 @@ DECLARE_STACK_OF(X509_NAME_ENTRY) | |||
163 | DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) | 162 | DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) |
164 | 163 | ||
165 | /* we always keep X509_NAMEs in 2 forms. */ | 164 | /* we always keep X509_NAMEs in 2 forms. */ |
166 | typedef struct X509_name_st | 165 | struct X509_name_st |
167 | { | 166 | { |
168 | STACK_OF(X509_NAME_ENTRY) *entries; | 167 | STACK_OF(X509_NAME_ENTRY) *entries; |
169 | int modified; /* true if 'bytes' needs to be built */ | 168 | int modified; /* true if 'bytes' needs to be built */ |
170 | #ifndef NO_BUFFER | 169 | #ifndef OPENSSL_NO_BUFFER |
171 | BUF_MEM *bytes; | 170 | BUF_MEM *bytes; |
172 | #else | 171 | #else |
173 | char *bytes; | 172 | char *bytes; |
174 | #endif | 173 | #endif |
175 | unsigned long hash; /* Keep the hash around for lookups */ | 174 | unsigned long hash; /* Keep the hash around for lookups */ |
176 | } X509_NAME; | 175 | } /* X509_NAME */; |
177 | 176 | ||
178 | DECLARE_STACK_OF(X509_NAME) | 177 | DECLARE_STACK_OF(X509_NAME) |
179 | 178 | ||
@@ -182,11 +181,8 @@ DECLARE_STACK_OF(X509_NAME) | |||
182 | typedef struct X509_extension_st | 181 | typedef struct X509_extension_st |
183 | { | 182 | { |
184 | ASN1_OBJECT *object; | 183 | ASN1_OBJECT *object; |
185 | short critical; | 184 | ASN1_BOOLEAN critical; |
186 | short netscape_hack; | ||
187 | ASN1_OCTET_STRING *value; | 185 | ASN1_OCTET_STRING *value; |
188 | struct v3_ext_method *method; /* V3 method to use */ | ||
189 | void *ext_val; /* extension value */ | ||
190 | } X509_EXTENSION; | 186 | } X509_EXTENSION; |
191 | 187 | ||
192 | DECLARE_STACK_OF(X509_EXTENSION) | 188 | DECLARE_STACK_OF(X509_EXTENSION) |
@@ -196,27 +192,26 @@ DECLARE_ASN1_SET_OF(X509_EXTENSION) | |||
196 | typedef struct x509_attributes_st | 192 | typedef struct x509_attributes_st |
197 | { | 193 | { |
198 | ASN1_OBJECT *object; | 194 | ASN1_OBJECT *object; |
199 | int set; /* 1 for a set, 0 for a single item (which is wrong) */ | 195 | int single; /* 0 for a set, 1 for a single item (which is wrong) */ |
200 | union { | 196 | union { |
201 | char *ptr; | 197 | char *ptr; |
202 | /* 1 */ STACK_OF(ASN1_TYPE) *set; | 198 | /* 0 */ STACK_OF(ASN1_TYPE) *set; |
203 | /* 0 */ ASN1_TYPE *single; | 199 | /* 1 */ ASN1_TYPE *single; |
204 | } value; | 200 | } value; |
205 | } X509_ATTRIBUTE; | 201 | } X509_ATTRIBUTE; |
206 | 202 | ||
207 | DECLARE_STACK_OF(X509_ATTRIBUTE) | 203 | DECLARE_STACK_OF(X509_ATTRIBUTE) |
208 | DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) | 204 | DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) |
209 | 205 | ||
206 | |||
210 | typedef struct X509_req_info_st | 207 | typedef struct X509_req_info_st |
211 | { | 208 | { |
212 | unsigned char *asn1; | 209 | ASN1_ENCODING enc; |
213 | int length; | ||
214 | ASN1_INTEGER *version; | 210 | ASN1_INTEGER *version; |
215 | X509_NAME *subject; | 211 | X509_NAME *subject; |
216 | X509_PUBKEY *pubkey; | 212 | X509_PUBKEY *pubkey; |
217 | /* d=2 hl=2 l= 0 cons: cont: 00 */ | 213 | /* d=2 hl=2 l= 0 cons: cont: 00 */ |
218 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ | 214 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
219 | int req_kludge; | ||
220 | } X509_REQ_INFO; | 215 | } X509_REQ_INFO; |
221 | 216 | ||
222 | typedef struct X509_req_st | 217 | typedef struct X509_req_st |
@@ -256,7 +251,7 @@ typedef struct x509_cert_aux_st | |||
256 | STACK_OF(X509_ALGOR) *other; /* other unspecified info */ | 251 | STACK_OF(X509_ALGOR) *other; /* other unspecified info */ |
257 | } X509_CERT_AUX; | 252 | } X509_CERT_AUX; |
258 | 253 | ||
259 | typedef struct x509_st | 254 | struct x509_st |
260 | { | 255 | { |
261 | X509_CINF *cert_info; | 256 | X509_CINF *cert_info; |
262 | X509_ALGOR *sig_alg; | 257 | X509_ALGOR *sig_alg; |
@@ -273,11 +268,11 @@ typedef struct x509_st | |||
273 | unsigned long ex_nscert; | 268 | unsigned long ex_nscert; |
274 | ASN1_OCTET_STRING *skid; | 269 | ASN1_OCTET_STRING *skid; |
275 | struct AUTHORITY_KEYID_st *akid; | 270 | struct AUTHORITY_KEYID_st *akid; |
276 | #ifndef NO_SHA | 271 | #ifndef OPENSSL_NO_SHA |
277 | unsigned char sha1_hash[SHA_DIGEST_LENGTH]; | 272 | unsigned char sha1_hash[SHA_DIGEST_LENGTH]; |
278 | #endif | 273 | #endif |
279 | X509_CERT_AUX *aux; | 274 | X509_CERT_AUX *aux; |
280 | } X509; | 275 | } /* X509 */; |
281 | 276 | ||
282 | DECLARE_STACK_OF(X509) | 277 | DECLARE_STACK_OF(X509) |
283 | DECLARE_ASN1_SET_OF(X509) | 278 | DECLARE_ASN1_SET_OF(X509) |
@@ -304,10 +299,12 @@ DECLARE_STACK_OF(X509_TRUST) | |||
304 | #define X509_TRUST_SSL_SERVER 3 | 299 | #define X509_TRUST_SSL_SERVER 3 |
305 | #define X509_TRUST_EMAIL 4 | 300 | #define X509_TRUST_EMAIL 4 |
306 | #define X509_TRUST_OBJECT_SIGN 5 | 301 | #define X509_TRUST_OBJECT_SIGN 5 |
302 | #define X509_TRUST_OCSP_SIGN 6 | ||
303 | #define X509_TRUST_OCSP_REQUEST 7 | ||
307 | 304 | ||
308 | /* Keep these up to date! */ | 305 | /* Keep these up to date! */ |
309 | #define X509_TRUST_MIN 1 | 306 | #define X509_TRUST_MIN 1 |
310 | #define X509_TRUST_MAX 5 | 307 | #define X509_TRUST_MAX 7 |
311 | 308 | ||
312 | 309 | ||
313 | /* trust_flags values */ | 310 | /* trust_flags values */ |
@@ -320,6 +317,21 @@ DECLARE_STACK_OF(X509_TRUST) | |||
320 | #define X509_TRUST_REJECTED 2 | 317 | #define X509_TRUST_REJECTED 2 |
321 | #define X509_TRUST_UNTRUSTED 3 | 318 | #define X509_TRUST_UNTRUSTED 3 |
322 | 319 | ||
320 | /* Flags for X509_print_ex() */ | ||
321 | |||
322 | #define X509_FLAG_COMPAT 0 | ||
323 | #define X509_FLAG_NO_HEADER 1L | ||
324 | #define X509_FLAG_NO_VERSION (1L << 1) | ||
325 | #define X509_FLAG_NO_SERIAL (1L << 2) | ||
326 | #define X509_FLAG_NO_SIGNAME (1L << 3) | ||
327 | #define X509_FLAG_NO_ISSUER (1L << 4) | ||
328 | #define X509_FLAG_NO_VALIDITY (1L << 5) | ||
329 | #define X509_FLAG_NO_SUBJECT (1L << 6) | ||
330 | #define X509_FLAG_NO_PUBKEY (1L << 7) | ||
331 | #define X509_FLAG_NO_EXTENSIONS (1L << 8) | ||
332 | #define X509_FLAG_NO_SIGDUMP (1L << 9) | ||
333 | #define X509_FLAG_NO_AUX (1L << 10) | ||
334 | |||
323 | /* Flags specific to X509_NAME_print_ex() */ | 335 | /* Flags specific to X509_NAME_print_ex() */ |
324 | 336 | ||
325 | /* The field separator information */ | 337 | /* The field separator information */ |
@@ -351,6 +363,8 @@ DECLARE_STACK_OF(X509_TRUST) | |||
351 | 363 | ||
352 | #define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) | 364 | #define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) |
353 | 365 | ||
366 | #define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */ | ||
367 | |||
354 | /* Complete set of RFC2253 flags */ | 368 | /* Complete set of RFC2253 flags */ |
355 | 369 | ||
356 | #define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ | 370 | #define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ |
@@ -373,7 +387,8 @@ DECLARE_STACK_OF(X509_TRUST) | |||
373 | ASN1_STRFLGS_ESC_MSB | \ | 387 | ASN1_STRFLGS_ESC_MSB | \ |
374 | XN_FLAG_SEP_MULTILINE | \ | 388 | XN_FLAG_SEP_MULTILINE | \ |
375 | XN_FLAG_SPC_EQ | \ | 389 | XN_FLAG_SPC_EQ | \ |
376 | XN_FLAG_FN_LN) | 390 | XN_FLAG_FN_LN | \ |
391 | XN_FLAG_FN_ALIGN) | ||
377 | 392 | ||
378 | typedef struct X509_revoked_st | 393 | typedef struct X509_revoked_st |
379 | { | 394 | { |
@@ -397,14 +412,14 @@ typedef struct X509_crl_info_st | |||
397 | STACK_OF(X509_EXTENSION) /* [0] */ *extensions; | 412 | STACK_OF(X509_EXTENSION) /* [0] */ *extensions; |
398 | } X509_CRL_INFO; | 413 | } X509_CRL_INFO; |
399 | 414 | ||
400 | typedef struct X509_crl_st | 415 | struct X509_crl_st |
401 | { | 416 | { |
402 | /* actual signature */ | 417 | /* actual signature */ |
403 | X509_CRL_INFO *crl; | 418 | X509_CRL_INFO *crl; |
404 | X509_ALGOR *sig_alg; | 419 | X509_ALGOR *sig_alg; |
405 | ASN1_BIT_STRING *signature; | 420 | ASN1_BIT_STRING *signature; |
406 | int references; | 421 | int references; |
407 | } X509_CRL; | 422 | } /* X509_CRL */; |
408 | 423 | ||
409 | DECLARE_STACK_OF(X509_CRL) | 424 | DECLARE_STACK_OF(X509_CRL) |
410 | DECLARE_ASN1_SET_OF(X509_CRL) | 425 | DECLARE_ASN1_SET_OF(X509_CRL) |
@@ -430,7 +445,7 @@ typedef struct private_key_st | |||
430 | int references; | 445 | int references; |
431 | } X509_PKEY; | 446 | } X509_PKEY; |
432 | 447 | ||
433 | #ifndef NO_EVP | 448 | #ifndef OPENSSL_NO_EVP |
434 | typedef struct X509_info_st | 449 | typedef struct X509_info_st |
435 | { | 450 | { |
436 | X509 *x509; | 451 | X509 *x509; |
@@ -686,7 +701,7 @@ extern "C" { | |||
686 | const char *X509_verify_cert_error_string(long n); | 701 | const char *X509_verify_cert_error_string(long n); |
687 | 702 | ||
688 | #ifndef SSLEAY_MACROS | 703 | #ifndef SSLEAY_MACROS |
689 | #ifndef NO_EVP | 704 | #ifndef OPENSSL_NO_EVP |
690 | int X509_verify(X509 *a, EVP_PKEY *r); | 705 | int X509_verify(X509 *a, EVP_PKEY *r); |
691 | 706 | ||
692 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); | 707 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); |
@@ -700,11 +715,15 @@ int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); | |||
700 | 715 | ||
701 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); | 716 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); |
702 | 717 | ||
718 | int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); | ||
719 | |||
703 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); | 720 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
704 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); | 721 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); |
705 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); | 722 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); |
706 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); | 723 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); |
707 | 724 | ||
725 | int X509_pubkey_digest(const X509 *data,const EVP_MD *type, | ||
726 | unsigned char *md, unsigned int *len); | ||
708 | int X509_digest(const X509 *data,const EVP_MD *type, | 727 | int X509_digest(const X509 *data,const EVP_MD *type, |
709 | unsigned char *md, unsigned int *len); | 728 | unsigned char *md, unsigned int *len); |
710 | int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, | 729 | int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, |
@@ -715,14 +734,14 @@ int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type, | |||
715 | unsigned char *md, unsigned int *len); | 734 | unsigned char *md, unsigned int *len); |
716 | #endif | 735 | #endif |
717 | 736 | ||
718 | #ifndef NO_FP_API | 737 | #ifndef OPENSSL_NO_FP_API |
719 | X509 *d2i_X509_fp(FILE *fp, X509 **x509); | 738 | X509 *d2i_X509_fp(FILE *fp, X509 **x509); |
720 | int i2d_X509_fp(FILE *fp,X509 *x509); | 739 | int i2d_X509_fp(FILE *fp,X509 *x509); |
721 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); | 740 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); |
722 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); | 741 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); |
723 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); | 742 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); |
724 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); | 743 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); |
725 | #ifndef NO_RSA | 744 | #ifndef OPENSSL_NO_RSA |
726 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); | 745 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); |
727 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); | 746 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); |
728 | RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); | 747 | RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); |
@@ -730,7 +749,7 @@ int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); | |||
730 | RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); | 749 | RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); |
731 | int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); | 750 | int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); |
732 | #endif | 751 | #endif |
733 | #ifndef NO_DSA | 752 | #ifndef OPENSSL_NO_DSA |
734 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); | 753 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); |
735 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); | 754 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); |
736 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); | 755 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); |
@@ -748,14 +767,14 @@ int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); | |||
748 | EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); | 767 | EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); |
749 | #endif | 768 | #endif |
750 | 769 | ||
751 | #ifndef NO_BIO | 770 | #ifndef OPENSSL_NO_BIO |
752 | X509 *d2i_X509_bio(BIO *bp,X509 **x509); | 771 | X509 *d2i_X509_bio(BIO *bp,X509 **x509); |
753 | int i2d_X509_bio(BIO *bp,X509 *x509); | 772 | int i2d_X509_bio(BIO *bp,X509 *x509); |
754 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); | 773 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); |
755 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); | 774 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); |
756 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); | 775 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); |
757 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); | 776 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); |
758 | #ifndef NO_RSA | 777 | #ifndef OPENSSL_NO_RSA |
759 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); | 778 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); |
760 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); | 779 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); |
761 | RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); | 780 | RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); |
@@ -763,7 +782,7 @@ int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); | |||
763 | RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); | 782 | RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); |
764 | int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); | 783 | int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); |
765 | #endif | 784 | #endif |
766 | #ifndef NO_DSA | 785 | #ifndef OPENSSL_NO_DSA |
767 | DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); | 786 | DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); |
768 | int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); | 787 | int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); |
769 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); | 788 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); |
@@ -789,7 +808,7 @@ X509_REQ *X509_REQ_dup(X509_REQ *req); | |||
789 | X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); | 808 | X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); |
790 | X509_NAME *X509_NAME_dup(X509_NAME *xn); | 809 | X509_NAME *X509_NAME_dup(X509_NAME *xn); |
791 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); | 810 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); |
792 | #ifndef NO_RSA | 811 | #ifndef OPENSSL_NO_RSA |
793 | RSA *RSAPublicKey_dup(RSA *rsa); | 812 | RSA *RSAPublicKey_dup(RSA *rsa); |
794 | RSA *RSAPrivateKey_dup(RSA *rsa); | 813 | RSA *RSAPrivateKey_dup(RSA *rsa); |
795 | #endif | 814 | #endif |
@@ -810,25 +829,12 @@ const char * X509_get_default_private_dir(void ); | |||
810 | 829 | ||
811 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); | 830 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
812 | X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); | 831 | X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); |
813 | void ERR_load_X509_strings(void ); | ||
814 | 832 | ||
815 | X509_ALGOR * X509_ALGOR_new(void ); | 833 | DECLARE_ASN1_FUNCTIONS(X509_ALGOR) |
816 | void X509_ALGOR_free(X509_ALGOR *a); | 834 | DECLARE_ASN1_FUNCTIONS(X509_VAL) |
817 | int i2d_X509_ALGOR(X509_ALGOR *a,unsigned char **pp); | ||
818 | X509_ALGOR * d2i_X509_ALGOR(X509_ALGOR **a,unsigned char **pp, | ||
819 | long length); | ||
820 | 835 | ||
821 | X509_VAL * X509_VAL_new(void ); | 836 | DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) |
822 | void X509_VAL_free(X509_VAL *a); | ||
823 | int i2d_X509_VAL(X509_VAL *a,unsigned char **pp); | ||
824 | X509_VAL * d2i_X509_VAL(X509_VAL **a,unsigned char **pp, | ||
825 | long length); | ||
826 | 837 | ||
827 | X509_PUBKEY * X509_PUBKEY_new(void ); | ||
828 | void X509_PUBKEY_free(X509_PUBKEY *a); | ||
829 | int i2d_X509_PUBKEY(X509_PUBKEY *a,unsigned char **pp); | ||
830 | X509_PUBKEY * d2i_X509_PUBKEY(X509_PUBKEY **a,unsigned char **pp, | ||
831 | long length); | ||
832 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); | 838 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); |
833 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); | 839 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); |
834 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, | 840 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, |
@@ -836,69 +842,37 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, | |||
836 | int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); | 842 | int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); |
837 | EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, | 843 | EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, |
838 | long length); | 844 | long length); |
839 | #ifndef NO_RSA | 845 | #ifndef OPENSSL_NO_RSA |
840 | int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); | 846 | int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); |
841 | RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, | 847 | RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, |
842 | long length); | 848 | long length); |
843 | #endif | 849 | #endif |
844 | #ifndef NO_DSA | 850 | #ifndef OPENSSL_NO_DSA |
845 | int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); | 851 | int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); |
846 | DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, | 852 | DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, |
847 | long length); | 853 | long length); |
848 | #endif | 854 | #endif |
849 | 855 | ||
850 | X509_SIG * X509_SIG_new(void ); | 856 | DECLARE_ASN1_FUNCTIONS(X509_SIG) |
851 | void X509_SIG_free(X509_SIG *a); | 857 | DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) |
852 | int i2d_X509_SIG(X509_SIG *a,unsigned char **pp); | 858 | DECLARE_ASN1_FUNCTIONS(X509_REQ) |
853 | X509_SIG * d2i_X509_SIG(X509_SIG **a,unsigned char **pp,long length); | ||
854 | |||
855 | X509_REQ_INFO *X509_REQ_INFO_new(void); | ||
856 | void X509_REQ_INFO_free(X509_REQ_INFO *a); | ||
857 | int i2d_X509_REQ_INFO(X509_REQ_INFO *a,unsigned char **pp); | ||
858 | X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a,unsigned char **pp, | ||
859 | long length); | ||
860 | 859 | ||
861 | X509_REQ * X509_REQ_new(void); | 860 | DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) |
862 | void X509_REQ_free(X509_REQ *a); | ||
863 | int i2d_X509_REQ(X509_REQ *a,unsigned char **pp); | ||
864 | X509_REQ * d2i_X509_REQ(X509_REQ **a,unsigned char **pp,long length); | ||
865 | |||
866 | X509_ATTRIBUTE *X509_ATTRIBUTE_new(void ); | ||
867 | void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a); | ||
868 | int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp); | ||
869 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp, | ||
870 | long length); | ||
871 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); | 861 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); |
872 | 862 | ||
863 | DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) | ||
873 | 864 | ||
874 | X509_EXTENSION *X509_EXTENSION_new(void ); | 865 | DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) |
875 | void X509_EXTENSION_free(X509_EXTENSION *a); | ||
876 | int i2d_X509_EXTENSION(X509_EXTENSION *a,unsigned char **pp); | ||
877 | X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a,unsigned char **pp, | ||
878 | long length); | ||
879 | 866 | ||
880 | X509_NAME_ENTRY *X509_NAME_ENTRY_new(void); | 867 | DECLARE_ASN1_FUNCTIONS(X509_NAME) |
881 | void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a); | ||
882 | int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a,unsigned char **pp); | ||
883 | X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a,unsigned char **pp, | ||
884 | long length); | ||
885 | 868 | ||
886 | X509_NAME * X509_NAME_new(void); | ||
887 | void X509_NAME_free(X509_NAME *a); | ||
888 | int i2d_X509_NAME(X509_NAME *a,unsigned char **pp); | ||
889 | X509_NAME * d2i_X509_NAME(X509_NAME **a,unsigned char **pp,long length); | ||
890 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name); | 869 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name); |
891 | 870 | ||
871 | DECLARE_ASN1_FUNCTIONS(X509_CINF) | ||
892 | 872 | ||
893 | X509_CINF * X509_CINF_new(void); | 873 | DECLARE_ASN1_FUNCTIONS(X509) |
894 | void X509_CINF_free(X509_CINF *a); | 874 | DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) |
895 | int i2d_X509_CINF(X509_CINF *a,unsigned char **pp); | ||
896 | X509_CINF * d2i_X509_CINF(X509_CINF **a,unsigned char **pp,long length); | ||
897 | 875 | ||
898 | X509 * X509_new(void); | ||
899 | void X509_free(X509 *a); | ||
900 | int i2d_X509(X509 *a,unsigned char **pp); | ||
901 | X509 * d2i_X509(X509 **a,unsigned char **pp,long length); | ||
902 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 876 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
903 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 877 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
904 | int X509_set_ex_data(X509 *r, int idx, void *arg); | 878 | int X509_set_ex_data(X509 *r, int idx, void *arg); |
@@ -906,60 +880,32 @@ void *X509_get_ex_data(X509 *r, int idx); | |||
906 | int i2d_X509_AUX(X509 *a,unsigned char **pp); | 880 | int i2d_X509_AUX(X509 *a,unsigned char **pp); |
907 | X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length); | 881 | X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length); |
908 | 882 | ||
909 | X509_CERT_AUX * X509_CERT_AUX_new(void); | ||
910 | void X509_CERT_AUX_free(X509_CERT_AUX *a); | ||
911 | int i2d_X509_CERT_AUX(X509_CERT_AUX *a,unsigned char **pp); | ||
912 | X509_CERT_AUX * d2i_X509_CERT_AUX(X509_CERT_AUX **a,unsigned char **pp, | ||
913 | long length); | ||
914 | int X509_alias_set1(X509 *x, unsigned char *name, int len); | 883 | int X509_alias_set1(X509 *x, unsigned char *name, int len); |
915 | int X509_keyid_set1(X509 *x, unsigned char *id, int len); | 884 | int X509_keyid_set1(X509 *x, unsigned char *id, int len); |
916 | unsigned char * X509_alias_get0(X509 *x, int *len); | 885 | unsigned char * X509_alias_get0(X509 *x, int *len); |
917 | int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); | 886 | int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); |
887 | int X509_TRUST_set(int *t, int trust); | ||
918 | int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); | 888 | int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); |
919 | int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); | 889 | int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); |
920 | void X509_trust_clear(X509 *x); | 890 | void X509_trust_clear(X509 *x); |
921 | void X509_reject_clear(X509 *x); | 891 | void X509_reject_clear(X509 *x); |
922 | 892 | ||
923 | X509_REVOKED * X509_REVOKED_new(void); | 893 | DECLARE_ASN1_FUNCTIONS(X509_REVOKED) |
924 | void X509_REVOKED_free(X509_REVOKED *a); | 894 | DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) |
925 | int i2d_X509_REVOKED(X509_REVOKED *a,unsigned char **pp); | 895 | DECLARE_ASN1_FUNCTIONS(X509_CRL) |
926 | X509_REVOKED * d2i_X509_REVOKED(X509_REVOKED **a,unsigned char **pp,long length); | ||
927 | 896 | ||
928 | X509_CRL_INFO *X509_CRL_INFO_new(void); | 897 | int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); |
929 | void X509_CRL_INFO_free(X509_CRL_INFO *a); | ||
930 | int i2d_X509_CRL_INFO(X509_CRL_INFO *a,unsigned char **pp); | ||
931 | X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a,unsigned char **pp, | ||
932 | long length); | ||
933 | |||
934 | X509_CRL * X509_CRL_new(void); | ||
935 | void X509_CRL_free(X509_CRL *a); | ||
936 | int i2d_X509_CRL(X509_CRL *a,unsigned char **pp); | ||
937 | X509_CRL * d2i_X509_CRL(X509_CRL **a,unsigned char **pp,long length); | ||
938 | 898 | ||
939 | X509_PKEY * X509_PKEY_new(void ); | 899 | X509_PKEY * X509_PKEY_new(void ); |
940 | void X509_PKEY_free(X509_PKEY *a); | 900 | void X509_PKEY_free(X509_PKEY *a); |
941 | int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); | 901 | int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); |
942 | X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,unsigned char **pp,long length); | 902 | X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,unsigned char **pp,long length); |
943 | 903 | ||
944 | NETSCAPE_SPKI * NETSCAPE_SPKI_new(void ); | 904 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) |
945 | void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a); | 905 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) |
946 | int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a,unsigned char **pp); | 906 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) |
947 | NETSCAPE_SPKI * d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a,unsigned char **pp, | ||
948 | long length); | ||
949 | 907 | ||
950 | NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void ); | 908 | #ifndef OPENSSL_NO_EVP |
951 | void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a); | ||
952 | int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a,unsigned char **pp); | ||
953 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a,unsigned char **pp, | ||
954 | long length); | ||
955 | |||
956 | |||
957 | int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp); | ||
958 | NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void); | ||
959 | NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length); | ||
960 | void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a); | ||
961 | |||
962 | #ifndef NO_EVP | ||
963 | X509_INFO * X509_INFO_new(void); | 909 | X509_INFO * X509_INFO_new(void); |
964 | void X509_INFO_free(X509_INFO *a); | 910 | void X509_INFO_free(X509_INFO *a); |
965 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | 911 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); |
@@ -973,6 +919,16 @@ int ASN1_digest(int (*i2d)(),const EVP_MD *type,char *data, | |||
973 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | 919 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, |
974 | ASN1_BIT_STRING *signature, | 920 | ASN1_BIT_STRING *signature, |
975 | char *data,EVP_PKEY *pkey, const EVP_MD *type); | 921 | char *data,EVP_PKEY *pkey, const EVP_MD *type); |
922 | |||
923 | int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, | ||
924 | unsigned char *md,unsigned int *len); | ||
925 | |||
926 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, | ||
927 | ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey); | ||
928 | |||
929 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | ||
930 | ASN1_BIT_STRING *signature, | ||
931 | void *data, EVP_PKEY *pkey, const EVP_MD *type); | ||
976 | #endif | 932 | #endif |
977 | 933 | ||
978 | int X509_set_version(X509 *x,long version); | 934 | int X509_set_version(X509 *x,long version); |
@@ -986,6 +942,7 @@ int X509_set_notBefore(X509 *x, ASN1_TIME *tm); | |||
986 | int X509_set_notAfter(X509 *x, ASN1_TIME *tm); | 942 | int X509_set_notAfter(X509 *x, ASN1_TIME *tm); |
987 | int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); | 943 | int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); |
988 | EVP_PKEY * X509_get_pubkey(X509 *x); | 944 | EVP_PKEY * X509_get_pubkey(X509 *x); |
945 | ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); | ||
989 | int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); | 946 | int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); |
990 | 947 | ||
991 | int X509_REQ_set_version(X509_REQ *x,long version); | 948 | int X509_REQ_set_version(X509_REQ *x,long version); |
@@ -1008,14 +965,23 @@ X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); | |||
1008 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); | 965 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); |
1009 | int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); | 966 | int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); |
1010 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, | 967 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, |
1011 | ASN1_OBJECT *obj, int type, | 968 | const ASN1_OBJECT *obj, int type, |
1012 | unsigned char *bytes, int len); | 969 | const unsigned char *bytes, int len); |
1013 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, | 970 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, |
1014 | int nid, int type, | 971 | int nid, int type, |
1015 | unsigned char *bytes, int len); | 972 | const unsigned char *bytes, int len); |
1016 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, | 973 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, |
1017 | char *attrname, int type, | 974 | const char *attrname, int type, |
1018 | unsigned char *bytes, int len); | 975 | const unsigned char *bytes, int len); |
976 | |||
977 | int X509_CRL_set_version(X509_CRL *x, long version); | ||
978 | int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); | ||
979 | int X509_CRL_set_lastUpdate(X509_CRL *x, ASN1_TIME *tm); | ||
980 | int X509_CRL_set_nextUpdate(X509_CRL *x, ASN1_TIME *tm); | ||
981 | int X509_CRL_sort(X509_CRL *crl); | ||
982 | |||
983 | int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); | ||
984 | int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); | ||
1019 | 985 | ||
1020 | int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); | 986 | int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); |
1021 | 987 | ||
@@ -1033,17 +999,20 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); | |||
1033 | unsigned long X509_NAME_hash(X509_NAME *x); | 999 | unsigned long X509_NAME_hash(X509_NAME *x); |
1034 | 1000 | ||
1035 | int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); | 1001 | int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); |
1036 | #ifndef NO_FP_API | 1002 | #ifndef OPENSSL_NO_FP_API |
1003 | int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag); | ||
1037 | int X509_print_fp(FILE *bp,X509 *x); | 1004 | int X509_print_fp(FILE *bp,X509 *x); |
1038 | int X509_CRL_print_fp(FILE *bp,X509_CRL *x); | 1005 | int X509_CRL_print_fp(FILE *bp,X509_CRL *x); |
1039 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); | 1006 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); |
1040 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); | 1007 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); |
1041 | #endif | 1008 | #endif |
1042 | 1009 | ||
1043 | #ifndef NO_BIO | 1010 | #ifndef OPENSSL_NO_BIO |
1044 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); | 1011 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); |
1045 | int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); | 1012 | int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); |
1013 | int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag); | ||
1046 | int X509_print(BIO *bp,X509 *x); | 1014 | int X509_print(BIO *bp,X509 *x); |
1015 | int X509_ocspid_print(BIO *bp,X509 *x); | ||
1047 | int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); | 1016 | int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); |
1048 | int X509_CRL_print(BIO *bp,X509_CRL *x); | 1017 | int X509_CRL_print(BIO *bp,X509_CRL *x); |
1049 | int X509_REQ_print(BIO *bp,X509_REQ *req); | 1018 | int X509_REQ_print(BIO *bp,X509_REQ *req); |
@@ -1104,6 +1073,8 @@ X509_EXTENSION *X509_get_ext(X509 *x, int loc); | |||
1104 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); | 1073 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); |
1105 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); | 1074 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); |
1106 | void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); | 1075 | void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); |
1076 | int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, | ||
1077 | unsigned long flags); | ||
1107 | 1078 | ||
1108 | int X509_CRL_get_ext_count(X509_CRL *x); | 1079 | int X509_CRL_get_ext_count(X509_CRL *x); |
1109 | int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); | 1080 | int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); |
@@ -1113,6 +1084,8 @@ X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); | |||
1113 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); | 1084 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); |
1114 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); | 1085 | int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); |
1115 | void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); | 1086 | void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); |
1087 | int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, | ||
1088 | unsigned long flags); | ||
1116 | 1089 | ||
1117 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); | 1090 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); |
1118 | int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); | 1091 | int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); |
@@ -1122,6 +1095,8 @@ X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); | |||
1122 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); | 1095 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); |
1123 | int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); | 1096 | int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); |
1124 | void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); | 1097 | void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); |
1098 | int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, | ||
1099 | unsigned long flags); | ||
1125 | 1100 | ||
1126 | X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, | 1101 | X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, |
1127 | int nid, int crit, ASN1_OCTET_STRING *data); | 1102 | int nid, int crit, ASN1_OCTET_STRING *data); |
@@ -1145,22 +1120,22 @@ X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); | |||
1145 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, | 1120 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, |
1146 | X509_ATTRIBUTE *attr); | 1121 | X509_ATTRIBUTE *attr); |
1147 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, | 1122 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, |
1148 | ASN1_OBJECT *obj, int type, | 1123 | const ASN1_OBJECT *obj, int type, |
1149 | unsigned char *bytes, int len); | 1124 | const unsigned char *bytes, int len); |
1150 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, | 1125 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, |
1151 | int nid, int type, | 1126 | int nid, int type, |
1152 | unsigned char *bytes, int len); | 1127 | const unsigned char *bytes, int len); |
1153 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, | 1128 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, |
1154 | char *attrname, int type, | 1129 | const char *attrname, int type, |
1155 | unsigned char *bytes, int len); | 1130 | const unsigned char *bytes, int len); |
1156 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, | 1131 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, |
1157 | int atrtype, void *data, int len); | 1132 | int atrtype, const void *data, int len); |
1158 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, | 1133 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, |
1159 | ASN1_OBJECT *obj, int atrtype, void *data, int len); | 1134 | const ASN1_OBJECT *obj, int atrtype, const void *data, int len); |
1160 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, | 1135 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, |
1161 | char *atrname, int type, unsigned char *bytes, int len); | 1136 | const char *atrname, int type, const unsigned char *bytes, int len); |
1162 | int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj); | 1137 | int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); |
1163 | int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len); | 1138 | int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); |
1164 | void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, | 1139 | void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, |
1165 | int atrtype, void *data); | 1140 | int atrtype, void *data); |
1166 | int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); | 1141 | int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); |
@@ -1174,31 +1149,17 @@ X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, | |||
1174 | ASN1_INTEGER *serial); | 1149 | ASN1_INTEGER *serial); |
1175 | X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); | 1150 | X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); |
1176 | 1151 | ||
1177 | int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp); | 1152 | DECLARE_ASN1_FUNCTIONS(PBEPARAM) |
1178 | PBEPARAM *PBEPARAM_new(void); | 1153 | DECLARE_ASN1_FUNCTIONS(PBE2PARAM) |
1179 | PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length); | 1154 | DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) |
1180 | void PBEPARAM_free(PBEPARAM *a); | 1155 | |
1181 | X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); | 1156 | X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); |
1182 | X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | 1157 | X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, |
1183 | unsigned char *salt, int saltlen); | 1158 | unsigned char *salt, int saltlen); |
1184 | 1159 | ||
1185 | int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp); | ||
1186 | PBKDF2PARAM *PBKDF2PARAM_new(void); | ||
1187 | PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp, long length); | ||
1188 | void PBKDF2PARAM_free(PBKDF2PARAM *a); | ||
1189 | |||
1190 | int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp); | ||
1191 | PBE2PARAM *PBE2PARAM_new(void); | ||
1192 | PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length); | ||
1193 | void PBE2PARAM_free(PBE2PARAM *a); | ||
1194 | |||
1195 | /* PKCS#8 utilities */ | 1160 | /* PKCS#8 utilities */ |
1196 | 1161 | ||
1197 | int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **pp); | 1162 | DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) |
1198 | PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void); | ||
1199 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, | ||
1200 | unsigned char **pp, long length); | ||
1201 | void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a); | ||
1202 | 1163 | ||
1203 | EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); | 1164 | EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); |
1204 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); | 1165 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); |
@@ -1220,6 +1181,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp); | |||
1220 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 1181 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
1221 | * made after this point may be overwritten when the script is next run. | 1182 | * made after this point may be overwritten when the script is next run. |
1222 | */ | 1183 | */ |
1184 | void ERR_load_X509_strings(void); | ||
1223 | 1185 | ||
1224 | /* Error codes for the X509 functions. */ | 1186 | /* Error codes for the X509 functions. */ |
1225 | 1187 | ||
@@ -1258,9 +1220,12 @@ int X509_TRUST_get_trust(X509_TRUST *xp); | |||
1258 | #define X509_F_X509_REQ_TO_X509 123 | 1220 | #define X509_F_X509_REQ_TO_X509 123 |
1259 | #define X509_F_X509_STORE_ADD_CERT 124 | 1221 | #define X509_F_X509_STORE_ADD_CERT 124 |
1260 | #define X509_F_X509_STORE_ADD_CRL 125 | 1222 | #define X509_F_X509_STORE_ADD_CRL 125 |
1223 | #define X509_F_X509_STORE_CTX_INIT 143 | ||
1224 | #define X509_F_X509_STORE_CTX_NEW 142 | ||
1261 | #define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 | 1225 | #define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 |
1262 | #define X509_F_X509_TO_X509_REQ 126 | 1226 | #define X509_F_X509_TO_X509_REQ 126 |
1263 | #define X509_F_X509_TRUST_ADD 133 | 1227 | #define X509_F_X509_TRUST_ADD 133 |
1228 | #define X509_F_X509_TRUST_SET 141 | ||
1264 | #define X509_F_X509_VERIFY_CERT 127 | 1229 | #define X509_F_X509_VERIFY_CERT 127 |
1265 | 1230 | ||
1266 | /* Reason codes. */ | 1231 | /* Reason codes. */ |
@@ -1271,6 +1236,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp); | |||
1271 | #define X509_R_ERR_ASN1_LIB 102 | 1236 | #define X509_R_ERR_ASN1_LIB 102 |
1272 | #define X509_R_INVALID_DIRECTORY 113 | 1237 | #define X509_R_INVALID_DIRECTORY 113 |
1273 | #define X509_R_INVALID_FIELD_NAME 119 | 1238 | #define X509_R_INVALID_FIELD_NAME 119 |
1239 | #define X509_R_INVALID_TRUST 123 | ||
1274 | #define X509_R_KEY_TYPE_MISMATCH 115 | 1240 | #define X509_R_KEY_TYPE_MISMATCH 115 |
1275 | #define X509_R_KEY_VALUES_MISMATCH 116 | 1241 | #define X509_R_KEY_VALUES_MISMATCH 116 |
1276 | #define X509_R_LOADING_CERT_DIR 103 | 1242 | #define X509_R_LOADING_CERT_DIR 103 |
@@ -1291,4 +1257,3 @@ int X509_TRUST_get_trust(X509_TRUST *xp); | |||
1291 | } | 1257 | } |
1292 | #endif | 1258 | #endif |
1293 | #endif | 1259 | #endif |
1294 | |||