diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1.h')
| -rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 341 |
1 files changed, 277 insertions, 64 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index 0184b475a7..424cd348bb 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
| @@ -60,17 +60,19 @@ | |||
| 60 | #define HEADER_ASN1_H | 60 | #define HEADER_ASN1_H |
| 61 | 61 | ||
| 62 | #include <time.h> | 62 | #include <time.h> |
| 63 | #include <openssl/e_os2.h> | ||
| 63 | #ifndef OPENSSL_NO_BIO | 64 | #ifndef OPENSSL_NO_BIO |
| 64 | #include <openssl/bio.h> | 65 | #include <openssl/bio.h> |
| 65 | #endif | 66 | #endif |
| 66 | #include <openssl/e_os2.h> | ||
| 67 | #include <openssl/bn.h> | ||
| 68 | #include <openssl/stack.h> | 67 | #include <openssl/stack.h> |
| 69 | #include <openssl/safestack.h> | 68 | #include <openssl/safestack.h> |
| 70 | 69 | ||
| 71 | #include <openssl/symhacks.h> | 70 | #include <openssl/symhacks.h> |
| 72 | 71 | ||
| 73 | #include <openssl/ossl_typ.h> | 72 | #include <openssl/ossl_typ.h> |
| 73 | #ifndef OPENSSL_NO_DEPRECATED | ||
| 74 | #include <openssl/bn.h> | ||
| 75 | #endif | ||
| 74 | 76 | ||
| 75 | #ifdef OPENSSL_BUILD_SHLIBCRYPTO | 77 | #ifdef OPENSSL_BUILD_SHLIBCRYPTO |
| 76 | # undef OPENSSL_EXTERN | 78 | # undef OPENSSL_EXTERN |
| @@ -147,19 +149,29 @@ extern "C" { | |||
| 147 | #define B_ASN1_UTF8STRING 0x2000 | 149 | #define B_ASN1_UTF8STRING 0x2000 |
| 148 | #define B_ASN1_UTCTIME 0x4000 | 150 | #define B_ASN1_UTCTIME 0x4000 |
| 149 | #define B_ASN1_GENERALIZEDTIME 0x8000 | 151 | #define B_ASN1_GENERALIZEDTIME 0x8000 |
| 152 | #define B_ASN1_SEQUENCE 0x10000 | ||
| 150 | 153 | ||
| 151 | /* For use with ASN1_mbstring_copy() */ | 154 | /* For use with ASN1_mbstring_copy() */ |
| 152 | #define MBSTRING_FLAG 0x1000 | 155 | #define MBSTRING_FLAG 0x1000 |
| 156 | #define MBSTRING_UTF8 (MBSTRING_FLAG) | ||
| 153 | #define MBSTRING_ASC (MBSTRING_FLAG|1) | 157 | #define MBSTRING_ASC (MBSTRING_FLAG|1) |
| 154 | #define MBSTRING_BMP (MBSTRING_FLAG|2) | 158 | #define MBSTRING_BMP (MBSTRING_FLAG|2) |
| 155 | #define MBSTRING_UNIV (MBSTRING_FLAG|3) | 159 | #define MBSTRING_UNIV (MBSTRING_FLAG|4) |
| 156 | #define MBSTRING_UTF8 (MBSTRING_FLAG|4) | 160 | |
| 161 | #define SMIME_OLDMIME 0x400 | ||
| 162 | #define SMIME_CRLFEOL 0x800 | ||
| 163 | #define SMIME_STREAM 0x1000 | ||
| 157 | 164 | ||
| 158 | struct X509_algor_st; | 165 | struct X509_algor_st; |
| 166 | DECLARE_STACK_OF(X509_ALGOR) | ||
| 159 | 167 | ||
| 160 | #define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */ | 168 | #define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */ |
| 161 | #define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */ | 169 | #define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */ |
| 162 | 170 | ||
| 171 | /* We MUST make sure that, except for constness, asn1_ctx_st and | ||
| 172 | asn1_const_ctx are exactly the same. Fortunately, as soon as | ||
| 173 | the old ASN1 parsing macros are gone, we can throw this away | ||
| 174 | as well... */ | ||
| 163 | typedef struct asn1_ctx_st | 175 | typedef struct asn1_ctx_st |
| 164 | { | 176 | { |
| 165 | unsigned char *p;/* work char pointer */ | 177 | unsigned char *p;/* work char pointer */ |
| @@ -175,6 +187,21 @@ typedef struct asn1_ctx_st | |||
| 175 | int line; /* used in error processing */ | 187 | int line; /* used in error processing */ |
| 176 | } ASN1_CTX; | 188 | } ASN1_CTX; |
| 177 | 189 | ||
| 190 | typedef struct asn1_const_ctx_st | ||
| 191 | { | ||
| 192 | const unsigned char *p;/* work char pointer */ | ||
| 193 | int eos; /* end of sequence read for indefinite encoding */ | ||
| 194 | int error; /* error code to use when returning an error */ | ||
| 195 | int inf; /* constructed if 0x20, indefinite is 0x21 */ | ||
| 196 | int tag; /* tag from last 'get object' */ | ||
| 197 | int xclass; /* class from last 'get object' */ | ||
| 198 | long slen; /* length of last 'get object' */ | ||
| 199 | const unsigned char *max; /* largest value of p allowed */ | ||
| 200 | const unsigned char *q;/* temporary variable */ | ||
| 201 | const unsigned char **pp;/* variable */ | ||
| 202 | int line; /* used in error processing */ | ||
| 203 | } ASN1_const_CTX; | ||
| 204 | |||
| 178 | /* These are used internally in the ASN1_OBJECT to keep track of | 205 | /* These are used internally in the ASN1_OBJECT to keep track of |
| 179 | * whether the names and data need to be free()ed */ | 206 | * whether the names and data need to be free()ed */ |
| 180 | #define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */ | 207 | #define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */ |
| @@ -191,6 +218,18 @@ typedef struct asn1_object_st | |||
| 191 | } ASN1_OBJECT; | 218 | } ASN1_OBJECT; |
| 192 | 219 | ||
| 193 | #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ | 220 | #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ |
| 221 | /* This indicates that the ASN1_STRING is not a real value but just a place | ||
| 222 | * holder for the location where indefinite length constructed data should | ||
| 223 | * be inserted in the memory buffer | ||
| 224 | */ | ||
| 225 | #define ASN1_STRING_FLAG_NDEF 0x010 | ||
| 226 | |||
| 227 | /* This flag is used by the CMS code to indicate that a string is not | ||
| 228 | * complete and is a place holder for content when it had all been | ||
| 229 | * accessed. The flag will be reset when content has been written to it. | ||
| 230 | */ | ||
| 231 | #define ASN1_STRING_FLAG_CONT 0x020 | ||
| 232 | |||
| 194 | /* This is the base type that holds just about everything :-) */ | 233 | /* This is the base type that holds just about everything :-) */ |
| 195 | typedef struct asn1_string_st | 234 | typedef struct asn1_string_st |
| 196 | { | 235 | { |
| @@ -259,18 +298,19 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; | |||
| 259 | 298 | ||
| 260 | #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) | 299 | #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) |
| 261 | 300 | ||
| 301 | #define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ | ||
| 302 | DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) | ||
| 303 | |||
| 262 | #define DECLARE_ASN1_FUNCTIONS_name(type, name) \ | 304 | #define DECLARE_ASN1_FUNCTIONS_name(type, name) \ |
| 263 | type *name##_new(void); \ | 305 | DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ |
| 264 | void name##_free(type *a); \ | ||
| 265 | DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) | 306 | DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) |
| 266 | 307 | ||
| 267 | #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ | 308 | #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ |
| 268 | type *name##_new(void); \ | 309 | DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ |
| 269 | void name##_free(type *a); \ | ||
| 270 | DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) | 310 | DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) |
| 271 | 311 | ||
| 272 | #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ | 312 | #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ |
| 273 | type *d2i_##name(type **a, unsigned char **in, long len); \ | 313 | type *d2i_##name(type **a, const unsigned char **in, long len); \ |
| 274 | int i2d_##name(type *a, unsigned char **out); \ | 314 | int i2d_##name(type *a, unsigned char **out); \ |
| 275 | DECLARE_ASN1_ITEM(itname) | 315 | DECLARE_ASN1_ITEM(itname) |
| 276 | 316 | ||
| @@ -279,10 +319,37 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; | |||
| 279 | int i2d_##name(const type *a, unsigned char **out); \ | 319 | int i2d_##name(const type *a, unsigned char **out); \ |
| 280 | DECLARE_ASN1_ITEM(name) | 320 | DECLARE_ASN1_ITEM(name) |
| 281 | 321 | ||
| 322 | #define DECLARE_ASN1_NDEF_FUNCTION(name) \ | ||
| 323 | int i2d_##name##_NDEF(name *a, unsigned char **out); | ||
| 324 | |||
| 282 | #define DECLARE_ASN1_FUNCTIONS_const(name) \ | 325 | #define DECLARE_ASN1_FUNCTIONS_const(name) \ |
| 283 | name *name##_new(void); \ | 326 | DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ |
| 284 | void name##_free(name *a); | 327 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) |
| 285 | 328 | ||
| 329 | #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ | ||
| 330 | type *name##_new(void); \ | ||
| 331 | void name##_free(type *a); | ||
| 332 | |||
| 333 | #define D2I_OF(type) type *(*)(type **,const unsigned char **,long) | ||
| 334 | #define I2D_OF(type) int (*)(type *,unsigned char **) | ||
| 335 | #define I2D_OF_const(type) int (*)(const type *,unsigned char **) | ||
| 336 | |||
| 337 | #define CHECKED_D2I_OF(type, d2i) \ | ||
| 338 | ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) | ||
| 339 | #define CHECKED_I2D_OF(type, i2d) \ | ||
| 340 | ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) | ||
| 341 | #define CHECKED_NEW_OF(type, xnew) \ | ||
| 342 | ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) | ||
| 343 | #define CHECKED_PTR_OF(type, p) \ | ||
| 344 | ((void*) (1 ? p : (type*)0)) | ||
| 345 | #define CHECKED_PPTR_OF(type, p) \ | ||
| 346 | ((void**) (1 ? p : (type**)0)) | ||
| 347 | |||
| 348 | #define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) | ||
| 349 | #define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **) | ||
| 350 | #define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) | ||
| 351 | |||
| 352 | TYPEDEF_D2I2D_OF(void); | ||
| 286 | 353 | ||
| 287 | /* The following macros and typedefs allow an ASN1_ITEM | 354 | /* The following macros and typedefs allow an ASN1_ITEM |
| 288 | * to be embedded in a structure and referenced. Since | 355 | * to be embedded in a structure and referenced. Since |
| @@ -467,6 +534,7 @@ typedef struct asn1_type_st | |||
| 467 | * contain the set or sequence bytes */ | 534 | * contain the set or sequence bytes */ |
| 468 | ASN1_STRING * set; | 535 | ASN1_STRING * set; |
| 469 | ASN1_STRING * sequence; | 536 | ASN1_STRING * sequence; |
| 537 | ASN1_VALUE * asn1_value; | ||
| 470 | } value; | 538 | } value; |
| 471 | } ASN1_TYPE; | 539 | } ASN1_TYPE; |
| 472 | 540 | ||
| @@ -475,17 +543,17 @@ DECLARE_ASN1_SET_OF(ASN1_TYPE) | |||
| 475 | 543 | ||
| 476 | typedef struct asn1_method_st | 544 | typedef struct asn1_method_st |
| 477 | { | 545 | { |
| 478 | int (*i2d)(); | 546 | i2d_of_void *i2d; |
| 479 | char *(*d2i)(); | 547 | d2i_of_void *d2i; |
| 480 | char *(*create)(); | 548 | void *(*create)(void); |
| 481 | void (*destroy)(); | 549 | void (*destroy)(void *); |
| 482 | } ASN1_METHOD; | 550 | } ASN1_METHOD; |
| 483 | 551 | ||
| 484 | /* This is used when parsing some Netscape objects */ | 552 | /* This is used when parsing some Netscape objects */ |
| 485 | typedef struct asn1_header_st | 553 | typedef struct asn1_header_st |
| 486 | { | 554 | { |
| 487 | ASN1_OCTET_STRING *header; | 555 | ASN1_OCTET_STRING *header; |
| 488 | char *data; | 556 | void *data; |
| 489 | ASN1_METHOD *meth; | 557 | ASN1_METHOD *meth; |
| 490 | } ASN1_HEADER; | 558 | } ASN1_HEADER; |
| 491 | 559 | ||
| @@ -551,6 +619,7 @@ typedef struct BIT_STRING_BITNAME_st { | |||
| 551 | B_ASN1_UNIVERSALSTRING|\ | 619 | B_ASN1_UNIVERSALSTRING|\ |
| 552 | B_ASN1_BMPSTRING|\ | 620 | B_ASN1_BMPSTRING|\ |
| 553 | B_ASN1_UTF8STRING|\ | 621 | B_ASN1_UTF8STRING|\ |
| 622 | B_ASN1_SEQUENCE|\ | ||
| 554 | B_ASN1_UNKNOWN | 623 | B_ASN1_UNKNOWN |
| 555 | 624 | ||
| 556 | #define B_ASN1_DIRECTORYSTRING \ | 625 | #define B_ASN1_DIRECTORYSTRING \ |
| @@ -696,13 +765,14 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) | |||
| 696 | 765 | ||
| 697 | int ASN1_TYPE_get(ASN1_TYPE *a); | 766 | int ASN1_TYPE_get(ASN1_TYPE *a); |
| 698 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); | 767 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); |
| 768 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); | ||
| 699 | 769 | ||
| 700 | ASN1_OBJECT * ASN1_OBJECT_new(void ); | 770 | ASN1_OBJECT * ASN1_OBJECT_new(void ); |
| 701 | void ASN1_OBJECT_free(ASN1_OBJECT *a); | 771 | void ASN1_OBJECT_free(ASN1_OBJECT *a); |
| 702 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); | 772 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); |
| 703 | ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp, | 773 | ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, |
| 704 | long length); | 774 | long length); |
| 705 | ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp, | 775 | ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, |
| 706 | long length); | 776 | long length); |
| 707 | 777 | ||
| 708 | DECLARE_ASN1_ITEM(ASN1_OBJECT) | 778 | DECLARE_ASN1_ITEM(ASN1_OBJECT) |
| @@ -718,6 +788,7 @@ int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b); | |||
| 718 | /* Since this is used to store all sorts of things, via macros, for now, make | 788 | /* Since this is used to store all sorts of things, via macros, for now, make |
| 719 | its data void * */ | 789 | its data void * */ |
| 720 | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); | 790 | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); |
| 791 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); | ||
| 721 | int ASN1_STRING_length(ASN1_STRING *x); | 792 | int ASN1_STRING_length(ASN1_STRING *x); |
| 722 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); | 793 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); |
| 723 | int ASN1_STRING_type(ASN1_STRING *x); | 794 | int ASN1_STRING_type(ASN1_STRING *x); |
| @@ -725,7 +796,7 @@ unsigned char * ASN1_STRING_data(ASN1_STRING *x); | |||
| 725 | 796 | ||
| 726 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) | 797 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) |
| 727 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); | 798 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); |
| 728 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp, | 799 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, |
| 729 | long length); | 800 | long length); |
| 730 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, | 801 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, |
| 731 | int length ); | 802 | int length ); |
| @@ -741,13 +812,13 @@ int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | |||
| 741 | BIT_STRING_BITNAME *tbl); | 812 | BIT_STRING_BITNAME *tbl); |
| 742 | 813 | ||
| 743 | int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); | 814 | int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); |
| 744 | int d2i_ASN1_BOOLEAN(int *a,unsigned char **pp,long length); | 815 | int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length); |
| 745 | 816 | ||
| 746 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) | 817 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) |
| 747 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); | 818 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); |
| 748 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp, | 819 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, |
| 749 | long length); | 820 | long length); |
| 750 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp, | 821 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, |
| 751 | long length); | 822 | long length); |
| 752 | ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); | 823 | ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); |
| 753 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y); | 824 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y); |
| @@ -756,7 +827,7 @@ DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) | |||
| 756 | 827 | ||
| 757 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); | 828 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); |
| 758 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); | 829 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); |
| 759 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str); | 830 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); |
| 760 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); | 831 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
| 761 | #if 0 | 832 | #if 0 |
| 762 | time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); | 833 | time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); |
| @@ -764,12 +835,12 @@ time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); | |||
| 764 | 835 | ||
| 765 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | 836 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); |
| 766 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); | 837 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); |
| 767 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str); | 838 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); |
| 768 | 839 | ||
| 769 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) | 840 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) |
| 770 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a); | 841 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a); |
| 771 | int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); | 842 | int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); |
| 772 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, unsigned char *data, int len); | 843 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); |
| 773 | 844 | ||
| 774 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) | 845 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) |
| 775 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) | 846 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) |
| @@ -792,15 +863,17 @@ DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) | |||
| 792 | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) | 863 | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) |
| 793 | DECLARE_ASN1_FUNCTIONS(ASN1_TIME) | 864 | DECLARE_ASN1_FUNCTIONS(ASN1_TIME) |
| 794 | 865 | ||
| 866 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) | ||
| 867 | |||
| 795 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); | 868 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); |
| 796 | int ASN1_TIME_check(ASN1_TIME *t); | 869 | int ASN1_TIME_check(ASN1_TIME *t); |
| 797 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); | 870 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); |
| 798 | 871 | ||
| 799 | int i2d_ASN1_SET(STACK *a, unsigned char **pp, | 872 | int i2d_ASN1_SET(STACK *a, unsigned char **pp, |
| 800 | int (*func)(), int ex_tag, int ex_class, int is_set); | 873 | i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); |
| 801 | STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, | 874 | STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length, |
| 802 | char *(*func)(), void (*free_func)(void *), | 875 | d2i_of_void *d2i, void (*free_func)(void *), |
| 803 | int ex_tag, int ex_class); | 876 | int ex_tag, int ex_class); |
| 804 | 877 | ||
| 805 | #ifndef OPENSSL_NO_BIO | 878 | #ifndef OPENSSL_NO_BIO |
| 806 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 879 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); |
| @@ -832,33 +905,70 @@ BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn); | |||
| 832 | int ASN1_PRINTABLE_type(const unsigned char *s, int max); | 905 | int ASN1_PRINTABLE_type(const unsigned char *s, int max); |
| 833 | 906 | ||
| 834 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); | 907 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); |
| 835 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, | 908 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, |
| 836 | long length, int Ptag, int Pclass); | 909 | long length, int Ptag, int Pclass); |
| 837 | unsigned long ASN1_tag2bit(int tag); | 910 | unsigned long ASN1_tag2bit(int tag); |
| 838 | /* type is one or more of the B_ASN1_ values. */ | 911 | /* type is one or more of the B_ASN1_ values. */ |
| 839 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,unsigned char **pp, | 912 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp, |
| 840 | long length,int type); | 913 | long length,int type); |
| 841 | 914 | ||
| 842 | /* PARSING */ | 915 | /* PARSING */ |
| 843 | int asn1_Finish(ASN1_CTX *c); | 916 | int asn1_Finish(ASN1_CTX *c); |
| 917 | int asn1_const_Finish(ASN1_const_CTX *c); | ||
| 844 | 918 | ||
| 845 | /* SPECIALS */ | 919 | /* SPECIALS */ |
| 846 | int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, | 920 | int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, |
| 847 | int *pclass, long omax); | 921 | int *pclass, long omax); |
| 848 | int ASN1_check_infinite_end(unsigned char **p,long len); | 922 | int ASN1_check_infinite_end(unsigned char **p,long len); |
| 923 | int ASN1_const_check_infinite_end(const unsigned char **p,long len); | ||
| 849 | void ASN1_put_object(unsigned char **pp, int constructed, int length, | 924 | void ASN1_put_object(unsigned char **pp, int constructed, int length, |
| 850 | int tag, int xclass); | 925 | int tag, int xclass); |
| 926 | int ASN1_put_eoc(unsigned char **pp); | ||
| 851 | int ASN1_object_size(int constructed, int length, int tag); | 927 | int ASN1_object_size(int constructed, int length, int tag); |
| 852 | 928 | ||
| 853 | /* Used to implement other functions */ | 929 | /* Used to implement other functions */ |
| 854 | char *ASN1_dup(int (*i2d)(),char *(*d2i)(),char *x); | 930 | void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x); |
| 931 | |||
| 932 | #define ASN1_dup_of(type,i2d,d2i,x) \ | ||
| 933 | ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ | ||
| 934 | CHECKED_D2I_OF(type, d2i), \ | ||
| 935 | CHECKED_PTR_OF(type, x))) | ||
| 936 | |||
| 937 | #define ASN1_dup_of_const(type,i2d,d2i,x) \ | ||
| 938 | ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ | ||
| 939 | CHECKED_D2I_OF(type, d2i), \ | ||
| 940 | CHECKED_PTR_OF(const type, x))) | ||
| 855 | 941 | ||
| 856 | void *ASN1_item_dup(const ASN1_ITEM *it, void *x); | 942 | void *ASN1_item_dup(const ASN1_ITEM *it, void *x); |
| 857 | 943 | ||
| 944 | /* ASN1 alloc/free macros for when a type is only used internally */ | ||
| 945 | |||
| 946 | #define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) | ||
| 947 | #define M_ASN1_free_of(x, type) \ | ||
| 948 | ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) | ||
| 949 | |||
| 858 | #ifndef OPENSSL_NO_FP_API | 950 | #ifndef OPENSSL_NO_FP_API |
| 859 | char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x); | 951 | void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); |
| 952 | |||
| 953 | #define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ | ||
| 954 | ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ | ||
| 955 | CHECKED_D2I_OF(type, d2i), \ | ||
| 956 | in, \ | ||
| 957 | CHECKED_PPTR_OF(type, x))) | ||
| 958 | |||
| 860 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); | 959 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); |
| 861 | int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x); | 960 | int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); |
| 961 | |||
| 962 | #define ASN1_i2d_fp_of(type,i2d,out,x) \ | ||
| 963 | (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ | ||
| 964 | out, \ | ||
| 965 | CHECKED_PTR_OF(type, x))) | ||
| 966 | |||
| 967 | #define ASN1_i2d_fp_of_const(type,i2d,out,x) \ | ||
| 968 | (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ | ||
| 969 | out, \ | ||
| 970 | CHECKED_PTR_OF(const type, x))) | ||
| 971 | |||
| 862 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); | 972 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); |
| 863 | int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); | 973 | int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); |
| 864 | #endif | 974 | #endif |
| @@ -866,23 +976,41 @@ int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); | |||
| 866 | int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); | 976 | int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); |
| 867 | 977 | ||
| 868 | #ifndef OPENSSL_NO_BIO | 978 | #ifndef OPENSSL_NO_BIO |
| 869 | char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x); | 979 | void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); |
| 980 | |||
| 981 | #define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ | ||
| 982 | ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ | ||
| 983 | CHECKED_D2I_OF(type, d2i), \ | ||
| 984 | in, \ | ||
| 985 | CHECKED_PPTR_OF(type, x))) | ||
| 986 | |||
| 870 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); | 987 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); |
| 871 | int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x); | 988 | int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x); |
| 989 | |||
| 990 | #define ASN1_i2d_bio_of(type,i2d,out,x) \ | ||
| 991 | (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ | ||
| 992 | out, \ | ||
| 993 | CHECKED_PTR_OF(type, x))) | ||
| 994 | |||
| 995 | #define ASN1_i2d_bio_of_const(type,i2d,out,x) \ | ||
| 996 | (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ | ||
| 997 | out, \ | ||
| 998 | CHECKED_PTR_OF(const type, x))) | ||
| 999 | |||
| 872 | int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); | 1000 | int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); |
| 873 | int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); | 1001 | int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); |
| 874 | int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); | 1002 | int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); |
| 875 | int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); | 1003 | int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); |
| 876 | int ASN1_STRING_print(BIO *bp,ASN1_STRING *v); | 1004 | int ASN1_STRING_print(BIO *bp,ASN1_STRING *v); |
| 877 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); | 1005 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); |
| 878 | int ASN1_parse(BIO *bp,unsigned char *pp,long len,int indent); | 1006 | int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent); |
| 879 | int ASN1_parse_dump(BIO *bp,unsigned char *pp,long len,int indent,int dump); | 1007 | int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump); |
| 880 | #endif | 1008 | #endif |
| 881 | const char *ASN1_tag2str(int tag); | 1009 | const char *ASN1_tag2str(int tag); |
| 882 | 1010 | ||
| 883 | /* Used to load and write netscape format cert/key */ | 1011 | /* Used to load and write netscape format cert/key */ |
| 884 | int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp); | 1012 | int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp); |
| 885 | ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,unsigned char **pp, long length); | 1013 | ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,const unsigned char **pp, long length); |
| 886 | ASN1_HEADER *ASN1_HEADER_new(void ); | 1014 | ASN1_HEADER *ASN1_HEADER_new(void ); |
| 887 | void ASN1_HEADER_free(ASN1_HEADER *a); | 1015 | void ASN1_HEADER_free(ASN1_HEADER *a); |
| 888 | 1016 | ||
| @@ -903,13 +1031,20 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, | |||
| 903 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, | 1031 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, |
| 904 | unsigned char *data, int max_len); | 1032 | unsigned char *data, int max_len); |
| 905 | 1033 | ||
| 906 | STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), | 1034 | STACK *ASN1_seq_unpack(const unsigned char *buf, int len, |
| 907 | void (*free_func)(void *) ); | 1035 | d2i_of_void *d2i, void (*free_func)(void *)); |
| 908 | unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, | 1036 | unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d, |
| 909 | int *len ); | 1037 | unsigned char **buf, int *len ); |
| 910 | void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)()); | 1038 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); |
| 911 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | 1039 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); |
| 912 | ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct); | 1040 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, |
| 1041 | ASN1_OCTET_STRING **oct); | ||
| 1042 | |||
| 1043 | #define ASN1_pack_string_of(type,obj,i2d,oct) \ | ||
| 1044 | (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \ | ||
| 1045 | CHECKED_I2D_OF(type, i2d), \ | ||
| 1046 | oct)) | ||
| 1047 | |||
| 913 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); | 1048 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); |
| 914 | 1049 | ||
| 915 | void ASN1_STRING_set_default_mask(unsigned long mask); | 1050 | void ASN1_STRING_set_default_mask(unsigned long mask); |
| @@ -932,11 +1067,25 @@ void ASN1_STRING_TABLE_cleanup(void); | |||
| 932 | /* Old API compatible functions */ | 1067 | /* Old API compatible functions */ |
| 933 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); | 1068 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); |
| 934 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); | 1069 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); |
| 935 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_ITEM *it); | 1070 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); |
| 936 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | 1071 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); |
| 1072 | int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | ||
| 937 | 1073 | ||
| 938 | void ASN1_add_oid_module(void); | 1074 | void ASN1_add_oid_module(void); |
| 939 | 1075 | ||
| 1076 | ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); | ||
| 1077 | ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | ||
| 1078 | |||
| 1079 | typedef int asn1_output_data_fn(BIO *out, BIO *data, ASN1_VALUE *val, int flags, | ||
| 1080 | const ASN1_ITEM *it); | ||
| 1081 | |||
| 1082 | int int_smime_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, | ||
| 1083 | int ctype_nid, int econt_nid, | ||
| 1084 | STACK_OF(X509_ALGOR) *mdalgs, | ||
| 1085 | asn1_output_data_fn *data_fn, | ||
| 1086 | const ASN1_ITEM *it); | ||
| 1087 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); | ||
| 1088 | |||
| 940 | /* BEGIN ERROR CODES */ | 1089 | /* BEGIN ERROR CODES */ |
| 941 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 1090 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
| 942 | * made after this point may be overwritten when the script is next run. | 1091 | * made after this point may be overwritten when the script is next run. |
| @@ -950,49 +1099,70 @@ void ERR_load_ASN1_strings(void); | |||
| 950 | #define ASN1_F_A2I_ASN1_ENUMERATED 101 | 1099 | #define ASN1_F_A2I_ASN1_ENUMERATED 101 |
| 951 | #define ASN1_F_A2I_ASN1_INTEGER 102 | 1100 | #define ASN1_F_A2I_ASN1_INTEGER 102 |
| 952 | #define ASN1_F_A2I_ASN1_STRING 103 | 1101 | #define ASN1_F_A2I_ASN1_STRING 103 |
| 953 | #define ASN1_F_ASN1_BIT_STRING_SET_BIT 176 | 1102 | #define ASN1_F_APPEND_EXP 176 |
| 1103 | #define ASN1_F_ASN1_BIT_STRING_SET_BIT 183 | ||
| 1104 | #define ASN1_F_ASN1_CB 177 | ||
| 954 | #define ASN1_F_ASN1_CHECK_TLEN 104 | 1105 | #define ASN1_F_ASN1_CHECK_TLEN 104 |
| 955 | #define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 | 1106 | #define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 |
| 956 | #define ASN1_F_ASN1_COLLECT 106 | 1107 | #define ASN1_F_ASN1_COLLECT 106 |
| 957 | #define ASN1_F_ASN1_D2I_BIO 107 | ||
| 958 | #define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 | 1108 | #define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 |
| 959 | #define ASN1_F_ASN1_D2I_FP 109 | 1109 | #define ASN1_F_ASN1_D2I_FP 109 |
| 960 | #define ASN1_F_ASN1_DIGEST 177 | 1110 | #define ASN1_F_ASN1_D2I_READ_BIO 107 |
| 1111 | #define ASN1_F_ASN1_DIGEST 184 | ||
| 961 | #define ASN1_F_ASN1_DO_ADB 110 | 1112 | #define ASN1_F_ASN1_DO_ADB 110 |
| 962 | #define ASN1_F_ASN1_DUP 111 | 1113 | #define ASN1_F_ASN1_DUP 111 |
| 963 | #define ASN1_F_ASN1_ENUMERATED_SET 112 | 1114 | #define ASN1_F_ASN1_ENUMERATED_SET 112 |
| 964 | #define ASN1_F_ASN1_ENUMERATED_TO_BN 113 | 1115 | #define ASN1_F_ASN1_ENUMERATED_TO_BN 113 |
| 965 | #define ASN1_F_ASN1_FIND_END 182 | 1116 | #define ASN1_F_ASN1_EX_C2I 204 |
| 966 | #define ASN1_F_ASN1_GENERALIZEDTIME_SET 178 | 1117 | #define ASN1_F_ASN1_FIND_END 190 |
| 1118 | #define ASN1_F_ASN1_GENERALIZEDTIME_SET 185 | ||
| 1119 | #define ASN1_F_ASN1_GENERATE_V3 178 | ||
| 967 | #define ASN1_F_ASN1_GET_OBJECT 114 | 1120 | #define ASN1_F_ASN1_GET_OBJECT 114 |
| 968 | #define ASN1_F_ASN1_HEADER_NEW 115 | 1121 | #define ASN1_F_ASN1_HEADER_NEW 115 |
| 969 | #define ASN1_F_ASN1_I2D_BIO 116 | 1122 | #define ASN1_F_ASN1_I2D_BIO 116 |
| 970 | #define ASN1_F_ASN1_I2D_FP 117 | 1123 | #define ASN1_F_ASN1_I2D_FP 117 |
| 971 | #define ASN1_F_ASN1_INTEGER_SET 118 | 1124 | #define ASN1_F_ASN1_INTEGER_SET 118 |
| 972 | #define ASN1_F_ASN1_INTEGER_TO_BN 119 | 1125 | #define ASN1_F_ASN1_INTEGER_TO_BN 119 |
| 1126 | #define ASN1_F_ASN1_ITEM_D2I_FP 206 | ||
| 1127 | #define ASN1_F_ASN1_ITEM_DUP 191 | ||
| 1128 | #define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121 | ||
| 973 | #define ASN1_F_ASN1_ITEM_EX_D2I 120 | 1129 | #define ASN1_F_ASN1_ITEM_EX_D2I 120 |
| 974 | #define ASN1_F_ASN1_ITEM_NEW 121 | 1130 | #define ASN1_F_ASN1_ITEM_I2D_BIO 192 |
| 975 | #define ASN1_F_ASN1_MBSTRING_COPY 122 | 1131 | #define ASN1_F_ASN1_ITEM_I2D_FP 193 |
| 1132 | #define ASN1_F_ASN1_ITEM_PACK 198 | ||
| 1133 | #define ASN1_F_ASN1_ITEM_SIGN 195 | ||
| 1134 | #define ASN1_F_ASN1_ITEM_UNPACK 199 | ||
| 1135 | #define ASN1_F_ASN1_ITEM_VERIFY 197 | ||
| 1136 | #define ASN1_F_ASN1_MBSTRING_NCOPY 122 | ||
| 976 | #define ASN1_F_ASN1_OBJECT_NEW 123 | 1137 | #define ASN1_F_ASN1_OBJECT_NEW 123 |
| 1138 | #define ASN1_F_ASN1_OUTPUT_DATA 207 | ||
| 977 | #define ASN1_F_ASN1_PACK_STRING 124 | 1139 | #define ASN1_F_ASN1_PACK_STRING 124 |
| 978 | #define ASN1_F_ASN1_PBE_SET 125 | 1140 | #define ASN1_F_ASN1_PCTX_NEW 205 |
| 1141 | #define ASN1_F_ASN1_PKCS5_PBE_SET 125 | ||
| 979 | #define ASN1_F_ASN1_SEQ_PACK 126 | 1142 | #define ASN1_F_ASN1_SEQ_PACK 126 |
| 980 | #define ASN1_F_ASN1_SEQ_UNPACK 127 | 1143 | #define ASN1_F_ASN1_SEQ_UNPACK 127 |
| 981 | #define ASN1_F_ASN1_SIGN 128 | 1144 | #define ASN1_F_ASN1_SIGN 128 |
| 982 | #define ASN1_F_ASN1_STRING_SET 179 | 1145 | #define ASN1_F_ASN1_STR2TYPE 179 |
| 1146 | #define ASN1_F_ASN1_STRING_SET 186 | ||
| 983 | #define ASN1_F_ASN1_STRING_TABLE_ADD 129 | 1147 | #define ASN1_F_ASN1_STRING_TABLE_ADD 129 |
| 984 | #define ASN1_F_ASN1_STRING_TYPE_NEW 130 | 1148 | #define ASN1_F_ASN1_STRING_TYPE_NEW 130 |
| 985 | #define ASN1_F_ASN1_TEMPLATE_D2I 131 | ||
| 986 | #define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 | 1149 | #define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 |
| 987 | #define ASN1_F_ASN1_TEMPLATE_NEW 133 | 1150 | #define ASN1_F_ASN1_TEMPLATE_NEW 133 |
| 1151 | #define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131 | ||
| 988 | #define ASN1_F_ASN1_TIME_SET 175 | 1152 | #define ASN1_F_ASN1_TIME_SET 175 |
| 989 | #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 | 1153 | #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 |
| 990 | #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 | 1154 | #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 |
| 991 | #define ASN1_F_ASN1_UNPACK_STRING 136 | 1155 | #define ASN1_F_ASN1_UNPACK_STRING 136 |
| 992 | #define ASN1_F_ASN1_UTCTIME_SET 180 | 1156 | #define ASN1_F_ASN1_UTCTIME_SET 187 |
| 993 | #define ASN1_F_ASN1_VERIFY 137 | 1157 | #define ASN1_F_ASN1_VERIFY 137 |
| 1158 | #define ASN1_F_B64_READ_ASN1 208 | ||
| 1159 | #define ASN1_F_B64_WRITE_ASN1 209 | ||
| 1160 | #define ASN1_F_BITSTR_CB 180 | ||
| 994 | #define ASN1_F_BN_TO_ASN1_ENUMERATED 138 | 1161 | #define ASN1_F_BN_TO_ASN1_ENUMERATED 138 |
| 995 | #define ASN1_F_BN_TO_ASN1_INTEGER 139 | 1162 | #define ASN1_F_BN_TO_ASN1_INTEGER 139 |
| 1163 | #define ASN1_F_C2I_ASN1_BIT_STRING 189 | ||
| 1164 | #define ASN1_F_C2I_ASN1_INTEGER 194 | ||
| 1165 | #define ASN1_F_C2I_ASN1_OBJECT 196 | ||
| 996 | #define ASN1_F_COLLECT_DATA 140 | 1166 | #define ASN1_F_COLLECT_DATA 140 |
| 997 | #define ASN1_F_D2I_ASN1_BIT_STRING 141 | 1167 | #define ASN1_F_D2I_ASN1_BIT_STRING 141 |
| 998 | #define ASN1_F_D2I_ASN1_BOOLEAN 142 | 1168 | #define ASN1_F_D2I_ASN1_BOOLEAN 142 |
| @@ -1009,29 +1179,39 @@ void ERR_load_ASN1_strings(void); | |||
| 1009 | #define ASN1_F_D2I_NETSCAPE_RSA_2 153 | 1179 | #define ASN1_F_D2I_NETSCAPE_RSA_2 153 |
| 1010 | #define ASN1_F_D2I_PRIVATEKEY 154 | 1180 | #define ASN1_F_D2I_PRIVATEKEY 154 |
| 1011 | #define ASN1_F_D2I_PUBLICKEY 155 | 1181 | #define ASN1_F_D2I_PUBLICKEY 155 |
| 1182 | #define ASN1_F_D2I_RSA_NET 200 | ||
| 1183 | #define ASN1_F_D2I_RSA_NET_2 201 | ||
| 1012 | #define ASN1_F_D2I_X509 156 | 1184 | #define ASN1_F_D2I_X509 156 |
| 1013 | #define ASN1_F_D2I_X509_CINF 157 | 1185 | #define ASN1_F_D2I_X509_CINF 157 |
| 1014 | #define ASN1_F_D2I_X509_NAME 158 | ||
| 1015 | #define ASN1_F_D2I_X509_PKEY 159 | 1186 | #define ASN1_F_D2I_X509_PKEY 159 |
| 1016 | #define ASN1_F_I2D_ASN1_SET 181 | 1187 | #define ASN1_F_I2D_ASN1_SET 188 |
| 1017 | #define ASN1_F_I2D_ASN1_TIME 160 | 1188 | #define ASN1_F_I2D_ASN1_TIME 160 |
| 1018 | #define ASN1_F_I2D_DSA_PUBKEY 161 | 1189 | #define ASN1_F_I2D_DSA_PUBKEY 161 |
| 1019 | #define ASN1_F_I2D_NETSCAPE_RSA 162 | 1190 | #define ASN1_F_I2D_EC_PUBKEY 181 |
| 1020 | #define ASN1_F_I2D_PRIVATEKEY 163 | 1191 | #define ASN1_F_I2D_PRIVATEKEY 163 |
| 1021 | #define ASN1_F_I2D_PUBLICKEY 164 | 1192 | #define ASN1_F_I2D_PUBLICKEY 164 |
| 1193 | #define ASN1_F_I2D_RSA_NET 162 | ||
| 1022 | #define ASN1_F_I2D_RSA_PUBKEY 165 | 1194 | #define ASN1_F_I2D_RSA_PUBKEY 165 |
| 1023 | #define ASN1_F_LONG_C2I 166 | 1195 | #define ASN1_F_LONG_C2I 166 |
| 1024 | #define ASN1_F_OID_MODULE_INIT 174 | 1196 | #define ASN1_F_OID_MODULE_INIT 174 |
| 1197 | #define ASN1_F_PARSE_TAGGING 182 | ||
| 1025 | #define ASN1_F_PKCS5_PBE2_SET 167 | 1198 | #define ASN1_F_PKCS5_PBE2_SET 167 |
| 1199 | #define ASN1_F_PKCS5_PBE_SET 202 | ||
| 1200 | #define ASN1_F_SMIME_READ_ASN1 210 | ||
| 1201 | #define ASN1_F_SMIME_TEXT 211 | ||
| 1026 | #define ASN1_F_X509_CINF_NEW 168 | 1202 | #define ASN1_F_X509_CINF_NEW 168 |
| 1027 | #define ASN1_F_X509_CRL_ADD0_REVOKED 169 | 1203 | #define ASN1_F_X509_CRL_ADD0_REVOKED 169 |
| 1028 | #define ASN1_F_X509_INFO_NEW 170 | 1204 | #define ASN1_F_X509_INFO_NEW 170 |
| 1029 | #define ASN1_F_X509_NAME_NEW 171 | 1205 | #define ASN1_F_X509_NAME_ENCODE 203 |
| 1206 | #define ASN1_F_X509_NAME_EX_D2I 158 | ||
| 1207 | #define ASN1_F_X509_NAME_EX_NEW 171 | ||
| 1030 | #define ASN1_F_X509_NEW 172 | 1208 | #define ASN1_F_X509_NEW 172 |
| 1031 | #define ASN1_F_X509_PKEY_NEW 173 | 1209 | #define ASN1_F_X509_PKEY_NEW 173 |
| 1032 | 1210 | ||
| 1033 | /* Reason codes. */ | 1211 | /* Reason codes. */ |
| 1034 | #define ASN1_R_ADDING_OBJECT 171 | 1212 | #define ASN1_R_ADDING_OBJECT 171 |
| 1213 | #define ASN1_R_ASN1_PARSE_ERROR 198 | ||
| 1214 | #define ASN1_R_ASN1_SIG_PARSE_ERROR 199 | ||
| 1035 | #define ASN1_R_AUX_ERROR 100 | 1215 | #define ASN1_R_AUX_ERROR 100 |
| 1036 | #define ASN1_R_BAD_CLASS 101 | 1216 | #define ASN1_R_BAD_CLASS 101 |
| 1037 | #define ASN1_R_BAD_OBJECT_HEADER 102 | 1217 | #define ASN1_R_BAD_OBJECT_HEADER 102 |
| @@ -1044,6 +1224,7 @@ void ERR_load_ASN1_strings(void); | |||
| 1044 | #define ASN1_R_DATA_IS_WRONG 109 | 1224 | #define ASN1_R_DATA_IS_WRONG 109 |
| 1045 | #define ASN1_R_DECODE_ERROR 110 | 1225 | #define ASN1_R_DECODE_ERROR 110 |
| 1046 | #define ASN1_R_DECODING_ERROR 111 | 1226 | #define ASN1_R_DECODING_ERROR 111 |
| 1227 | #define ASN1_R_DEPTH_EXCEEDED 174 | ||
| 1047 | #define ASN1_R_ENCODE_ERROR 112 | 1228 | #define ASN1_R_ENCODE_ERROR 112 |
| 1048 | #define ASN1_R_ERROR_GETTING_TIME 173 | 1229 | #define ASN1_R_ERROR_GETTING_TIME 173 |
| 1049 | #define ASN1_R_ERROR_LOADING_SECTION 172 | 1230 | #define ASN1_R_ERROR_LOADING_SECTION 172 |
| @@ -1058,39 +1239,68 @@ void ERR_load_ASN1_strings(void); | |||
| 1058 | #define ASN1_R_FIELD_MISSING 121 | 1239 | #define ASN1_R_FIELD_MISSING 121 |
| 1059 | #define ASN1_R_FIRST_NUM_TOO_LARGE 122 | 1240 | #define ASN1_R_FIRST_NUM_TOO_LARGE 122 |
| 1060 | #define ASN1_R_HEADER_TOO_LONG 123 | 1241 | #define ASN1_R_HEADER_TOO_LONG 123 |
| 1242 | #define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175 | ||
| 1243 | #define ASN1_R_ILLEGAL_BOOLEAN 176 | ||
| 1061 | #define ASN1_R_ILLEGAL_CHARACTERS 124 | 1244 | #define ASN1_R_ILLEGAL_CHARACTERS 124 |
| 1245 | #define ASN1_R_ILLEGAL_FORMAT 177 | ||
| 1246 | #define ASN1_R_ILLEGAL_HEX 178 | ||
| 1247 | #define ASN1_R_ILLEGAL_IMPLICIT_TAG 179 | ||
| 1248 | #define ASN1_R_ILLEGAL_INTEGER 180 | ||
| 1249 | #define ASN1_R_ILLEGAL_NESTED_TAGGING 181 | ||
| 1062 | #define ASN1_R_ILLEGAL_NULL 125 | 1250 | #define ASN1_R_ILLEGAL_NULL 125 |
| 1251 | #define ASN1_R_ILLEGAL_NULL_VALUE 182 | ||
| 1252 | #define ASN1_R_ILLEGAL_OBJECT 183 | ||
| 1063 | #define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 | 1253 | #define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 |
| 1064 | #define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 | 1254 | #define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 |
| 1065 | #define ASN1_R_ILLEGAL_TAGGED_ANY 127 | 1255 | #define ASN1_R_ILLEGAL_TAGGED_ANY 127 |
| 1256 | #define ASN1_R_ILLEGAL_TIME_VALUE 184 | ||
| 1257 | #define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 | ||
| 1066 | #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 | 1258 | #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 |
| 1067 | #define ASN1_R_INVALID_BMPSTRING_LENGTH 129 | 1259 | #define ASN1_R_INVALID_BMPSTRING_LENGTH 129 |
| 1068 | #define ASN1_R_INVALID_DIGIT 130 | 1260 | #define ASN1_R_INVALID_DIGIT 130 |
| 1261 | #define ASN1_R_INVALID_MIME_TYPE 200 | ||
| 1262 | #define ASN1_R_INVALID_MODIFIER 186 | ||
| 1263 | #define ASN1_R_INVALID_NUMBER 187 | ||
| 1069 | #define ASN1_R_INVALID_SEPARATOR 131 | 1264 | #define ASN1_R_INVALID_SEPARATOR 131 |
| 1070 | #define ASN1_R_INVALID_TIME_FORMAT 132 | 1265 | #define ASN1_R_INVALID_TIME_FORMAT 132 |
| 1071 | #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 | 1266 | #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 |
| 1072 | #define ASN1_R_INVALID_UTF8STRING 134 | 1267 | #define ASN1_R_INVALID_UTF8STRING 134 |
| 1073 | #define ASN1_R_IV_TOO_LARGE 135 | 1268 | #define ASN1_R_IV_TOO_LARGE 135 |
| 1074 | #define ASN1_R_LENGTH_ERROR 136 | 1269 | #define ASN1_R_LENGTH_ERROR 136 |
| 1270 | #define ASN1_R_LIST_ERROR 188 | ||
| 1271 | #define ASN1_R_MIME_NO_CONTENT_TYPE 201 | ||
| 1272 | #define ASN1_R_MIME_PARSE_ERROR 202 | ||
| 1273 | #define ASN1_R_MIME_SIG_PARSE_ERROR 203 | ||
| 1075 | #define ASN1_R_MISSING_EOC 137 | 1274 | #define ASN1_R_MISSING_EOC 137 |
| 1076 | #define ASN1_R_MISSING_SECOND_NUMBER 138 | 1275 | #define ASN1_R_MISSING_SECOND_NUMBER 138 |
| 1276 | #define ASN1_R_MISSING_VALUE 189 | ||
| 1077 | #define ASN1_R_MSTRING_NOT_UNIVERSAL 139 | 1277 | #define ASN1_R_MSTRING_NOT_UNIVERSAL 139 |
| 1078 | #define ASN1_R_MSTRING_WRONG_TAG 140 | 1278 | #define ASN1_R_MSTRING_WRONG_TAG 140 |
| 1079 | #define ASN1_R_NESTED_ASN1_STRING 174 | 1279 | #define ASN1_R_NESTED_ASN1_STRING 197 |
| 1080 | #define ASN1_R_NON_HEX_CHARACTERS 141 | 1280 | #define ASN1_R_NON_HEX_CHARACTERS 141 |
| 1281 | #define ASN1_R_NOT_ASCII_FORMAT 190 | ||
| 1081 | #define ASN1_R_NOT_ENOUGH_DATA 142 | 1282 | #define ASN1_R_NOT_ENOUGH_DATA 142 |
| 1283 | #define ASN1_R_NO_CONTENT_TYPE 204 | ||
| 1082 | #define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 | 1284 | #define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 |
| 1285 | #define ASN1_R_NO_MULTIPART_BODY_FAILURE 205 | ||
| 1286 | #define ASN1_R_NO_MULTIPART_BOUNDARY 206 | ||
| 1287 | #define ASN1_R_NO_SIG_CONTENT_TYPE 207 | ||
| 1083 | #define ASN1_R_NULL_IS_WRONG_LENGTH 144 | 1288 | #define ASN1_R_NULL_IS_WRONG_LENGTH 144 |
| 1289 | #define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191 | ||
| 1084 | #define ASN1_R_ODD_NUMBER_OF_CHARS 145 | 1290 | #define ASN1_R_ODD_NUMBER_OF_CHARS 145 |
| 1085 | #define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 | 1291 | #define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 |
| 1086 | #define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 | 1292 | #define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 |
| 1087 | #define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 | 1293 | #define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 |
| 1088 | #define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 | 1294 | #define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 |
| 1295 | #define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192 | ||
| 1089 | #define ASN1_R_SHORT_LINE 150 | 1296 | #define ASN1_R_SHORT_LINE 150 |
| 1297 | #define ASN1_R_SIG_INVALID_MIME_TYPE 208 | ||
| 1298 | #define ASN1_R_STREAMING_NOT_SUPPORTED 209 | ||
| 1090 | #define ASN1_R_STRING_TOO_LONG 151 | 1299 | #define ASN1_R_STRING_TOO_LONG 151 |
| 1091 | #define ASN1_R_STRING_TOO_SHORT 152 | 1300 | #define ASN1_R_STRING_TOO_SHORT 152 |
| 1092 | #define ASN1_R_TAG_VALUE_TOO_HIGH 153 | 1301 | #define ASN1_R_TAG_VALUE_TOO_HIGH 153 |
| 1093 | #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 | 1302 | #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 |
| 1303 | #define ASN1_R_TIME_NOT_ASCII_FORMAT 193 | ||
| 1094 | #define ASN1_R_TOO_LONG 155 | 1304 | #define ASN1_R_TOO_LONG 155 |
| 1095 | #define ASN1_R_TYPE_NOT_CONSTRUCTED 156 | 1305 | #define ASN1_R_TYPE_NOT_CONSTRUCTED 156 |
| 1096 | #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 | 1306 | #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 |
| @@ -1100,10 +1310,13 @@ void ERR_load_ASN1_strings(void); | |||
| 1100 | #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 | 1310 | #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 |
| 1101 | #define ASN1_R_UNKNOWN_OBJECT_TYPE 162 | 1311 | #define ASN1_R_UNKNOWN_OBJECT_TYPE 162 |
| 1102 | #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 | 1312 | #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 |
| 1313 | #define ASN1_R_UNKNOWN_TAG 194 | ||
| 1314 | #define ASN1_R_UNKOWN_FORMAT 195 | ||
| 1103 | #define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 | 1315 | #define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 |
| 1104 | #define ASN1_R_UNSUPPORTED_CIPHER 165 | 1316 | #define ASN1_R_UNSUPPORTED_CIPHER 165 |
| 1105 | #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 | 1317 | #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 |
| 1106 | #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 | 1318 | #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 |
| 1319 | #define ASN1_R_UNSUPPORTED_TYPE 196 | ||
| 1107 | #define ASN1_R_WRONG_TAG 168 | 1320 | #define ASN1_R_WRONG_TAG 168 |
| 1108 | #define ASN1_R_WRONG_TYPE 169 | 1321 | #define ASN1_R_WRONG_TYPE 169 |
| 1109 | 1322 | ||
