diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509.h | 1161 |
1 files changed, 634 insertions, 527 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 95114f7c43..c75aa0c717 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
| @@ -59,32 +59,46 @@ | |||
| 59 | #ifndef HEADER_X509_H | 59 | #ifndef HEADER_X509_H |
| 60 | #define HEADER_X509_H | 60 | #define HEADER_X509_H |
| 61 | 61 | ||
| 62 | #ifdef __cplusplus | 62 | #include <openssl/symhacks.h> |
| 63 | extern "C" { | 63 | #ifndef OPENSSL_NO_BUFFER |
| 64 | #include <openssl/buffer.h> | ||
| 65 | #endif | ||
| 66 | #ifndef OPENSSL_NO_EVP | ||
| 67 | #include <openssl/evp.h> | ||
| 64 | #endif | 68 | #endif |
| 69 | #ifndef OPENSSL_NO_BIO | ||
| 70 | #include <openssl/bio.h> | ||
| 71 | #endif | ||
| 72 | #include <openssl/stack.h> | ||
| 73 | #include <openssl/asn1.h> | ||
| 74 | #include <openssl/safestack.h> | ||
| 65 | 75 | ||
| 66 | #include "stack.h" | 76 | #ifndef OPENSSL_NO_RSA |
| 67 | #include "asn1.h" | 77 | #include <openssl/rsa.h> |
| 78 | #endif | ||
| 68 | 79 | ||
| 69 | #ifndef NO_RSA | 80 | #ifndef OPENSSL_NO_DSA |
| 70 | #include "rsa.h" | 81 | #include <openssl/dsa.h> |
| 71 | #else | ||
| 72 | #define RSA long | ||
| 73 | #endif | 82 | #endif |
| 74 | 83 | ||
| 75 | #ifndef NO_DSA | 84 | #ifndef OPENSSL_NO_DH |
| 76 | #include "dsa.h" | 85 | #include <openssl/dh.h> |
| 77 | #else | 86 | #endif |
| 78 | #define DSA long | 87 | #ifndef OPENSSL_NO_SHA |
| 88 | #include <openssl/sha.h> | ||
| 79 | #endif | 89 | #endif |
| 90 | #include <openssl/evp.h> | ||
| 91 | #include <openssl/e_os2.h> | ||
| 92 | #include <openssl/ossl_typ.h> | ||
| 80 | 93 | ||
| 81 | #ifndef NO_DH | 94 | #ifdef __cplusplus |
| 82 | #include "dh.h" | 95 | extern "C" { |
| 83 | #else | ||
| 84 | #define DH long | ||
| 85 | #endif | 96 | #endif |
| 86 | 97 | ||
| 87 | #include "evp.h" | 98 | #ifdef OPENSSL_SYS_WIN32 |
| 99 | /* Under Win32 this is defined in wincrypt.h */ | ||
| 100 | #undef X509_NAME | ||
| 101 | #endif | ||
| 88 | 102 | ||
| 89 | #define X509_FILETYPE_PEM 1 | 103 | #define X509_FILETYPE_PEM 1 |
| 90 | #define X509_FILETYPE_ASN1 2 | 104 | #define X509_FILETYPE_ASN1 2 |
| @@ -108,23 +122,26 @@ typedef struct X509_objects_st | |||
| 108 | int (*i2a)(); | 122 | int (*i2a)(); |
| 109 | } X509_OBJECTS; | 123 | } X509_OBJECTS; |
| 110 | 124 | ||
| 111 | typedef struct X509_algor_st | 125 | struct X509_algor_st |
| 112 | { | 126 | { |
| 113 | ASN1_OBJECT *algorithm; | 127 | ASN1_OBJECT *algorithm; |
| 114 | ASN1_TYPE *parameter; | 128 | ASN1_TYPE *parameter; |
| 115 | } X509_ALGOR; | 129 | } /* X509_ALGOR */; |
| 130 | |||
| 131 | DECLARE_STACK_OF(X509_ALGOR) | ||
| 132 | DECLARE_ASN1_SET_OF(X509_ALGOR) | ||
| 116 | 133 | ||
| 117 | typedef struct X509_val_st | 134 | typedef struct X509_val_st |
| 118 | { | 135 | { |
| 119 | ASN1_UTCTIME *notBefore; | 136 | ASN1_TIME *notBefore; |
| 120 | ASN1_UTCTIME *notAfter; | 137 | ASN1_TIME *notAfter; |
| 121 | } X509_VAL; | 138 | } X509_VAL; |
| 122 | 139 | ||
| 123 | typedef struct X509_pubkey_st | 140 | typedef struct X509_pubkey_st |
| 124 | { | 141 | { |
| 125 | X509_ALGOR *algor; | 142 | X509_ALGOR *algor; |
| 126 | ASN1_BIT_STRING *public_key; | 143 | ASN1_BIT_STRING *public_key; |
| 127 | struct evp_pkey_st /* EVP_PKEY*/ *pkey; | 144 | EVP_PKEY *pkey; |
| 128 | } X509_PUBKEY; | 145 | } X509_PUBKEY; |
| 129 | 146 | ||
| 130 | typedef struct X509_sig_st | 147 | typedef struct X509_sig_st |
| @@ -141,58 +158,60 @@ typedef struct X509_name_entry_st | |||
| 141 | int size; /* temp variable */ | 158 | int size; /* temp variable */ |
| 142 | } X509_NAME_ENTRY; | 159 | } X509_NAME_ENTRY; |
| 143 | 160 | ||
| 161 | DECLARE_STACK_OF(X509_NAME_ENTRY) | ||
| 162 | DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) | ||
| 163 | |||
| 144 | /* we always keep X509_NAMEs in 2 forms. */ | 164 | /* we always keep X509_NAMEs in 2 forms. */ |
| 145 | typedef struct X509_name_st | 165 | struct X509_name_st |
| 146 | { | 166 | { |
| 147 | STACK *entries; /* of X509_NAME_ENTRY */ | 167 | STACK_OF(X509_NAME_ENTRY) *entries; |
| 148 | int modified; /* true if 'bytes' needs to be built */ | 168 | int modified; /* true if 'bytes' needs to be built */ |
| 149 | #ifdef HEADER_BUFFER_H | 169 | #ifndef OPENSSL_NO_BUFFER |
| 150 | BUF_MEM *bytes; | 170 | BUF_MEM *bytes; |
| 151 | #else | 171 | #else |
| 152 | char *bytes; | 172 | char *bytes; |
| 153 | #endif | 173 | #endif |
| 154 | unsigned long hash; /* Keep the hash around for lookups */ | 174 | unsigned long hash; /* Keep the hash around for lookups */ |
| 155 | } X509_NAME; | 175 | } /* X509_NAME */; |
| 176 | |||
| 177 | DECLARE_STACK_OF(X509_NAME) | ||
| 156 | 178 | ||
| 157 | #define X509_EX_V_NETSCAPE_HACK 0x8000 | 179 | #define X509_EX_V_NETSCAPE_HACK 0x8000 |
| 158 | #define X509_EX_V_INIT 0x0001 | 180 | #define X509_EX_V_INIT 0x0001 |
| 159 | typedef struct X509_extension_st | 181 | typedef struct X509_extension_st |
| 160 | { | 182 | { |
| 161 | ASN1_OBJECT *object; | 183 | ASN1_OBJECT *object; |
| 162 | short critical; | 184 | ASN1_BOOLEAN critical; |
| 163 | short netscape_hack; | ||
| 164 | ASN1_OCTET_STRING *value; | 185 | ASN1_OCTET_STRING *value; |
| 165 | long argl; /* used when decoding */ | ||
| 166 | char *argp; /* used when decoding */ | ||
| 167 | void (*ex_free)(); /* clear argp stuff */ | ||
| 168 | } X509_EXTENSION; | 186 | } X509_EXTENSION; |
| 169 | 187 | ||
| 170 | /* #if 1 */ | 188 | DECLARE_STACK_OF(X509_EXTENSION) |
| 171 | typedef struct x509_extension_method_st | 189 | DECLARE_ASN1_SET_OF(X509_EXTENSION) |
| 190 | |||
| 191 | /* a sequence of these are used */ | ||
| 192 | typedef struct x509_attributes_st | ||
| 172 | { | 193 | { |
| 173 | int nid; | 194 | ASN1_OBJECT *object; |
| 174 | int data_type; | 195 | int single; /* 0 for a set, 1 for a single item (which is wrong) */ |
| 175 | int pack_type; | 196 | union { |
| 176 | void (*ex_clear)(); | 197 | char *ptr; |
| 177 | int (*ex_get_bool)(); | 198 | /* 0 */ STACK_OF(ASN1_TYPE) *set; |
| 178 | int (*ex_set_bool)(); | 199 | /* 1 */ ASN1_TYPE *single; |
| 179 | int (*ex_get_str)(); | 200 | } value; |
| 180 | int (*ex_set_str)(); | 201 | } X509_ATTRIBUTE; |
| 181 | char *(*ex_get_struct)(); | 202 | |
| 182 | int (*ex_set_struct)(); | 203 | DECLARE_STACK_OF(X509_ATTRIBUTE) |
| 183 | int (*a2i)(); | 204 | DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) |
| 184 | int (*i2a)(); | 205 | |
| 185 | } X509_EXTENSION_METHOD; | ||
| 186 | /* #endif */ | ||
| 187 | 206 | ||
| 188 | typedef struct X509_req_info_st | 207 | typedef struct X509_req_info_st |
| 189 | { | 208 | { |
| 209 | ASN1_ENCODING enc; | ||
| 190 | ASN1_INTEGER *version; | 210 | ASN1_INTEGER *version; |
| 191 | X509_NAME *subject; | 211 | X509_NAME *subject; |
| 192 | X509_PUBKEY *pubkey; | 212 | X509_PUBKEY *pubkey; |
| 193 | /* d=2 hl=2 l= 0 cons: cont: 00 */ | 213 | /* d=2 hl=2 l= 0 cons: cont: 00 */ |
| 194 | STACK /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */ | 214 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
| 195 | int req_kludge; | ||
| 196 | } X509_REQ_INFO; | 215 | } X509_REQ_INFO; |
| 197 | 216 | ||
| 198 | typedef struct X509_req_st | 217 | typedef struct X509_req_st |
| @@ -214,10 +233,25 @@ typedef struct x509_cinf_st | |||
| 214 | X509_PUBKEY *key; | 233 | X509_PUBKEY *key; |
| 215 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ | 234 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ |
| 216 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ | 235 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ |
| 217 | STACK /* X509_EXTENSION */ *extensions; /* [ 3 ] optional in v3 */ | 236 | STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ |
| 218 | } X509_CINF; | 237 | } X509_CINF; |
| 219 | 238 | ||
| 220 | typedef struct x509_st | 239 | /* This stuff is certificate "auxiliary info" |
| 240 | * it contains details which are useful in certificate | ||
| 241 | * stores and databases. When used this is tagged onto | ||
| 242 | * the end of the certificate itself | ||
| 243 | */ | ||
| 244 | |||
| 245 | typedef struct x509_cert_aux_st | ||
| 246 | { | ||
| 247 | STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */ | ||
| 248 | STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */ | ||
| 249 | ASN1_UTF8STRING *alias; /* "friendly name" */ | ||
| 250 | ASN1_OCTET_STRING *keyid; /* key id of private key */ | ||
| 251 | STACK_OF(X509_ALGOR) *other; /* other unspecified info */ | ||
| 252 | } X509_CERT_AUX; | ||
| 253 | |||
| 254 | struct x509_st | ||
| 221 | { | 255 | { |
| 222 | X509_CINF *cert_info; | 256 | X509_CINF *cert_info; |
| 223 | X509_ALGOR *sig_alg; | 257 | X509_ALGOR *sig_alg; |
| @@ -225,47 +259,170 @@ typedef struct x509_st | |||
| 225 | int valid; | 259 | int valid; |
| 226 | int references; | 260 | int references; |
| 227 | char *name; | 261 | char *name; |
| 228 | } X509; | 262 | CRYPTO_EX_DATA ex_data; |
| 263 | /* These contain copies of various extension values */ | ||
| 264 | long ex_pathlen; | ||
| 265 | unsigned long ex_flags; | ||
| 266 | unsigned long ex_kusage; | ||
| 267 | unsigned long ex_xkusage; | ||
| 268 | unsigned long ex_nscert; | ||
| 269 | ASN1_OCTET_STRING *skid; | ||
| 270 | struct AUTHORITY_KEYID_st *akid; | ||
| 271 | #ifndef OPENSSL_NO_SHA | ||
| 272 | unsigned char sha1_hash[SHA_DIGEST_LENGTH]; | ||
| 273 | #endif | ||
| 274 | X509_CERT_AUX *aux; | ||
| 275 | } /* X509 */; | ||
| 276 | |||
| 277 | DECLARE_STACK_OF(X509) | ||
| 278 | DECLARE_ASN1_SET_OF(X509) | ||
| 279 | |||
| 280 | /* This is used for a table of trust checking functions */ | ||
| 281 | |||
| 282 | typedef struct x509_trust_st { | ||
| 283 | int trust; | ||
| 284 | int flags; | ||
| 285 | int (*check_trust)(struct x509_trust_st *, X509 *, int); | ||
| 286 | char *name; | ||
| 287 | int arg1; | ||
| 288 | void *arg2; | ||
| 289 | } X509_TRUST; | ||
| 290 | |||
| 291 | DECLARE_STACK_OF(X509_TRUST) | ||
| 292 | |||
| 293 | /* standard trust ids */ | ||
| 294 | |||
| 295 | #define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */ | ||
| 296 | |||
| 297 | #define X509_TRUST_COMPAT 1 | ||
| 298 | #define X509_TRUST_SSL_CLIENT 2 | ||
| 299 | #define X509_TRUST_SSL_SERVER 3 | ||
| 300 | #define X509_TRUST_EMAIL 4 | ||
| 301 | #define X509_TRUST_OBJECT_SIGN 5 | ||
| 302 | #define X509_TRUST_OCSP_SIGN 6 | ||
| 303 | #define X509_TRUST_OCSP_REQUEST 7 | ||
| 304 | |||
| 305 | /* Keep these up to date! */ | ||
| 306 | #define X509_TRUST_MIN 1 | ||
| 307 | #define X509_TRUST_MAX 7 | ||
| 308 | |||
| 309 | |||
| 310 | /* trust_flags values */ | ||
| 311 | #define X509_TRUST_DYNAMIC 1 | ||
| 312 | #define X509_TRUST_DYNAMIC_NAME 2 | ||
| 313 | |||
| 314 | /* check_trust return codes */ | ||
| 315 | |||
| 316 | #define X509_TRUST_TRUSTED 1 | ||
| 317 | #define X509_TRUST_REJECTED 2 | ||
| 318 | #define X509_TRUST_UNTRUSTED 3 | ||
| 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 | |||
| 335 | /* Flags specific to X509_NAME_print_ex() */ | ||
| 336 | |||
| 337 | /* The field separator information */ | ||
| 338 | |||
| 339 | #define XN_FLAG_SEP_MASK (0xf << 16) | ||
| 340 | |||
| 341 | #define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */ | ||
| 342 | #define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */ | ||
| 343 | #define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */ | ||
| 344 | #define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */ | ||
| 345 | #define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */ | ||
| 346 | |||
| 347 | #define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */ | ||
| 348 | |||
| 349 | /* How the field name is shown */ | ||
| 350 | |||
| 351 | #define XN_FLAG_FN_MASK (0x3 << 21) | ||
| 352 | |||
| 353 | #define XN_FLAG_FN_SN 0 /* Object short name */ | ||
| 354 | #define XN_FLAG_FN_LN (1 << 21) /* Object long name */ | ||
| 355 | #define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */ | ||
| 356 | #define XN_FLAG_FN_NONE (3 << 21) /* No field names */ | ||
| 357 | |||
| 358 | #define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */ | ||
| 359 | |||
| 360 | /* This determines if we dump fields we don't recognise: | ||
| 361 | * RFC2253 requires this. | ||
| 362 | */ | ||
| 363 | |||
| 364 | #define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) | ||
| 365 | |||
| 366 | #define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */ | ||
| 367 | |||
| 368 | /* Complete set of RFC2253 flags */ | ||
| 369 | |||
| 370 | #define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ | ||
| 371 | XN_FLAG_SEP_COMMA_PLUS | \ | ||
| 372 | XN_FLAG_DN_REV | \ | ||
| 373 | XN_FLAG_FN_SN | \ | ||
| 374 | XN_FLAG_DUMP_UNKNOWN_FIELDS) | ||
| 375 | |||
| 376 | /* readable oneline form */ | ||
| 377 | |||
| 378 | #define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ | ||
| 379 | ASN1_STRFLGS_ESC_QUOTE | \ | ||
| 380 | XN_FLAG_SEP_CPLUS_SPC | \ | ||
| 381 | XN_FLAG_SPC_EQ | \ | ||
| 382 | XN_FLAG_FN_SN) | ||
| 383 | |||
| 384 | /* readable multiline form */ | ||
| 385 | |||
| 386 | #define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ | ||
| 387 | ASN1_STRFLGS_ESC_MSB | \ | ||
| 388 | XN_FLAG_SEP_MULTILINE | \ | ||
| 389 | XN_FLAG_SPC_EQ | \ | ||
| 390 | XN_FLAG_FN_LN | \ | ||
| 391 | XN_FLAG_FN_ALIGN) | ||
| 229 | 392 | ||
| 230 | typedef struct X509_revoked_st | 393 | typedef struct X509_revoked_st |
| 231 | { | 394 | { |
| 232 | ASN1_INTEGER *serialNumber; | 395 | ASN1_INTEGER *serialNumber; |
| 233 | ASN1_UTCTIME *revocationDate; | 396 | ASN1_TIME *revocationDate; |
| 234 | STACK /* optional X509_EXTENSION */ *extensions; | 397 | STACK_OF(X509_EXTENSION) /* optional */ *extensions; |
| 235 | int sequence; /* load sequence */ | 398 | int sequence; /* load sequence */ |
| 236 | } X509_REVOKED; | 399 | } X509_REVOKED; |
| 237 | 400 | ||
| 401 | DECLARE_STACK_OF(X509_REVOKED) | ||
| 402 | DECLARE_ASN1_SET_OF(X509_REVOKED) | ||
| 403 | |||
| 238 | typedef struct X509_crl_info_st | 404 | typedef struct X509_crl_info_st |
| 239 | { | 405 | { |
| 240 | ASN1_INTEGER *version; | 406 | ASN1_INTEGER *version; |
| 241 | X509_ALGOR *sig_alg; | 407 | X509_ALGOR *sig_alg; |
| 242 | X509_NAME *issuer; | 408 | X509_NAME *issuer; |
| 243 | ASN1_UTCTIME *lastUpdate; | 409 | ASN1_TIME *lastUpdate; |
| 244 | ASN1_UTCTIME *nextUpdate; | 410 | ASN1_TIME *nextUpdate; |
| 245 | STACK /* X509_REVOKED */ *revoked; | 411 | STACK_OF(X509_REVOKED) *revoked; |
| 246 | STACK /* [0] X509_EXTENSION */ *extensions; | 412 | STACK_OF(X509_EXTENSION) /* [0] */ *extensions; |
| 247 | } X509_CRL_INFO; | 413 | } X509_CRL_INFO; |
| 248 | 414 | ||
| 249 | typedef struct X509_crl_st | 415 | struct X509_crl_st |
| 250 | { | 416 | { |
| 251 | /* actual signature */ | 417 | /* actual signature */ |
| 252 | X509_CRL_INFO *crl; | 418 | X509_CRL_INFO *crl; |
| 253 | X509_ALGOR *sig_alg; | 419 | X509_ALGOR *sig_alg; |
| 254 | ASN1_BIT_STRING *signature; | 420 | ASN1_BIT_STRING *signature; |
| 255 | int references; | 421 | int references; |
| 256 | } X509_CRL; | 422 | } /* X509_CRL */; |
| 257 | 423 | ||
| 258 | /* a sequence of these are used */ | 424 | DECLARE_STACK_OF(X509_CRL) |
| 259 | typedef struct x509_attributes_st | 425 | 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 | 426 | ||
| 270 | typedef struct private_key_st | 427 | typedef struct private_key_st |
| 271 | { | 428 | { |
| @@ -288,7 +445,7 @@ typedef struct private_key_st | |||
| 288 | int references; | 445 | int references; |
| 289 | } X509_PKEY; | 446 | } X509_PKEY; |
| 290 | 447 | ||
| 291 | #ifdef HEADER_ENVELOPE_H | 448 | #ifndef OPENSSL_NO_EVP |
| 292 | typedef struct X509_info_st | 449 | typedef struct X509_info_st |
| 293 | { | 450 | { |
| 294 | X509 *x509; | 451 | X509 *x509; |
| @@ -301,11 +458,13 @@ typedef struct X509_info_st | |||
| 301 | 458 | ||
| 302 | int references; | 459 | int references; |
| 303 | } X509_INFO; | 460 | } X509_INFO; |
| 461 | |||
| 462 | DECLARE_STACK_OF(X509_INFO) | ||
| 304 | #endif | 463 | #endif |
| 305 | 464 | ||
| 306 | /* The next 2 structures and their 8 routines were sent to me by | 465 | /* The next 2 structures and their 8 routines were sent to me by |
| 307 | * Pat Richard <patr@x509.com> and are used to manipulate | 466 | * Pat Richard <patr@x509.com> and are used to manipulate |
| 308 | * Netscapes spki strucutres - usefull if you are writing a CA web page | 467 | * Netscapes spki structures - useful if you are writing a CA web page |
| 309 | */ | 468 | */ |
| 310 | typedef struct Netscape_spkac_st | 469 | typedef struct Netscape_spkac_st |
| 311 | { | 470 | { |
| @@ -320,17 +479,65 @@ typedef struct Netscape_spki_st | |||
| 320 | ASN1_BIT_STRING *signature; | 479 | ASN1_BIT_STRING *signature; |
| 321 | } NETSCAPE_SPKI; | 480 | } NETSCAPE_SPKI; |
| 322 | 481 | ||
| 323 | #ifndef HEADER_BN_H | 482 | /* Netscape certificate sequence structure */ |
| 324 | #define BIGNUM char | 483 | typedef struct Netscape_certificate_sequence |
| 325 | #endif | 484 | { |
| 485 | ASN1_OBJECT *type; | ||
| 486 | STACK_OF(X509) *certs; | ||
| 487 | } NETSCAPE_CERT_SEQUENCE; | ||
| 326 | 488 | ||
| 327 | typedef struct CBCParameter_st | 489 | typedef struct CBCParameter_st |
| 328 | { | 490 | { |
| 329 | unsigned char iv[8]; | 491 | unsigned char iv[8]; |
| 330 | } CBC_PARAM; | 492 | } CBC_PARAM; |
| 331 | 493 | ||
| 332 | #include "x509_vfy.h" | 494 | /* Password based encryption structure */ |
| 333 | #include "pkcs7.h" | 495 | |
| 496 | typedef struct PBEPARAM_st { | ||
| 497 | ASN1_OCTET_STRING *salt; | ||
| 498 | ASN1_INTEGER *iter; | ||
| 499 | } PBEPARAM; | ||
| 500 | |||
| 501 | /* Password based encryption V2 structures */ | ||
| 502 | |||
| 503 | typedef struct PBE2PARAM_st { | ||
| 504 | X509_ALGOR *keyfunc; | ||
| 505 | X509_ALGOR *encryption; | ||
| 506 | } PBE2PARAM; | ||
| 507 | |||
| 508 | typedef struct PBKDF2PARAM_st { | ||
| 509 | ASN1_TYPE *salt; /* Usually OCTET STRING but could be anything */ | ||
| 510 | ASN1_INTEGER *iter; | ||
| 511 | ASN1_INTEGER *keylength; | ||
| 512 | X509_ALGOR *prf; | ||
| 513 | } PBKDF2PARAM; | ||
| 514 | |||
| 515 | |||
| 516 | /* PKCS#8 private key info structure */ | ||
| 517 | |||
| 518 | typedef struct pkcs8_priv_key_info_st | ||
| 519 | { | ||
| 520 | int broken; /* Flag for various broken formats */ | ||
| 521 | #define PKCS8_OK 0 | ||
| 522 | #define PKCS8_NO_OCTET 1 | ||
| 523 | #define PKCS8_EMBEDDED_PARAM 2 | ||
| 524 | #define PKCS8_NS_DB 3 | ||
| 525 | ASN1_INTEGER *version; | ||
| 526 | X509_ALGOR *pkeyalg; | ||
| 527 | ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ | ||
| 528 | STACK_OF(X509_ATTRIBUTE) *attributes; | ||
| 529 | } PKCS8_PRIV_KEY_INFO; | ||
| 530 | |||
| 531 | #ifdef __cplusplus | ||
| 532 | } | ||
| 533 | #endif | ||
| 534 | |||
| 535 | #include <openssl/x509_vfy.h> | ||
| 536 | #include <openssl/pkcs7.h> | ||
| 537 | |||
| 538 | #ifdef __cplusplus | ||
| 539 | extern "C" { | ||
| 540 | #endif | ||
| 334 | 541 | ||
| 335 | #ifdef SSLEAY_MACROS | 542 | #ifdef SSLEAY_MACROS |
| 336 | #define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ | 543 | #define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ |
| @@ -355,6 +562,9 @@ typedef struct CBCParameter_st | |||
| 355 | 562 | ||
| 356 | #define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ | 563 | #define X509_dup(x509) (X509 *)ASN1_dup((int (*)())i2d_X509, \ |
| 357 | (char *(*)())d2i_X509,(char *)x509) | 564 | (char *(*)())d2i_X509,(char *)x509) |
| 565 | #define X509_ATTRIBUTE_dup(xa) (X509_ATTRIBUTE *)ASN1_dup(\ | ||
| 566 | (int (*)())i2d_X509_ATTRIBUTE, \ | ||
| 567 | (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa) | ||
| 358 | #define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ | 568 | #define X509_EXTENSION_dup(ex) (X509_EXTENSION *)ASN1_dup( \ |
| 359 | (int (*)())i2d_X509_EXTENSION, \ | 569 | (int (*)())i2d_X509_EXTENSION, \ |
| 360 | (char *(*)())d2i_X509_EXTENSION,(char *)ex) | 570 | (char *(*)())d2i_X509_EXTENSION,(char *)ex) |
| @@ -442,6 +652,9 @@ typedef struct CBCParameter_st | |||
| 442 | #define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ | 652 | #define i2d_DSAPrivateKey_bio(bp,dsa) ASN1_i2d_bio(i2d_DSAPrivateKey,bp, \ |
| 443 | (unsigned char *)dsa) | 653 | (unsigned char *)dsa) |
| 444 | 654 | ||
| 655 | #define X509_ALGOR_dup(xn) (X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,\ | ||
| 656 | (char *(*)())d2i_X509_ALGOR,(char *)xn) | ||
| 657 | |||
| 445 | #define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ | 658 | #define X509_NAME_dup(xn) (X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, \ |
| 446 | (char *(*)())d2i_X509_NAME,(char *)xn) | 659 | (char *(*)())d2i_X509_NAME,(char *)xn) |
| 447 | #define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ | 660 | #define X509_NAME_ENTRY_dup(ne) (X509_NAME_ENTRY *)ASN1_dup( \ |
| @@ -453,10 +666,12 @@ typedef struct CBCParameter_st | |||
| 453 | ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) | 666 | ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len) |
| 454 | #define X509_NAME_digest(data,type,md,len) \ | 667 | #define X509_NAME_digest(data,type,md,len) \ |
| 455 | ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) | 668 | ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len) |
| 669 | #ifndef PKCS7_ISSUER_AND_SERIAL_digest | ||
| 456 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ | 670 | #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \ |
| 457 | ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ | 671 | ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\ |
| 458 | (char *)data,md,len) | 672 | (char *)data,md,len) |
| 459 | #endif | 673 | #endif |
| 674 | #endif | ||
| 460 | 675 | ||
| 461 | #define X509_EXT_PACK_UNKNOWN 1 | 676 | #define X509_EXT_PACK_UNKNOWN 1 |
| 462 | #define X509_EXT_PACK_STRING 2 | 677 | #define X509_EXT_PACK_STRING 2 |
| @@ -472,193 +687,225 @@ typedef struct CBCParameter_st | |||
| 472 | #define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) | 687 | #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)) | 688 | #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) |
| 474 | 689 | ||
| 690 | #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) | ||
| 691 | #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) | ||
| 692 | #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) | ||
| 693 | #define X509_CRL_get_issuer(x) ((x)->crl->issuer) | ||
| 694 | #define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) | ||
| 695 | |||
| 475 | /* This one is only used so that a binary form can output, as in | 696 | /* This one is only used so that a binary form can output, as in |
| 476 | * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ | 697 | * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ |
| 477 | #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) | 698 | #define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) |
| 478 | 699 | ||
| 479 | #ifndef NOPROTO | 700 | |
| 701 | const char *X509_verify_cert_error_string(long n); | ||
| 480 | 702 | ||
| 481 | #ifndef SSLEAY_MACROS | 703 | #ifndef SSLEAY_MACROS |
| 482 | #ifdef HEADER_ENVELOPE_H | 704 | #ifndef OPENSSL_NO_EVP |
| 483 | int X509_verify(X509 *a, EVP_PKEY *r); | 705 | int X509_verify(X509 *a, EVP_PKEY *r); |
| 484 | char *X509_verify_cert_error_string(long n); | ||
| 485 | 706 | ||
| 486 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); | 707 | int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); |
| 487 | int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); | 708 | int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); |
| 488 | int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); | 709 | int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); |
| 489 | 710 | ||
| 490 | int X509_sign(X509 *x, EVP_PKEY *pkey, EVP_MD *md); | 711 | NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len); |
| 491 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, EVP_MD *md); | 712 | char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); |
| 492 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, EVP_MD *md); | 713 | EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); |
| 493 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, EVP_MD *md); | 714 | int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); |
| 494 | 715 | ||
| 495 | int X509_digest(X509 *data,EVP_MD *type,unsigned char *md,unsigned int *len); | 716 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); |
| 496 | int X509_NAME_digest(X509_NAME *data,EVP_MD *type, | 717 | |
| 497 | unsigned char *md,unsigned int *len); | 718 | int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); |
| 719 | |||
| 720 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); | ||
| 721 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); | ||
| 722 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); | ||
| 723 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); | ||
| 724 | |||
| 725 | int X509_pubkey_digest(const X509 *data,const EVP_MD *type, | ||
| 726 | unsigned char *md, unsigned int *len); | ||
| 727 | int X509_digest(const X509 *data,const EVP_MD *type, | ||
| 728 | unsigned char *md, unsigned int *len); | ||
| 729 | int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, | ||
| 730 | unsigned char *md, unsigned int *len); | ||
| 731 | int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type, | ||
| 732 | unsigned char *md, unsigned int *len); | ||
| 733 | int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type, | ||
| 734 | unsigned char *md, unsigned int *len); | ||
| 498 | #endif | 735 | #endif |
| 499 | 736 | ||
| 500 | #ifndef NO_FP_API | 737 | #ifndef OPENSSL_NO_FP_API |
| 501 | X509 *d2i_X509_fp(FILE *fp, X509 *x509); | 738 | X509 *d2i_X509_fp(FILE *fp, X509 **x509); |
| 502 | int i2d_X509_fp(FILE *fp,X509 *x509); | 739 | int i2d_X509_fp(FILE *fp,X509 *x509); |
| 503 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL *crl); | 740 | X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); |
| 504 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); | 741 | int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); |
| 505 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ *req); | 742 | X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); |
| 506 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); | 743 | int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); |
| 507 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA *rsa); | 744 | #ifndef OPENSSL_NO_RSA |
| 745 | RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); | ||
| 508 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); | 746 | int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); |
| 509 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | 747 | 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); | 748 | int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); |
| 749 | RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); | ||
| 750 | int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); | ||
| 751 | #endif | ||
| 752 | #ifndef OPENSSL_NO_DSA | ||
| 753 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); | ||
| 754 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); | ||
| 755 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); | ||
| 756 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | ||
| 757 | #endif | ||
| 758 | X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); | ||
| 759 | int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); | ||
| 760 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, | ||
| 761 | PKCS8_PRIV_KEY_INFO **p8inf); | ||
| 762 | int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); | ||
| 763 | int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); | ||
| 764 | int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); | ||
| 765 | EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); | ||
| 766 | int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); | ||
| 767 | EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); | ||
| 513 | #endif | 768 | #endif |
| 514 | 769 | ||
| 515 | #ifdef HEADER_BIO_H | 770 | #ifndef OPENSSL_NO_BIO |
| 516 | X509 *d2i_X509_bio(BIO *bp,X509 *x509); | 771 | X509 *d2i_X509_bio(BIO *bp,X509 **x509); |
| 517 | int i2d_X509_bio(BIO *bp,X509 *x509); | 772 | int i2d_X509_bio(BIO *bp,X509 *x509); |
| 518 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL *crl); | 773 | X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); |
| 519 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); | 774 | int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); |
| 520 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ *req); | 775 | X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); |
| 521 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); | 776 | int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); |
| 522 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA *rsa); | 777 | #ifndef OPENSSL_NO_RSA |
| 778 | RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); | ||
| 523 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); | 779 | int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); |
| 524 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA *dsa); | 780 | 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); | 781 | int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); |
| 782 | RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); | ||
| 783 | int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); | ||
| 784 | #endif | ||
| 785 | #ifndef OPENSSL_NO_DSA | ||
| 786 | DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); | ||
| 787 | int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); | ||
| 788 | DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); | ||
| 789 | int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); | ||
| 790 | #endif | ||
| 791 | X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); | ||
| 792 | int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); | ||
| 793 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, | ||
| 794 | PKCS8_PRIV_KEY_INFO **p8inf); | ||
| 795 | int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); | ||
| 796 | int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); | ||
| 797 | int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); | ||
| 798 | EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); | ||
| 799 | int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); | ||
| 800 | EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); | ||
| 528 | #endif | 801 | #endif |
| 529 | 802 | ||
| 530 | X509 *X509_dup(X509 *x509); | 803 | X509 *X509_dup(X509 *x509); |
| 804 | X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); | ||
| 531 | X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); | 805 | X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); |
| 532 | X509_CRL *X509_CRL_dup(X509_CRL *crl); | 806 | X509_CRL *X509_CRL_dup(X509_CRL *crl); |
| 533 | X509_REQ *X509_REQ_dup(X509_REQ *req); | 807 | X509_REQ *X509_REQ_dup(X509_REQ *req); |
| 808 | X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); | ||
| 534 | X509_NAME *X509_NAME_dup(X509_NAME *xn); | 809 | X509_NAME *X509_NAME_dup(X509_NAME *xn); |
| 535 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); | 810 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); |
| 811 | #ifndef OPENSSL_NO_RSA | ||
| 536 | RSA *RSAPublicKey_dup(RSA *rsa); | 812 | RSA *RSAPublicKey_dup(RSA *rsa); |
| 537 | RSA *RSAPrivateKey_dup(RSA *rsa); | 813 | RSA *RSAPrivateKey_dup(RSA *rsa); |
| 814 | #endif | ||
| 538 | 815 | ||
| 539 | #endif /* !SSLEAY_MACROS */ | 816 | #endif /* !SSLEAY_MACROS */ |
| 540 | 817 | ||
| 541 | int X509_cmp_current_time(ASN1_UTCTIME *s); | 818 | int X509_cmp_time(ASN1_TIME *s, time_t *t); |
| 542 | ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj); | 819 | int X509_cmp_current_time(ASN1_TIME *s); |
| 820 | ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t); | ||
| 821 | ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj); | ||
| 543 | 822 | ||
| 544 | char * X509_get_default_cert_area(void ); | 823 | const char * X509_get_default_cert_area(void ); |
| 545 | char * X509_get_default_cert_dir(void ); | 824 | const char * X509_get_default_cert_dir(void ); |
| 546 | char * X509_get_default_cert_file(void ); | 825 | const char * X509_get_default_cert_file(void ); |
| 547 | char * X509_get_default_cert_dir_env(void ); | 826 | const char * X509_get_default_cert_dir_env(void ); |
| 548 | char * X509_get_default_cert_file_env(void ); | 827 | const char * X509_get_default_cert_file_env(void ); |
| 549 | char * X509_get_default_private_dir(void ); | 828 | const char * X509_get_default_private_dir(void ); |
| 550 | 829 | ||
| 551 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md); | 830 | X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
| 552 | 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); |
| 553 | void ERR_load_X509_strings(void ); | ||
| 554 | 832 | ||
| 555 | X509_ALGOR * X509_ALGOR_new(void ); | 833 | DECLARE_ASN1_FUNCTIONS(X509_ALGOR) |
| 556 | void X509_ALGOR_free(X509_ALGOR *a); | 834 | DECLARE_ASN1_FUNCTIONS(X509_VAL) |
| 557 | int i2d_X509_ALGOR(X509_ALGOR *a,unsigned char **pp); | ||
| 558 | X509_ALGOR * d2i_X509_ALGOR(X509_ALGOR **a,unsigned char **pp, | ||
| 559 | long length); | ||
| 560 | 835 | ||
| 561 | X509_VAL * X509_VAL_new(void ); | 836 | DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) |
| 562 | void X509_VAL_free(X509_VAL *a); | ||
| 563 | int i2d_X509_VAL(X509_VAL *a,unsigned char **pp); | ||
| 564 | X509_VAL * d2i_X509_VAL(X509_VAL **a,unsigned char **pp, | ||
| 565 | long length); | ||
| 566 | 837 | ||
| 567 | X509_PUBKEY * X509_PUBKEY_new(void ); | ||
| 568 | void X509_PUBKEY_free(X509_PUBKEY *a); | ||
| 569 | int i2d_X509_PUBKEY(X509_PUBKEY *a,unsigned char **pp); | ||
| 570 | X509_PUBKEY * d2i_X509_PUBKEY(X509_PUBKEY **a,unsigned char **pp, | ||
| 571 | long length); | ||
| 572 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); | 838 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); |
| 573 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); | 839 | EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); |
| 574 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK *chain); | 840 | int X509_get_pubkey_parameters(EVP_PKEY *pkey, |
| 575 | 841 | STACK_OF(X509) *chain); | |
| 576 | 842 | int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); | |
| 577 | X509_SIG * X509_SIG_new(void ); | 843 | EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, |
| 578 | void X509_SIG_free(X509_SIG *a); | ||
| 579 | int i2d_X509_SIG(X509_SIG *a,unsigned char **pp); | ||
| 580 | X509_SIG * d2i_X509_SIG(X509_SIG **a,unsigned char **pp,long length); | ||
| 581 | |||
| 582 | X509_REQ_INFO *X509_REQ_INFO_new(void); | ||
| 583 | void X509_REQ_INFO_free(X509_REQ_INFO *a); | ||
| 584 | int i2d_X509_REQ_INFO(X509_REQ_INFO *a,unsigned char **pp); | ||
| 585 | X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a,unsigned char **pp, | ||
| 586 | long length); | 844 | long length); |
| 845 | #ifndef OPENSSL_NO_RSA | ||
| 846 | int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); | ||
| 847 | RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, | ||
| 848 | long length); | ||
| 849 | #endif | ||
| 850 | #ifndef OPENSSL_NO_DSA | ||
| 851 | int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); | ||
| 852 | DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, | ||
| 853 | long length); | ||
| 854 | #endif | ||
| 587 | 855 | ||
| 588 | X509_REQ * X509_REQ_new(void); | 856 | DECLARE_ASN1_FUNCTIONS(X509_SIG) |
| 589 | void X509_REQ_free(X509_REQ *a); | 857 | DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) |
| 590 | int i2d_X509_REQ(X509_REQ *a,unsigned char **pp); | 858 | DECLARE_ASN1_FUNCTIONS(X509_REQ) |
| 591 | X509_REQ * d2i_X509_REQ(X509_REQ **a,unsigned char **pp,long length); | ||
| 592 | 859 | ||
| 593 | X509_ATTRIBUTE *X509_ATTRIBUTE_new(void ); | 860 | DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) |
| 594 | void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a); | 861 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); |
| 595 | int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp); | ||
| 596 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp, | ||
| 597 | long length); | ||
| 598 | 862 | ||
| 599 | X509_EXTENSION *X509_EXTENSION_new(void ); | 863 | DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) |
| 600 | void X509_EXTENSION_free(X509_EXTENSION *a); | ||
| 601 | int i2d_X509_EXTENSION(X509_EXTENSION *a,unsigned char **pp); | ||
| 602 | X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a,unsigned char **pp, | ||
| 603 | long length); | ||
| 604 | 864 | ||
| 605 | X509_NAME_ENTRY *X509_NAME_ENTRY_new(void); | 865 | DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) |
| 606 | void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a); | 866 | |
| 607 | int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a,unsigned char **pp); | 867 | DECLARE_ASN1_FUNCTIONS(X509_NAME) |
| 608 | X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a,unsigned char **pp, | ||
| 609 | long length); | ||
| 610 | 868 | ||
| 611 | X509_NAME * X509_NAME_new(void); | ||
| 612 | void X509_NAME_free(X509_NAME *a); | ||
| 613 | int i2d_X509_NAME(X509_NAME *a,unsigned char **pp); | ||
| 614 | X509_NAME * d2i_X509_NAME(X509_NAME **a,unsigned char **pp,long length); | ||
| 615 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name); | 869 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name); |
| 616 | 870 | ||
| 871 | DECLARE_ASN1_FUNCTIONS(X509_CINF) | ||
| 617 | 872 | ||
| 618 | X509_CINF * X509_CINF_new(void); | 873 | DECLARE_ASN1_FUNCTIONS(X509) |
| 619 | void X509_CINF_free(X509_CINF *a); | 874 | DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) |
| 620 | int i2d_X509_CINF(X509_CINF *a,unsigned char **pp); | ||
| 621 | X509_CINF * d2i_X509_CINF(X509_CINF **a,unsigned char **pp,long length); | ||
| 622 | 875 | ||
| 623 | X509 * X509_new(void); | 876 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
| 624 | void X509_free(X509 *a); | 877 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
| 625 | int i2d_X509(X509 *a,unsigned char **pp); | 878 | int X509_set_ex_data(X509 *r, int idx, void *arg); |
| 626 | X509 * d2i_X509(X509 **a,unsigned char **pp,long length); | 879 | void *X509_get_ex_data(X509 *r, int idx); |
| 880 | int i2d_X509_AUX(X509 *a,unsigned char **pp); | ||
| 881 | X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length); | ||
| 627 | 882 | ||
| 628 | X509_REVOKED * X509_REVOKED_new(void); | 883 | int X509_alias_set1(X509 *x, unsigned char *name, int len); |
| 629 | void X509_REVOKED_free(X509_REVOKED *a); | 884 | int X509_keyid_set1(X509 *x, unsigned char *id, int len); |
| 630 | int i2d_X509_REVOKED(X509_REVOKED *a,unsigned char **pp); | 885 | unsigned char * X509_alias_get0(X509 *x, int *len); |
| 631 | X509_REVOKED * d2i_X509_REVOKED(X509_REVOKED **a,unsigned char **pp,long length); | 886 | int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); |
| 887 | int X509_TRUST_set(int *t, int trust); | ||
| 888 | int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); | ||
| 889 | int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); | ||
| 890 | void X509_trust_clear(X509 *x); | ||
| 891 | void X509_reject_clear(X509 *x); | ||
| 632 | 892 | ||
| 633 | X509_CRL_INFO *X509_CRL_INFO_new(void); | 893 | DECLARE_ASN1_FUNCTIONS(X509_REVOKED) |
| 634 | void X509_CRL_INFO_free(X509_CRL_INFO *a); | 894 | DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) |
| 635 | int i2d_X509_CRL_INFO(X509_CRL_INFO *a,unsigned char **pp); | 895 | DECLARE_ASN1_FUNCTIONS(X509_CRL) |
| 636 | X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a,unsigned char **pp, | ||
| 637 | long length); | ||
| 638 | 896 | ||
| 639 | X509_CRL * X509_CRL_new(void); | 897 | int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); |
| 640 | void X509_CRL_free(X509_CRL *a); | ||
| 641 | int i2d_X509_CRL(X509_CRL *a,unsigned char **pp); | ||
| 642 | X509_CRL * d2i_X509_CRL(X509_CRL **a,unsigned char **pp,long length); | ||
| 643 | 898 | ||
| 644 | X509_PKEY * X509_PKEY_new(void ); | 899 | X509_PKEY * X509_PKEY_new(void ); |
| 645 | void X509_PKEY_free(X509_PKEY *a); | 900 | void X509_PKEY_free(X509_PKEY *a); |
| 646 | int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); | 901 | int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); |
| 647 | 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); |
| 648 | 903 | ||
| 649 | NETSCAPE_SPKI * NETSCAPE_SPKI_new(void ); | 904 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) |
| 650 | void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a); | 905 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) |
| 651 | int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a,unsigned char **pp); | 906 | DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) |
| 652 | NETSCAPE_SPKI * d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a,unsigned char **pp, | ||
| 653 | long length); | ||
| 654 | 907 | ||
| 655 | NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void ); | 908 | #ifndef OPENSSL_NO_EVP |
| 656 | void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a); | ||
| 657 | int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a,unsigned char **pp); | ||
| 658 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a,unsigned char **pp, | ||
| 659 | long length); | ||
| 660 | |||
| 661 | #ifdef HEADER_ENVELOPE_H | ||
| 662 | X509_INFO * X509_INFO_new(void); | 909 | X509_INFO * X509_INFO_new(void); |
| 663 | void X509_INFO_free(X509_INFO *a); | 910 | void X509_INFO_free(X509_INFO *a); |
| 664 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | 911 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); |
| @@ -666,12 +913,22 @@ char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | |||
| 666 | int ASN1_verify(int (*i2d)(), X509_ALGOR *algor1, | 913 | int ASN1_verify(int (*i2d)(), X509_ALGOR *algor1, |
| 667 | ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); | 914 | ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); |
| 668 | 915 | ||
| 669 | int ASN1_digest(int (*i2d)(),EVP_MD *type,char *data, | 916 | int ASN1_digest(int (*i2d)(),const EVP_MD *type,char *data, |
| 670 | unsigned char *md,unsigned int *len); | 917 | unsigned char *md,unsigned int *len); |
| 671 | 918 | ||
| 672 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | 919 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, |
| 673 | ASN1_BIT_STRING *signature, | 920 | ASN1_BIT_STRING *signature, |
| 674 | char *data,EVP_PKEY *pkey, 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); | ||
| 675 | #endif | 932 | #endif |
| 676 | 933 | ||
| 677 | int X509_set_version(X509 *x,long version); | 934 | int X509_set_version(X509 *x,long version); |
| @@ -681,40 +938,83 @@ int X509_set_issuer_name(X509 *x, X509_NAME *name); | |||
| 681 | X509_NAME * X509_get_issuer_name(X509 *a); | 938 | X509_NAME * X509_get_issuer_name(X509 *a); |
| 682 | int X509_set_subject_name(X509 *x, X509_NAME *name); | 939 | int X509_set_subject_name(X509 *x, X509_NAME *name); |
| 683 | X509_NAME * X509_get_subject_name(X509 *a); | 940 | X509_NAME * X509_get_subject_name(X509 *a); |
| 684 | int X509_set_notBefore(X509 *x, ASN1_UTCTIME *tm); | 941 | int X509_set_notBefore(X509 *x, ASN1_TIME *tm); |
| 685 | int X509_set_notAfter(X509 *x, ASN1_UTCTIME *tm); | 942 | int X509_set_notAfter(X509 *x, ASN1_TIME *tm); |
| 686 | int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); | 943 | int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); |
| 687 | 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); | ||
| 688 | int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); | 946 | int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); |
| 689 | 947 | ||
| 690 | int X509_REQ_set_version(X509_REQ *x,long version); | 948 | int X509_REQ_set_version(X509_REQ *x,long version); |
| 691 | int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); | 949 | int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); |
| 692 | int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); | 950 | int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); |
| 693 | EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); | 951 | EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); |
| 952 | int X509_REQ_extension_nid(int nid); | ||
| 953 | int * X509_REQ_get_extension_nids(void); | ||
| 954 | void X509_REQ_set_extension_nids(int *nids); | ||
| 955 | STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); | ||
| 956 | int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, | ||
| 957 | int nid); | ||
| 958 | int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); | ||
| 959 | int X509_REQ_get_attr_count(const X509_REQ *req); | ||
| 960 | int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, | ||
| 961 | int lastpos); | ||
| 962 | int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, | ||
| 963 | int lastpos); | ||
| 964 | X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); | ||
| 965 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); | ||
| 966 | int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); | ||
| 967 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, | ||
| 968 | const ASN1_OBJECT *obj, int type, | ||
| 969 | const unsigned char *bytes, int len); | ||
| 970 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, | ||
| 971 | int nid, int type, | ||
| 972 | const unsigned char *bytes, int len); | ||
| 973 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, | ||
| 974 | const char *attrname, int type, | ||
| 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); | ||
| 694 | 985 | ||
| 695 | int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); | 986 | int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); |
| 696 | 987 | ||
| 697 | int X509_issuer_and_serial_cmp(X509 *a, X509 *b); | 988 | int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); |
| 698 | unsigned long X509_issuer_and_serial_hash(X509 *a); | 989 | unsigned long X509_issuer_and_serial_hash(X509 *a); |
| 699 | 990 | ||
| 700 | int X509_issuer_name_cmp(X509 *a, X509 *b); | 991 | int X509_issuer_name_cmp(const X509 *a, const X509 *b); |
| 701 | unsigned long X509_issuer_name_hash(X509 *a); | 992 | unsigned long X509_issuer_name_hash(X509 *a); |
| 702 | 993 | ||
| 703 | int X509_subject_name_cmp(X509 *a,X509 *b); | 994 | int X509_subject_name_cmp(const X509 *a, const X509 *b); |
| 704 | unsigned long X509_subject_name_hash(X509 *x); | 995 | unsigned long X509_subject_name_hash(X509 *x); |
| 705 | 996 | ||
| 706 | int X509_NAME_cmp (X509_NAME *a, X509_NAME *b); | 997 | int X509_cmp(const X509 *a, const X509 *b); |
| 998 | int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); | ||
| 707 | unsigned long X509_NAME_hash(X509_NAME *x); | 999 | unsigned long X509_NAME_hash(X509_NAME *x); |
| 708 | 1000 | ||
| 709 | int X509_CRL_cmp(X509_CRL *a,X509_CRL *b); | 1001 | int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); |
| 710 | #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); | ||
| 711 | int X509_print_fp(FILE *bp,X509 *x); | 1004 | int X509_print_fp(FILE *bp,X509 *x); |
| 1005 | int X509_CRL_print_fp(FILE *bp,X509_CRL *x); | ||
| 712 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); | 1006 | int X509_REQ_print_fp(FILE *bp,X509_REQ *req); |
| 1007 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); | ||
| 713 | #endif | 1008 | #endif |
| 714 | 1009 | ||
| 715 | #ifdef HEADER_BIO_H | 1010 | #ifndef OPENSSL_NO_BIO |
| 716 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); | 1011 | int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); |
| 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); | ||
| 717 | int X509_print(BIO *bp,X509 *x); | 1014 | int X509_print(BIO *bp,X509 *x); |
| 1015 | int X509_ocspid_print(BIO *bp,X509 *x); | ||
| 1016 | int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); | ||
| 1017 | int X509_CRL_print(BIO *bp,X509_CRL *x); | ||
| 718 | int X509_REQ_print(BIO *bp,X509_REQ *req); | 1018 | int X509_REQ_print(BIO *bp,X509_REQ *req); |
| 719 | #endif | 1019 | #endif |
| 720 | 1020 | ||
| @@ -725,7 +1025,7 @@ int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, | |||
| 725 | char *buf,int len); | 1025 | char *buf,int len); |
| 726 | 1026 | ||
| 727 | /* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use | 1027 | /* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use |
| 728 | * lastpos, seach after that position on. */ | 1028 | * lastpos, search after that position on. */ |
| 729 | int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); | 1029 | int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); |
| 730 | int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, | 1030 | int X509_NAME_get_index_by_OBJ(X509_NAME *name,ASN1_OBJECT *obj, |
| 731 | int lastpos); | 1031 | int lastpos); |
| @@ -733,8 +1033,16 @@ X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); | |||
| 733 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); | 1033 | X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); |
| 734 | int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, | 1034 | int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, |
| 735 | int loc, int set); | 1035 | int loc, int set); |
| 1036 | int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, | ||
| 1037 | unsigned char *bytes, int len, int loc, int set); | ||
| 1038 | int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, | ||
| 1039 | unsigned char *bytes, int len, int loc, int set); | ||
| 1040 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, | ||
| 1041 | char *field, int type, unsigned char *bytes, int len); | ||
| 736 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, | 1042 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, |
| 737 | int type,unsigned char *bytes, int len); | 1043 | int type,unsigned char *bytes, int len); |
| 1044 | int X509_NAME_add_entry_by_txt(X509_NAME *name, char *field, int type, | ||
| 1045 | unsigned char *bytes, int len, int loc, int set); | ||
| 738 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, | 1046 | X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, |
| 739 | ASN1_OBJECT *obj, int type,unsigned char *bytes, | 1047 | ASN1_OBJECT *obj, int type,unsigned char *bytes, |
| 740 | int len); | 1048 | int len); |
| @@ -745,18 +1053,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); | 1053 | ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); |
| 746 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); | 1054 | ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); |
| 747 | 1055 | ||
| 748 | int X509v3_get_ext_count(STACK *x); | 1056 | int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); |
| 749 | int X509v3_get_ext_by_NID(STACK *x, int nid, int lastpos); | 1057 | 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); | 1058 | int nid, int lastpos); |
| 751 | int X509v3_get_ext_by_critical(STACK *x, int crit, int lastpos); | 1059 | int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, |
| 752 | X509_EXTENSION *X509v3_get_ext(STACK *x, int loc); | 1060 | ASN1_OBJECT *obj,int lastpos); |
| 753 | X509_EXTENSION *X509v3_delete_ext(STACK *x, int loc); | 1061 | int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, |
| 754 | STACK * X509v3_add_ext(STACK **x, X509_EXTENSION *ex, int loc); | 1062 | int crit, int lastpos); |
| 755 | 1063 | X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); | |
| 756 | int X509v3_data_type_by_OBJ(ASN1_OBJECT *obj); | 1064 | X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); |
| 757 | int X509v3_data_type_by_NID(int nid); | 1065 | STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, |
| 758 | int X509v3_pack_type_by_OBJ(ASN1_OBJECT *obj); | 1066 | X509_EXTENSION *ex, int loc); |
| 759 | int X509v3_pack_type_by_NID(int nid); | ||
| 760 | 1067 | ||
| 761 | int X509_get_ext_count(X509 *x); | 1068 | int X509_get_ext_count(X509 *x); |
| 762 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); | 1069 | int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); |
| @@ -765,6 +1072,9 @@ int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); | |||
| 765 | X509_EXTENSION *X509_get_ext(X509 *x, int loc); | 1072 | X509_EXTENSION *X509_get_ext(X509 *x, int loc); |
| 766 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); | 1073 | X509_EXTENSION *X509_delete_ext(X509 *x, int loc); |
| 767 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); | 1074 | int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); |
| 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); | ||
| 768 | 1078 | ||
| 769 | int X509_CRL_get_ext_count(X509_CRL *x); | 1079 | int X509_CRL_get_ext_count(X509_CRL *x); |
| 770 | 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); |
| @@ -773,6 +1083,9 @@ int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); | |||
| 773 | X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); | 1083 | X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); |
| 774 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); | 1084 | X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); |
| 775 | 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); |
| 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); | ||
| 776 | 1089 | ||
| 777 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); | 1090 | int X509_REVOKED_get_ext_count(X509_REVOKED *x); |
| 778 | 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); |
| @@ -781,6 +1094,9 @@ int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); | |||
| 781 | X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); | 1094 | X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); |
| 782 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); | 1095 | X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); |
| 783 | 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); |
| 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); | ||
| 784 | 1100 | ||
| 785 | X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, | 1101 | X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, |
| 786 | int nid, int crit, ASN1_OCTET_STRING *data); | 1102 | int nid, int crit, ASN1_OCTET_STRING *data); |
| @@ -793,311 +1109,80 @@ int X509_EXTENSION_set_data(X509_EXTENSION *ex, | |||
| 793 | ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); | 1109 | ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); |
| 794 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); | 1110 | ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); |
| 795 | int X509_EXTENSION_get_critical(X509_EXTENSION *ex); | 1111 | 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 | 1112 | ||
| 801 | int X509_verify_cert(X509_STORE_CTX *ctx); | 1113 | int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); |
| 802 | 1114 | int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, | |
| 803 | /* lookup a cert from a X509 STACK */ | 1115 | int lastpos); |
| 804 | X509 *X509_find_by_issuer_and_serial(STACK *sk,X509_NAME *name, | 1116 | int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, |
| 805 | ASN1_INTEGER *serial); | 1117 | int lastpos); |
| 806 | X509 *X509_find_by_subject(STACK *sk,X509_NAME *name); | 1118 | X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); |
| 807 | 1119 | X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); | |
| 808 | #else | 1120 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, |
| 809 | 1121 | X509_ATTRIBUTE *attr); | |
| 810 | #ifndef SSLEAY_MACROS | 1122 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, |
| 811 | #ifdef HEADER_ENVELOPE_H | 1123 | const ASN1_OBJECT *obj, int type, |
| 812 | int X509_verify(); | 1124 | const unsigned char *bytes, int len); |
| 813 | int X509_REQ_verify(); | 1125 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, |
| 814 | int X509_CRL_verify(); | 1126 | int nid, int type, |
| 815 | int NETSCAPE_SPKI_verify(); | 1127 | const unsigned char *bytes, int len); |
| 816 | 1128 | STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, | |
| 817 | int X509_sign(); | 1129 | const char *attrname, int type, |
| 818 | int X509_REQ_sign(); | 1130 | const unsigned char *bytes, int len); |
| 819 | int X509_CRL_sign(); | 1131 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, |
| 820 | int NETSCAPE_SPKI_sign(); | 1132 | int atrtype, const void *data, int len); |
| 821 | 1133 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, | |
| 822 | int X509_digest(); | 1134 | const ASN1_OBJECT *obj, int atrtype, const void *data, int len); |
| 823 | int X509_NAME_digest(); | 1135 | X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, |
| 824 | #endif | 1136 | const char *atrname, int type, const unsigned char *bytes, int len); |
| 825 | 1137 | int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); | |
| 826 | #ifndef NO_FP_API | 1138 | int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); |
| 827 | X509 *d2i_X509_fp(); | 1139 | void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, |
| 828 | int i2d_X509_fp(); | 1140 | int atrtype, void *data); |
| 829 | X509_CRL *d2i_X509_CRL_fp(); | 1141 | int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); |
| 830 | int i2d_X509_CRL_fp(); | 1142 | ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); |
| 831 | X509_REQ *d2i_X509_REQ_fp(); | 1143 | ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); |
| 832 | int i2d_X509_REQ_fp(); | ||
| 833 | RSA *d2i_RSAPrivateKey_fp(); | ||
| 834 | int i2d_RSAPrivateKey_fp(); | ||
| 835 | DSA *d2i_DSAPrivateKey_fp(); | ||
| 836 | int i2d_DSAPrivateKey_fp(); | ||
| 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 | 1144 | ||
| 865 | int X509_cmp_current_time(); | 1145 | int X509_verify_cert(X509_STORE_CTX *ctx); |
| 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 | 1146 | ||
| 1094 | /* lookup a cert from a X509 STACK */ | 1147 | /* lookup a cert from a X509 STACK */ |
| 1095 | X509 *X509_find_by_issuer_and_serial(); | 1148 | X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, |
| 1096 | X509 *X509_find_by_subject(); | 1149 | ASN1_INTEGER *serial); |
| 1097 | 1150 | X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); | |
| 1098 | #endif | 1151 | |
| 1152 | DECLARE_ASN1_FUNCTIONS(PBEPARAM) | ||
| 1153 | DECLARE_ASN1_FUNCTIONS(PBE2PARAM) | ||
| 1154 | DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) | ||
| 1155 | |||
| 1156 | X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); | ||
| 1157 | X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | ||
| 1158 | unsigned char *salt, int saltlen); | ||
| 1159 | |||
| 1160 | /* PKCS#8 utilities */ | ||
| 1161 | |||
| 1162 | DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) | ||
| 1163 | |||
| 1164 | EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); | ||
| 1165 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); | ||
| 1166 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken); | ||
| 1167 | PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); | ||
| 1168 | |||
| 1169 | int X509_check_trust(X509 *x, int id, int flags); | ||
| 1170 | int X509_TRUST_get_count(void); | ||
| 1171 | X509_TRUST * X509_TRUST_get0(int idx); | ||
| 1172 | int X509_TRUST_get_by_id(int id); | ||
| 1173 | int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), | ||
| 1174 | char *name, int arg1, void *arg2); | ||
| 1175 | void X509_TRUST_cleanup(void); | ||
| 1176 | int X509_TRUST_get_flags(X509_TRUST *xp); | ||
| 1177 | char *X509_TRUST_get0_name(X509_TRUST *xp); | ||
| 1178 | int X509_TRUST_get_trust(X509_TRUST *xp); | ||
| 1099 | 1179 | ||
| 1100 | /* BEGIN ERROR CODES */ | 1180 | /* BEGIN ERROR CODES */ |
| 1181 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
| 1182 | * made after this point may be overwritten when the script is next run. | ||
| 1183 | */ | ||
| 1184 | void ERR_load_X509_strings(void); | ||
| 1185 | |||
| 1101 | /* Error codes for the X509 functions. */ | 1186 | /* Error codes for the X509 functions. */ |
| 1102 | 1187 | ||
| 1103 | /* Function codes. */ | 1188 | /* Function codes. */ |
| @@ -1105,17 +1190,25 @@ X509 *X509_find_by_subject(); | |||
| 1105 | #define X509_F_BY_FILE_CTRL 101 | 1190 | #define X509_F_BY_FILE_CTRL 101 |
| 1106 | #define X509_F_DIR_CTRL 102 | 1191 | #define X509_F_DIR_CTRL 102 |
| 1107 | #define X509_F_GET_CERT_BY_SUBJECT 103 | 1192 | #define X509_F_GET_CERT_BY_SUBJECT 103 |
| 1193 | #define X509_F_NETSCAPE_SPKI_B64_DECODE 129 | ||
| 1194 | #define X509_F_NETSCAPE_SPKI_B64_ENCODE 130 | ||
| 1108 | #define X509_F_X509V3_ADD_EXT 104 | 1195 | #define X509_F_X509V3_ADD_EXT 104 |
| 1109 | #define X509_F_X509V3_ADD_EXTENSION 105 | 1196 | #define X509_F_X509_ADD_ATTR 135 |
| 1110 | #define X509_F_X509V3_PACK_STRING 106 | 1197 | #define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136 |
| 1111 | #define X509_F_X509V3_UNPACK_STRING 107 | 1198 | #define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137 |
| 1199 | #define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140 | ||
| 1200 | #define X509_F_X509_ATTRIBUTE_GET0_DATA 139 | ||
| 1201 | #define X509_F_X509_ATTRIBUTE_SET1_DATA 138 | ||
| 1202 | #define X509_F_X509_CHECK_PRIVATE_KEY 128 | ||
| 1112 | #define X509_F_X509_EXTENSION_CREATE_BY_NID 108 | 1203 | #define X509_F_X509_EXTENSION_CREATE_BY_NID 108 |
| 1113 | #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 | 1204 | #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 |
| 1114 | #define X509_F_X509_GET_PUBKEY_PARAMETERS 110 | 1205 | #define X509_F_X509_GET_PUBKEY_PARAMETERS 110 |
| 1206 | #define X509_F_X509_LOAD_CERT_CRL_FILE 132 | ||
| 1115 | #define X509_F_X509_LOAD_CERT_FILE 111 | 1207 | #define X509_F_X509_LOAD_CERT_FILE 111 |
| 1116 | #define X509_F_X509_LOAD_CRL_FILE 112 | 1208 | #define X509_F_X509_LOAD_CRL_FILE 112 |
| 1117 | #define X509_F_X509_NAME_ADD_ENTRY 113 | 1209 | #define X509_F_X509_NAME_ADD_ENTRY 113 |
| 1118 | #define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 | 1210 | #define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 |
| 1211 | #define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 | ||
| 1119 | #define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 | 1212 | #define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 |
| 1120 | #define X509_F_X509_NAME_ONELINE 116 | 1213 | #define X509_F_X509_NAME_ONELINE 116 |
| 1121 | #define X509_F_X509_NAME_PRINT 117 | 1214 | #define X509_F_X509_NAME_PRINT 117 |
| @@ -1127,26 +1220,40 @@ X509 *X509_find_by_subject(); | |||
| 1127 | #define X509_F_X509_REQ_TO_X509 123 | 1220 | #define X509_F_X509_REQ_TO_X509 123 |
| 1128 | #define X509_F_X509_STORE_ADD_CERT 124 | 1221 | #define X509_F_X509_STORE_ADD_CERT 124 |
| 1129 | #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 | ||
| 1225 | #define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 | ||
| 1130 | #define X509_F_X509_TO_X509_REQ 126 | 1226 | #define X509_F_X509_TO_X509_REQ 126 |
| 1227 | #define X509_F_X509_TRUST_ADD 133 | ||
| 1228 | #define X509_F_X509_TRUST_SET 141 | ||
| 1131 | #define X509_F_X509_VERIFY_CERT 127 | 1229 | #define X509_F_X509_VERIFY_CERT 127 |
| 1132 | 1230 | ||
| 1133 | /* Reason codes. */ | 1231 | /* Reason codes. */ |
| 1134 | #define X509_R_BAD_X509_FILETYPE 100 | 1232 | #define X509_R_BAD_X509_FILETYPE 100 |
| 1233 | #define X509_R_BASE64_DECODE_ERROR 118 | ||
| 1234 | #define X509_R_CANT_CHECK_DH_KEY 114 | ||
| 1135 | #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 | 1235 | #define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 |
| 1136 | #define X509_R_ERR_ASN1_LIB 102 | 1236 | #define X509_R_ERR_ASN1_LIB 102 |
| 1237 | #define X509_R_INVALID_DIRECTORY 113 | ||
| 1238 | #define X509_R_INVALID_FIELD_NAME 119 | ||
| 1239 | #define X509_R_INVALID_TRUST 123 | ||
| 1240 | #define X509_R_KEY_TYPE_MISMATCH 115 | ||
| 1241 | #define X509_R_KEY_VALUES_MISMATCH 116 | ||
| 1137 | #define X509_R_LOADING_CERT_DIR 103 | 1242 | #define X509_R_LOADING_CERT_DIR 103 |
| 1138 | #define X509_R_LOADING_DEFAULTS 104 | 1243 | #define X509_R_LOADING_DEFAULTS 104 |
| 1139 | #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 | 1244 | #define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 |
| 1140 | #define X509_R_SHOULD_RETRY 106 | 1245 | #define X509_R_SHOULD_RETRY 106 |
| 1141 | #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 | 1246 | #define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 |
| 1142 | #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 | 1247 | #define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 |
| 1248 | #define X509_R_UNKNOWN_KEY_TYPE 117 | ||
| 1143 | #define X509_R_UNKNOWN_NID 109 | 1249 | #define X509_R_UNKNOWN_NID 109 |
| 1144 | #define X509_R_UNKNOWN_STRING_TYPE 110 | 1250 | #define X509_R_UNKNOWN_PURPOSE_ID 121 |
| 1251 | #define X509_R_UNKNOWN_TRUST_ID 120 | ||
| 1145 | #define X509_R_UNSUPPORTED_ALGORITHM 111 | 1252 | #define X509_R_UNSUPPORTED_ALGORITHM 111 |
| 1146 | #define X509_R_WRONG_LOOKUP_TYPE 112 | 1253 | #define X509_R_WRONG_LOOKUP_TYPE 112 |
| 1147 | 1254 | #define X509_R_WRONG_TYPE 122 | |
| 1255 | |||
| 1148 | #ifdef __cplusplus | 1256 | #ifdef __cplusplus |
| 1149 | } | 1257 | } |
| 1150 | #endif | 1258 | #endif |
| 1151 | #endif | 1259 | #endif |
| 1152 | |||
