diff options
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 266 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_locl.h | 43 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1_mac.h | 16 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/asn1.h | 266 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/asn1_locl.h | 43 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/asn1_mac.h | 16 |
6 files changed, 308 insertions, 342 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index 7e0ee8eab0..f92816b6c3 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -165,8 +165,7 @@ DECLARE_STACK_OF(X509_ALGOR) | |||
165 | asn1_const_ctx are exactly the same. Fortunately, as soon as | 165 | asn1_const_ctx are exactly the same. Fortunately, as soon as |
166 | the old ASN1 parsing macros are gone, we can throw this away | 166 | the old ASN1 parsing macros are gone, we can throw this away |
167 | as well... */ | 167 | as well... */ |
168 | typedef struct asn1_ctx_st | 168 | typedef struct asn1_ctx_st { |
169 | { | ||
170 | unsigned char *p;/* work char pointer */ | 169 | unsigned char *p;/* work char pointer */ |
171 | int eos; /* end of sequence read for indefinite encoding */ | 170 | int eos; /* end of sequence read for indefinite encoding */ |
172 | int error; /* error code to use when returning an error */ | 171 | int error; /* error code to use when returning an error */ |
@@ -178,10 +177,9 @@ typedef struct asn1_ctx_st | |||
178 | unsigned char *q;/* temporary variable */ | 177 | unsigned char *q;/* temporary variable */ |
179 | unsigned char **pp;/* variable */ | 178 | unsigned char **pp;/* variable */ |
180 | int line; /* used in error processing */ | 179 | int line; /* used in error processing */ |
181 | } ASN1_CTX; | 180 | } ASN1_CTX; |
182 | 181 | ||
183 | typedef struct asn1_const_ctx_st | 182 | typedef struct asn1_const_ctx_st { |
184 | { | ||
185 | const unsigned char *p;/* work char pointer */ | 183 | const unsigned char *p;/* work char pointer */ |
186 | int eos; /* end of sequence read for indefinite encoding */ | 184 | int eos; /* end of sequence read for indefinite encoding */ |
187 | int error; /* error code to use when returning an error */ | 185 | int error; /* error code to use when returning an error */ |
@@ -193,7 +191,7 @@ typedef struct asn1_const_ctx_st | |||
193 | const unsigned char *q;/* temporary variable */ | 191 | const unsigned char *q;/* temporary variable */ |
194 | const unsigned char **pp;/* variable */ | 192 | const unsigned char **pp;/* variable */ |
195 | int line; /* used in error processing */ | 193 | int line; /* used in error processing */ |
196 | } ASN1_const_CTX; | 194 | } ASN1_const_CTX; |
197 | 195 | ||
198 | /* These are used internally in the ASN1_OBJECT to keep track of | 196 | /* These are used internally in the ASN1_OBJECT to keep track of |
199 | * whether the names and data need to be free()ed */ | 197 | * whether the names and data need to be free()ed */ |
@@ -201,35 +199,33 @@ typedef struct asn1_const_ctx_st | |||
201 | #define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */ | 199 | #define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */ |
202 | #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ | 200 | #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ |
203 | #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ | 201 | #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ |
204 | typedef struct asn1_object_st | 202 | typedef struct asn1_object_st { |
205 | { | 203 | const char *sn, *ln; |
206 | const char *sn,*ln; | ||
207 | int nid; | 204 | int nid; |
208 | int length; | 205 | int length; |
209 | const unsigned char *data; /* data remains const after init */ | 206 | const unsigned char *data; /* data remains const after init */ |
210 | int flags; /* Should we free this one */ | 207 | int flags; /* Should we free this one */ |
211 | } ASN1_OBJECT; | 208 | } ASN1_OBJECT; |
212 | 209 | ||
213 | #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ | 210 | #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ |
214 | /* This indicates that the ASN1_STRING is not a real value but just a place | 211 | /* This indicates that the ASN1_STRING is not a real value but just a place |
215 | * holder for the location where indefinite length constructed data should | 212 | * holder for the location where indefinite length constructed data should |
216 | * be inserted in the memory buffer | 213 | * be inserted in the memory buffer |
217 | */ | 214 | */ |
218 | #define ASN1_STRING_FLAG_NDEF 0x010 | 215 | #define ASN1_STRING_FLAG_NDEF 0x010 |
219 | 216 | ||
220 | /* This flag is used by the CMS code to indicate that a string is not | 217 | /* This flag is used by the CMS code to indicate that a string is not |
221 | * complete and is a place holder for content when it had all been | 218 | * complete and is a place holder for content when it had all been |
222 | * accessed. The flag will be reset when content has been written to it. | 219 | * accessed. The flag will be reset when content has been written to it. |
223 | */ | 220 | */ |
224 | 221 | ||
225 | #define ASN1_STRING_FLAG_CONT 0x020 | 222 | #define ASN1_STRING_FLAG_CONT 0x020 |
226 | /* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING | 223 | /* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING |
227 | * type. | 224 | * type. |
228 | */ | 225 | */ |
229 | #define ASN1_STRING_FLAG_MSTRING 0x040 | 226 | #define ASN1_STRING_FLAG_MSTRING 0x040 |
230 | /* This is the base type that holds just about everything :-) */ | 227 | /* This is the base type that holds just about everything :-) */ |
231 | struct asn1_string_st | 228 | struct asn1_string_st { |
232 | { | ||
233 | int length; | 229 | int length; |
234 | int type; | 230 | int type; |
235 | unsigned char *data; | 231 | unsigned char *data; |
@@ -238,19 +234,18 @@ struct asn1_string_st | |||
238 | * input data has a non-zero 'unused bits' value, it will be | 234 | * input data has a non-zero 'unused bits' value, it will be |
239 | * handled correctly */ | 235 | * handled correctly */ |
240 | long flags; | 236 | long flags; |
241 | }; | 237 | }; |
242 | 238 | ||
243 | /* ASN1_ENCODING structure: this is used to save the received | 239 | /* ASN1_ENCODING structure: this is used to save the received |
244 | * encoding of an ASN1 type. This is useful to get round | 240 | * encoding of an ASN1 type. This is useful to get round |
245 | * problems with invalid encodings which can break signatures. | 241 | * problems with invalid encodings which can break signatures. |
246 | */ | 242 | */ |
247 | 243 | ||
248 | typedef struct ASN1_ENCODING_st | 244 | typedef struct ASN1_ENCODING_st { |
249 | { | ||
250 | unsigned char *enc; /* DER encoding */ | 245 | unsigned char *enc; /* DER encoding */ |
251 | long len; /* Length of encoding */ | 246 | long len; /* Length of encoding */ |
252 | int modified; /* set to 1 if 'enc' is invalid */ | 247 | int modified; /* set to 1 if 'enc' is invalid */ |
253 | } ASN1_ENCODING; | 248 | } ASN1_ENCODING; |
254 | 249 | ||
255 | /* Used with ASN1 LONG type: if a long is set to this it is omitted */ | 250 | /* Used with ASN1 LONG type: if a long is set to this it is omitted */ |
256 | #define ASN1_LONG_UNDEF 0x7fffffffL | 251 | #define ASN1_LONG_UNDEF 0x7fffffffL |
@@ -373,7 +368,7 @@ TYPEDEF_D2I2D_OF(void); | |||
373 | * ... | 368 | * ... |
374 | * ASN1_ITEM_EXP *iptr; | 369 | * ASN1_ITEM_EXP *iptr; |
375 | * ... | 370 | * ... |
376 | * } SOMETHING; | 371 | * } SOMETHING; |
377 | * | 372 | * |
378 | * It would be initialised as e.g.: | 373 | * It would be initialised as e.g.: |
379 | * | 374 | * |
@@ -461,7 +456,7 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); | |||
461 | */ | 456 | */ |
462 | 457 | ||
463 | /* If this is set we convert all character strings | 458 | /* If this is set we convert all character strings |
464 | * to UTF8 first | 459 | * to UTF8 first |
465 | */ | 460 | */ |
466 | 461 | ||
467 | #define ASN1_STRFLGS_UTF8_CONVERT 0x10 | 462 | #define ASN1_STRFLGS_UTF8_CONVERT 0x10 |
@@ -511,10 +506,9 @@ DECLARE_ASN1_SET_OF(ASN1_INTEGER) | |||
511 | 506 | ||
512 | DECLARE_STACK_OF(ASN1_GENERALSTRING) | 507 | DECLARE_STACK_OF(ASN1_GENERALSTRING) |
513 | 508 | ||
514 | typedef struct asn1_type_st | 509 | typedef struct asn1_type_st { |
515 | { | ||
516 | int type; | 510 | int type; |
517 | union { | 511 | union { |
518 | char *ptr; | 512 | char *ptr; |
519 | ASN1_BOOLEAN boolean; | 513 | ASN1_BOOLEAN boolean; |
520 | ASN1_STRING * asn1_string; | 514 | ASN1_STRING * asn1_string; |
@@ -538,8 +532,8 @@ typedef struct asn1_type_st | |||
538 | ASN1_STRING * set; | 532 | ASN1_STRING * set; |
539 | ASN1_STRING * sequence; | 533 | ASN1_STRING * sequence; |
540 | ASN1_VALUE * asn1_value; | 534 | ASN1_VALUE * asn1_value; |
541 | } value; | 535 | } value; |
542 | } ASN1_TYPE; | 536 | } ASN1_TYPE; |
543 | 537 | ||
544 | DECLARE_STACK_OF(ASN1_TYPE) | 538 | DECLARE_STACK_OF(ASN1_TYPE) |
545 | DECLARE_ASN1_SET_OF(ASN1_TYPE) | 539 | DECLARE_ASN1_SET_OF(ASN1_TYPE) |
@@ -549,11 +543,10 @@ typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; | |||
549 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) | 543 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) |
550 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) | 544 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) |
551 | 545 | ||
552 | typedef struct NETSCAPE_X509_st | 546 | typedef struct NETSCAPE_X509_st { |
553 | { | ||
554 | ASN1_OCTET_STRING *header; | 547 | ASN1_OCTET_STRING *header; |
555 | X509 *cert; | 548 | X509 *cert; |
556 | } NETSCAPE_X509; | 549 | } NETSCAPE_X509; |
557 | 550 | ||
558 | /* This is used to contain a list of bit names */ | 551 | /* This is used to contain a list of bit names */ |
559 | typedef struct BIT_STRING_BITNAME_st { | 552 | typedef struct BIT_STRING_BITNAME_st { |
@@ -760,7 +753,7 @@ typedef struct BIT_STRING_BITNAME_st { | |||
760 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ | 753 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ |
761 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) | 754 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) |
762 | 755 | ||
763 | /* for the is_set parameter to i2d_ASN1_SET */ | 756 | /* for the is_set parameter to i2d_ASN1_SET */ |
764 | #define IS_SEQUENCE 0 | 757 | #define IS_SEQUENCE 0 |
765 | #define IS_SET 1 | 758 | #define IS_SET 1 |
766 | 759 | ||
@@ -769,86 +762,88 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) | |||
769 | int ASN1_TYPE_get(ASN1_TYPE *a); | 762 | int ASN1_TYPE_get(ASN1_TYPE *a); |
770 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); | 763 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); |
771 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); | 764 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); |
772 | int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); | 765 | int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); |
773 | 766 | ||
774 | ASN1_OBJECT * ASN1_OBJECT_new(void ); | 767 | ASN1_OBJECT *ASN1_OBJECT_new(void ); |
775 | void ASN1_OBJECT_free(ASN1_OBJECT *a); | 768 | void ASN1_OBJECT_free(ASN1_OBJECT *a); |
776 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); | 769 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); |
777 | ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, | 770 | ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, |
778 | long length); | 771 | long length); |
779 | ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, | 772 | ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, |
780 | long length); | 773 | long length); |
781 | 774 | ||
782 | DECLARE_ASN1_ITEM(ASN1_OBJECT) | 775 | DECLARE_ASN1_ITEM(ASN1_OBJECT) |
783 | 776 | ||
784 | DECLARE_STACK_OF(ASN1_OBJECT) | 777 | DECLARE_STACK_OF(ASN1_OBJECT) |
785 | DECLARE_ASN1_SET_OF(ASN1_OBJECT) | 778 | DECLARE_ASN1_SET_OF(ASN1_OBJECT) |
786 | 779 | ||
787 | ASN1_STRING * ASN1_STRING_new(void); | 780 | ASN1_STRING *ASN1_STRING_new(void); |
788 | void ASN1_STRING_free(ASN1_STRING *a); | 781 | void ASN1_STRING_free(ASN1_STRING *a); |
789 | int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); | 782 | int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); |
790 | ASN1_STRING * ASN1_STRING_dup(const ASN1_STRING *a); | 783 | ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a); |
791 | ASN1_STRING * ASN1_STRING_type_new(int type ); | 784 | ASN1_STRING *ASN1_STRING_type_new(int type ); |
792 | int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); | 785 | int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); |
793 | /* Since this is used to store all sorts of things, via macros, for now, make | 786 | /* Since this is used to store all sorts of things, via macros, for now, make |
794 | its data void * */ | 787 | its data void * */ |
795 | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); | 788 | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); |
796 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); | 789 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); |
797 | int ASN1_STRING_length(const ASN1_STRING *x); | 790 | int ASN1_STRING_length(const ASN1_STRING *x); |
798 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); | 791 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); |
799 | int ASN1_STRING_type(ASN1_STRING *x); | 792 | int ASN1_STRING_type(ASN1_STRING *x); |
800 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); | 793 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); |
801 | 794 | ||
802 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) | 795 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) |
803 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); | 796 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); |
804 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, | 797 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, |
805 | long length); | 798 | const unsigned char **pp, long length); |
806 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, | 799 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); |
807 | int length ); | 800 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); |
808 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); | 801 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); |
809 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); | 802 | int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, |
810 | int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, | 803 | unsigned char *flags, int flags_len); |
811 | unsigned char *flags, int flags_len); | ||
812 | 804 | ||
813 | #ifndef OPENSSL_NO_BIO | 805 | #ifndef OPENSSL_NO_BIO |
814 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | 806 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, |
815 | BIT_STRING_BITNAME *tbl, int indent); | 807 | BIT_STRING_BITNAME *tbl, int indent); |
816 | #endif | 808 | #endif |
817 | int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); | 809 | int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); |
818 | int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | 810 | int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, |
819 | BIT_STRING_BITNAME *tbl); | 811 | BIT_STRING_BITNAME *tbl); |
820 | 812 | ||
821 | int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); | 813 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); |
822 | int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length); | 814 | int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length); |
823 | 815 | ||
824 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) | 816 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) |
825 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); | 817 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); |
826 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, | 818 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, |
827 | long length); | 819 | long length); |
828 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, | 820 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, |
829 | long length); | 821 | long length); |
830 | ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); | 822 | ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); |
831 | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); | 823 | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); |
832 | 824 | ||
833 | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) | 825 | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) |
834 | 826 | ||
835 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); | 827 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); |
836 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); | 828 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); |
837 | ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | 829 | ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, |
838 | int offset_day, long offset_sec); | 830 | int offset_day, long offset_sec); |
839 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); | 831 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); |
840 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); | 832 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
841 | 833 | ||
842 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | 834 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); |
843 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); | 835 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, |
836 | time_t t); | ||
844 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, | 837 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, |
845 | time_t t, int offset_day, long offset_sec); | 838 | time_t t, int offset_day, long offset_sec); |
846 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); | 839 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); |
847 | 840 | ||
848 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) | 841 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) |
849 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); | 842 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); |
850 | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b); | 843 | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, |
851 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); | 844 | const ASN1_OCTET_STRING *b); |
845 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, | ||
846 | int len); | ||
852 | 847 | ||
853 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) | 848 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) |
854 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) | 849 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) |
@@ -870,46 +865,44 @@ DECLARE_ASN1_FUNCTIONS(ASN1_TIME) | |||
870 | 865 | ||
871 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) | 866 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) |
872 | 867 | ||
873 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); | 868 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); |
874 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s,time_t t, | 869 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, |
875 | int offset_day, long offset_sec); | 870 | long offset_sec); |
876 | int ASN1_TIME_check(ASN1_TIME *t); | 871 | int ASN1_TIME_check(ASN1_TIME *t); |
877 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); | 872 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, |
873 | ASN1_GENERALIZEDTIME **out); | ||
878 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); | 874 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); |
879 | 875 | ||
880 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, | 876 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, |
881 | i2d_of_void *i2d, int ex_tag, int ex_class, | 877 | i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); |
882 | int is_set); | ||
883 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, | 878 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, |
884 | const unsigned char **pp, | 879 | const unsigned char **pp, long length, d2i_of_void *d2i, |
885 | long length, d2i_of_void *d2i, | 880 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, int ex_class); |
886 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, | ||
887 | int ex_class); | ||
888 | 881 | ||
889 | #ifndef OPENSSL_NO_BIO | 882 | #ifndef OPENSSL_NO_BIO |
890 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 883 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); |
891 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); | 884 | int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); |
892 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); | 885 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); |
893 | int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size); | 886 | int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); |
894 | int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a); | 887 | int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); |
895 | int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size); | 888 | int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); |
896 | int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); | 889 | int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); |
897 | #endif | 890 | #endif |
898 | int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); | 891 | int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); |
899 | 892 | ||
900 | int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num); | 893 | int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); |
901 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, | 894 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, |
902 | const char *sn, const char *ln); | 895 | const char *sn, const char *ln); |
903 | 896 | ||
904 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); | 897 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); |
905 | long ASN1_INTEGER_get(const ASN1_INTEGER *a); | 898 | long ASN1_INTEGER_get(const ASN1_INTEGER *a); |
906 | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); | 899 | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); |
907 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai,BIGNUM *bn); | 900 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); |
908 | 901 | ||
909 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); | 902 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); |
910 | long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); | 903 | long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); |
911 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); | 904 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); |
912 | BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn); | 905 | BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); |
913 | 906 | ||
914 | /* General */ | 907 | /* General */ |
915 | /* given a string, return the correct type, max is the maximum length */ | 908 | /* given a string, return the correct type, max is the maximum length */ |
@@ -917,11 +910,11 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int max); | |||
917 | 910 | ||
918 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); | 911 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); |
919 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, | 912 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, |
920 | long length, int Ptag, int Pclass); | 913 | long length, int Ptag, int Pclass); |
921 | unsigned long ASN1_tag2bit(int tag); | 914 | unsigned long ASN1_tag2bit(int tag); |
922 | /* type is one or more of the B_ASN1_ values. */ | 915 | /* type is one or more of the B_ASN1_ values. */ |
923 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp, | 916 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, |
924 | long length,int type); | 917 | long length, int type); |
925 | 918 | ||
926 | /* PARSING */ | 919 | /* PARSING */ |
927 | int asn1_Finish(ASN1_CTX *c); | 920 | int asn1_Finish(ASN1_CTX *c); |
@@ -929,11 +922,11 @@ int asn1_const_Finish(ASN1_const_CTX *c); | |||
929 | 922 | ||
930 | /* SPECIALS */ | 923 | /* SPECIALS */ |
931 | int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, | 924 | int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, |
932 | int *pclass, long omax); | 925 | int *pclass, long omax); |
933 | int ASN1_check_infinite_end(unsigned char **p,long len); | 926 | int ASN1_check_infinite_end(unsigned char **p, long len); |
934 | int ASN1_const_check_infinite_end(const unsigned char **p,long len); | 927 | int ASN1_const_check_infinite_end(const unsigned char **p, long len); |
935 | void ASN1_put_object(unsigned char **pp, int constructed, int length, | 928 | void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, |
936 | int tag, int xclass); | 929 | int xclass); |
937 | int ASN1_put_eoc(unsigned char **pp); | 930 | int ASN1_put_eoc(unsigned char **pp); |
938 | int ASN1_object_size(int constructed, int length, int tag); | 931 | int ASN1_object_size(int constructed, int length, int tag); |
939 | 932 | ||
@@ -968,7 +961,7 @@ void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); | |||
968 | CHECKED_PPTR_OF(type, x))) | 961 | CHECKED_PPTR_OF(type, x))) |
969 | 962 | ||
970 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); | 963 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); |
971 | int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); | 964 | int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x); |
972 | 965 | ||
973 | #define ASN1_i2d_fp_of(type,i2d,out,x) \ | 966 | #define ASN1_i2d_fp_of(type,i2d,out,x) \ |
974 | (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ | 967 | (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ |
@@ -996,7 +989,7 @@ void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); | |||
996 | CHECKED_PPTR_OF(type, x))) | 989 | CHECKED_PPTR_OF(type, x))) |
997 | 990 | ||
998 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); | 991 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); |
999 | int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x); | 992 | int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x); |
1000 | 993 | ||
1001 | #define ASN1_i2d_bio_of(type,i2d,out,x) \ | 994 | #define ASN1_i2d_bio_of(type,i2d,out,x) \ |
1002 | (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ | 995 | (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ |
@@ -1015,9 +1008,9 @@ int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); | |||
1015 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); | 1008 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); |
1016 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); | 1009 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); |
1017 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | 1010 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, |
1018 | unsigned char *buf, int off); | 1011 | unsigned char *buf, int off); |
1019 | int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent); | 1012 | int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); |
1020 | int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump); | 1013 | int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump); |
1021 | #endif | 1014 | #endif |
1022 | const char *ASN1_tag2str(int tag); | 1015 | const char *ASN1_tag2str(int tag); |
1023 | 1016 | ||
@@ -1027,37 +1020,35 @@ DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509) | |||
1027 | 1020 | ||
1028 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); | 1021 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); |
1029 | 1022 | ||
1030 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, | 1023 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); |
1031 | unsigned char *data, int len); | 1024 | int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len); |
1032 | int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, | 1025 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, |
1033 | unsigned char *data, int max_len); | 1026 | int len); |
1034 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, | 1027 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, |
1035 | unsigned char *data, int len); | 1028 | int max_len); |
1036 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, | ||
1037 | unsigned char *data, int max_len); | ||
1038 | 1029 | ||
1039 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | 1030 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, |
1040 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); | 1031 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); |
1041 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | 1032 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, |
1042 | unsigned char **buf, int *len ); | 1033 | unsigned char **buf, int *len ); |
1043 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); | 1034 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); |
1044 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | 1035 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); |
1045 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, | 1036 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, |
1046 | ASN1_OCTET_STRING **oct); | 1037 | ASN1_OCTET_STRING **oct); |
1047 | 1038 | ||
1048 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); | 1039 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, |
1040 | ASN1_OCTET_STRING **oct); | ||
1049 | 1041 | ||
1050 | void ASN1_STRING_set_default_mask(unsigned long mask); | 1042 | void ASN1_STRING_set_default_mask(unsigned long mask); |
1051 | int ASN1_STRING_set_default_mask_asc(const char *p); | 1043 | int ASN1_STRING_set_default_mask_asc(const char *p); |
1052 | unsigned long ASN1_STRING_get_default_mask(void); | 1044 | unsigned long ASN1_STRING_get_default_mask(void); |
1053 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, | 1045 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, |
1054 | int inform, unsigned long mask); | 1046 | int inform, unsigned long mask); |
1055 | int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, | 1047 | int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, |
1056 | int inform, unsigned long mask, | 1048 | int inform, unsigned long mask, long minsize, long maxsize); |
1057 | long minsize, long maxsize); | ||
1058 | 1049 | ||
1059 | ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, | 1050 | ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, |
1060 | const unsigned char *in, int inlen, int inform, int nid); | 1051 | const unsigned char *in, int inlen, int inform, int nid); |
1061 | ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); | 1052 | ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); |
1062 | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); | 1053 | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); |
1063 | void ASN1_STRING_TABLE_cleanup(void); | 1054 | void ASN1_STRING_TABLE_cleanup(void); |
@@ -1067,7 +1058,8 @@ void ASN1_STRING_TABLE_cleanup(void); | |||
1067 | /* Old API compatible functions */ | 1058 | /* Old API compatible functions */ |
1068 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); | 1059 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); |
1069 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); | 1060 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); |
1070 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); | 1061 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, |
1062 | long len, const ASN1_ITEM *it); | ||
1071 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | 1063 | 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); | 1064 | int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); |
1073 | 1065 | ||
@@ -1079,7 +1071,7 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | |||
1079 | /* ASN1 Print flags */ | 1071 | /* ASN1 Print flags */ |
1080 | 1072 | ||
1081 | /* Indicate missing OPTIONAL fields */ | 1073 | /* Indicate missing OPTIONAL fields */ |
1082 | #define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 | 1074 | #define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 |
1083 | /* Mark start and end of SEQUENCE */ | 1075 | /* Mark start and end of SEQUENCE */ |
1084 | #define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 | 1076 | #define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 |
1085 | /* Mark start and end of SEQUENCE/SET OF */ | 1077 | /* Mark start and end of SEQUENCE/SET OF */ |
@@ -1098,7 +1090,7 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | |||
1098 | #define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 | 1090 | #define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 |
1099 | 1091 | ||
1100 | int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, | 1092 | int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, |
1101 | const ASN1_ITEM *it, const ASN1_PCTX *pctx); | 1093 | const ASN1_ITEM *it, const ASN1_PCTX *pctx); |
1102 | ASN1_PCTX *ASN1_PCTX_new(void); | 1094 | ASN1_PCTX *ASN1_PCTX_new(void); |
1103 | void ASN1_PCTX_free(ASN1_PCTX *p); | 1095 | void ASN1_PCTX_free(ASN1_PCTX *p); |
1104 | unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); | 1096 | unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); |
@@ -1117,14 +1109,12 @@ BIO_METHOD *BIO_f_asn1(void); | |||
1117 | BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); | 1109 | BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); |
1118 | 1110 | ||
1119 | int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, | 1111 | int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, |
1120 | const ASN1_ITEM *it); | 1112 | const ASN1_ITEM *it); |
1121 | int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, | 1113 | int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, |
1122 | const char *hdr, | 1114 | const char *hdr, const ASN1_ITEM *it); |
1123 | const ASN1_ITEM *it); | ||
1124 | int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, | 1115 | int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, |
1125 | int ctype_nid, int econt_nid, | 1116 | int ctype_nid, int econt_nid, STACK_OF(X509_ALGOR) *mdalgs, |
1126 | STACK_OF(X509_ALGOR) *mdalgs, | 1117 | const ASN1_ITEM *it); |
1127 | const ASN1_ITEM *it); | ||
1128 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); | 1118 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); |
1129 | int SMIME_crlf_copy(BIO *in, BIO *out, int flags); | 1119 | int SMIME_crlf_copy(BIO *in, BIO *out, int flags); |
1130 | int SMIME_text(BIO *in, BIO *out); | 1120 | int SMIME_text(BIO *in, BIO *out); |
diff --git a/src/lib/libcrypto/asn1/asn1_locl.h b/src/lib/libcrypto/asn1/asn1_locl.h index 64bf8ec2fa..bcbb605202 100644 --- a/src/lib/libcrypto/asn1/asn1_locl.h +++ b/src/lib/libcrypto/asn1/asn1_locl.h | |||
@@ -10,7 +10,7 @@ | |||
10 | * are met: | 10 | * are met: |
11 | * | 11 | * |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * | 14 | * |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
@@ -60,8 +60,7 @@ | |||
60 | 60 | ||
61 | /* ASN1 print context structure */ | 61 | /* ASN1 print context structure */ |
62 | 62 | ||
63 | struct asn1_pctx_st | 63 | struct asn1_pctx_st { |
64 | { | ||
65 | unsigned long flags; | 64 | unsigned long flags; |
66 | unsigned long nm_flags; | 65 | unsigned long nm_flags; |
67 | unsigned long cert_flags; | 66 | unsigned long cert_flags; |
@@ -71,8 +70,7 @@ struct asn1_pctx_st | |||
71 | 70 | ||
72 | /* ASN1 public key method structure */ | 71 | /* ASN1 public key method structure */ |
73 | 72 | ||
74 | struct evp_pkey_asn1_method_st | 73 | struct evp_pkey_asn1_method_st { |
75 | { | ||
76 | int pkey_id; | 74 | int pkey_id; |
77 | int pkey_base_id; | 75 | int pkey_base_id; |
78 | unsigned long pkey_flags; | 76 | unsigned long pkey_flags; |
@@ -84,44 +82,40 @@ struct evp_pkey_asn1_method_st | |||
84 | int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk); | 82 | int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk); |
85 | int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); | 83 | int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); |
86 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 84 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
87 | ASN1_PCTX *pctx); | 85 | ASN1_PCTX *pctx); |
88 | 86 | ||
89 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); | 87 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); |
90 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); | 88 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); |
91 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 89 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
92 | ASN1_PCTX *pctx); | 90 | ASN1_PCTX *pctx); |
93 | 91 | ||
94 | int (*pkey_size)(const EVP_PKEY *pk); | 92 | int (*pkey_size)(const EVP_PKEY *pk); |
95 | int (*pkey_bits)(const EVP_PKEY *pk); | 93 | int (*pkey_bits)(const EVP_PKEY *pk); |
96 | 94 | ||
97 | int (*param_decode)(EVP_PKEY *pkey, | 95 | int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, |
98 | const unsigned char **pder, int derlen); | 96 | int derlen); |
99 | int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder); | 97 | int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder); |
100 | int (*param_missing)(const EVP_PKEY *pk); | 98 | int (*param_missing)(const EVP_PKEY *pk); |
101 | int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); | 99 | int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); |
102 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); | 100 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); |
103 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 101 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
104 | ASN1_PCTX *pctx); | 102 | ASN1_PCTX *pctx); |
105 | int (*sig_print)(BIO *out, | 103 | int (*sig_print)(BIO *out, const X509_ALGOR *sigalg, |
106 | const X509_ALGOR *sigalg, const ASN1_STRING *sig, | 104 | const ASN1_STRING *sig, int indent, ASN1_PCTX *pctx); |
107 | int indent, ASN1_PCTX *pctx); | ||
108 | |||
109 | 105 | ||
110 | void (*pkey_free)(EVP_PKEY *pkey); | 106 | void (*pkey_free)(EVP_PKEY *pkey); |
111 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); | 107 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); |
112 | 108 | ||
113 | /* Legacy functions for old PEM */ | 109 | /* Legacy functions for old PEM */ |
114 | 110 | ||
115 | int (*old_priv_decode)(EVP_PKEY *pkey, | 111 | int (*old_priv_decode)(EVP_PKEY *pkey, const unsigned char **pder, |
116 | const unsigned char **pder, int derlen); | 112 | int derlen); |
117 | int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); | 113 | int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); |
118 | /* Custom ASN1 signature verification */ | 114 | /* Custom ASN1 signature verification */ |
119 | int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, | 115 | int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, |
120 | X509_ALGOR *a, ASN1_BIT_STRING *sig, | 116 | X509_ALGOR *a, ASN1_BIT_STRING *sig, EVP_PKEY *pkey); |
121 | EVP_PKEY *pkey); | ||
122 | int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, | 117 | int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, |
123 | X509_ALGOR *alg1, X509_ALGOR *alg2, | 118 | X509_ALGOR *alg1, X509_ALGOR *alg2, ASN1_BIT_STRING *sig); |
124 | ASN1_BIT_STRING *sig); | ||
125 | 119 | ||
126 | } /* EVP_PKEY_ASN1_METHOD */; | 120 | } /* EVP_PKEY_ASN1_METHOD */; |
127 | 121 | ||
@@ -134,13 +128,12 @@ struct evp_pkey_asn1_method_st | |||
134 | 128 | ||
135 | #define X509_CRL_METHOD_DYNAMIC 1 | 129 | #define X509_CRL_METHOD_DYNAMIC 1 |
136 | 130 | ||
137 | struct x509_crl_method_st | 131 | struct x509_crl_method_st { |
138 | { | ||
139 | int flags; | 132 | int flags; |
140 | int (*crl_init)(X509_CRL *crl); | 133 | int (*crl_init)(X509_CRL *crl); |
141 | int (*crl_free)(X509_CRL *crl); | 134 | int (*crl_free)(X509_CRL *crl); |
142 | int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, | 135 | int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, |
143 | ASN1_INTEGER *ser, X509_NAME *issuer); | 136 | ASN1_INTEGER *ser, X509_NAME *issuer); |
144 | int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk); | 137 | int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk); |
145 | }; | 138 | }; |
146 | 139 | ||
@@ -154,5 +147,5 @@ struct x509_crl_method_st | |||
154 | #define UNICODE_IS_SURROGATE(x) \ | 147 | #define UNICODE_IS_SURROGATE(x) \ |
155 | ((x) >= UNICODE_SURROGATE_MIN && (x) <= UNICODE_SURROGATE_MAX) | 148 | ((x) >= UNICODE_SURROGATE_MIN && (x) <= UNICODE_SURROGATE_MAX) |
156 | 149 | ||
157 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); | 150 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); |
158 | int UTF8_putc(unsigned char *str, int len, unsigned long value); | 151 | int UTF8_putc(unsigned char *str, int len, unsigned long value); |
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h index ecc2c77228..da03a8cb92 100644 --- a/src/lib/libcrypto/asn1/asn1_mac.h +++ b/src/lib/libcrypto/asn1/asn1_mac.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -67,7 +67,7 @@ extern "C" { | |||
67 | 67 | ||
68 | #ifndef ASN1_MAC_ERR_LIB | 68 | #ifndef ASN1_MAC_ERR_LIB |
69 | #define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 | 69 | #define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #define ASN1_MAC_H_err(f,r,line) \ | 72 | #define ASN1_MAC_H_err(f,r,line) \ |
73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) | 73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) |
@@ -433,7 +433,7 @@ err:\ | |||
433 | return(r); | 433 | return(r); |
434 | 434 | ||
435 | int asn1_GetSequence(ASN1_const_CTX *c, long *length); | 435 | int asn1_GetSequence(ASN1_const_CTX *c, long *length); |
436 | void asn1_add_error(const unsigned char *address,int offset); | 436 | void asn1_add_error(const unsigned char *address, int offset); |
437 | #ifdef __cplusplus | 437 | #ifdef __cplusplus |
438 | } | 438 | } |
439 | #endif | 439 | #endif |
diff --git a/src/lib/libssl/src/crypto/asn1/asn1.h b/src/lib/libssl/src/crypto/asn1/asn1.h index 7e0ee8eab0..f92816b6c3 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1.h +++ b/src/lib/libssl/src/crypto/asn1/asn1.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -165,8 +165,7 @@ DECLARE_STACK_OF(X509_ALGOR) | |||
165 | asn1_const_ctx are exactly the same. Fortunately, as soon as | 165 | asn1_const_ctx are exactly the same. Fortunately, as soon as |
166 | the old ASN1 parsing macros are gone, we can throw this away | 166 | the old ASN1 parsing macros are gone, we can throw this away |
167 | as well... */ | 167 | as well... */ |
168 | typedef struct asn1_ctx_st | 168 | typedef struct asn1_ctx_st { |
169 | { | ||
170 | unsigned char *p;/* work char pointer */ | 169 | unsigned char *p;/* work char pointer */ |
171 | int eos; /* end of sequence read for indefinite encoding */ | 170 | int eos; /* end of sequence read for indefinite encoding */ |
172 | int error; /* error code to use when returning an error */ | 171 | int error; /* error code to use when returning an error */ |
@@ -178,10 +177,9 @@ typedef struct asn1_ctx_st | |||
178 | unsigned char *q;/* temporary variable */ | 177 | unsigned char *q;/* temporary variable */ |
179 | unsigned char **pp;/* variable */ | 178 | unsigned char **pp;/* variable */ |
180 | int line; /* used in error processing */ | 179 | int line; /* used in error processing */ |
181 | } ASN1_CTX; | 180 | } ASN1_CTX; |
182 | 181 | ||
183 | typedef struct asn1_const_ctx_st | 182 | typedef struct asn1_const_ctx_st { |
184 | { | ||
185 | const unsigned char *p;/* work char pointer */ | 183 | const unsigned char *p;/* work char pointer */ |
186 | int eos; /* end of sequence read for indefinite encoding */ | 184 | int eos; /* end of sequence read for indefinite encoding */ |
187 | int error; /* error code to use when returning an error */ | 185 | int error; /* error code to use when returning an error */ |
@@ -193,7 +191,7 @@ typedef struct asn1_const_ctx_st | |||
193 | const unsigned char *q;/* temporary variable */ | 191 | const unsigned char *q;/* temporary variable */ |
194 | const unsigned char **pp;/* variable */ | 192 | const unsigned char **pp;/* variable */ |
195 | int line; /* used in error processing */ | 193 | int line; /* used in error processing */ |
196 | } ASN1_const_CTX; | 194 | } ASN1_const_CTX; |
197 | 195 | ||
198 | /* These are used internally in the ASN1_OBJECT to keep track of | 196 | /* These are used internally in the ASN1_OBJECT to keep track of |
199 | * whether the names and data need to be free()ed */ | 197 | * whether the names and data need to be free()ed */ |
@@ -201,35 +199,33 @@ typedef struct asn1_const_ctx_st | |||
201 | #define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */ | 199 | #define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */ |
202 | #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ | 200 | #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ |
203 | #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ | 201 | #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ |
204 | typedef struct asn1_object_st | 202 | typedef struct asn1_object_st { |
205 | { | 203 | const char *sn, *ln; |
206 | const char *sn,*ln; | ||
207 | int nid; | 204 | int nid; |
208 | int length; | 205 | int length; |
209 | const unsigned char *data; /* data remains const after init */ | 206 | const unsigned char *data; /* data remains const after init */ |
210 | int flags; /* Should we free this one */ | 207 | int flags; /* Should we free this one */ |
211 | } ASN1_OBJECT; | 208 | } ASN1_OBJECT; |
212 | 209 | ||
213 | #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ | 210 | #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ |
214 | /* This indicates that the ASN1_STRING is not a real value but just a place | 211 | /* This indicates that the ASN1_STRING is not a real value but just a place |
215 | * holder for the location where indefinite length constructed data should | 212 | * holder for the location where indefinite length constructed data should |
216 | * be inserted in the memory buffer | 213 | * be inserted in the memory buffer |
217 | */ | 214 | */ |
218 | #define ASN1_STRING_FLAG_NDEF 0x010 | 215 | #define ASN1_STRING_FLAG_NDEF 0x010 |
219 | 216 | ||
220 | /* This flag is used by the CMS code to indicate that a string is not | 217 | /* This flag is used by the CMS code to indicate that a string is not |
221 | * complete and is a place holder for content when it had all been | 218 | * complete and is a place holder for content when it had all been |
222 | * accessed. The flag will be reset when content has been written to it. | 219 | * accessed. The flag will be reset when content has been written to it. |
223 | */ | 220 | */ |
224 | 221 | ||
225 | #define ASN1_STRING_FLAG_CONT 0x020 | 222 | #define ASN1_STRING_FLAG_CONT 0x020 |
226 | /* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING | 223 | /* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING |
227 | * type. | 224 | * type. |
228 | */ | 225 | */ |
229 | #define ASN1_STRING_FLAG_MSTRING 0x040 | 226 | #define ASN1_STRING_FLAG_MSTRING 0x040 |
230 | /* This is the base type that holds just about everything :-) */ | 227 | /* This is the base type that holds just about everything :-) */ |
231 | struct asn1_string_st | 228 | struct asn1_string_st { |
232 | { | ||
233 | int length; | 229 | int length; |
234 | int type; | 230 | int type; |
235 | unsigned char *data; | 231 | unsigned char *data; |
@@ -238,19 +234,18 @@ struct asn1_string_st | |||
238 | * input data has a non-zero 'unused bits' value, it will be | 234 | * input data has a non-zero 'unused bits' value, it will be |
239 | * handled correctly */ | 235 | * handled correctly */ |
240 | long flags; | 236 | long flags; |
241 | }; | 237 | }; |
242 | 238 | ||
243 | /* ASN1_ENCODING structure: this is used to save the received | 239 | /* ASN1_ENCODING structure: this is used to save the received |
244 | * encoding of an ASN1 type. This is useful to get round | 240 | * encoding of an ASN1 type. This is useful to get round |
245 | * problems with invalid encodings which can break signatures. | 241 | * problems with invalid encodings which can break signatures. |
246 | */ | 242 | */ |
247 | 243 | ||
248 | typedef struct ASN1_ENCODING_st | 244 | typedef struct ASN1_ENCODING_st { |
249 | { | ||
250 | unsigned char *enc; /* DER encoding */ | 245 | unsigned char *enc; /* DER encoding */ |
251 | long len; /* Length of encoding */ | 246 | long len; /* Length of encoding */ |
252 | int modified; /* set to 1 if 'enc' is invalid */ | 247 | int modified; /* set to 1 if 'enc' is invalid */ |
253 | } ASN1_ENCODING; | 248 | } ASN1_ENCODING; |
254 | 249 | ||
255 | /* Used with ASN1 LONG type: if a long is set to this it is omitted */ | 250 | /* Used with ASN1 LONG type: if a long is set to this it is omitted */ |
256 | #define ASN1_LONG_UNDEF 0x7fffffffL | 251 | #define ASN1_LONG_UNDEF 0x7fffffffL |
@@ -373,7 +368,7 @@ TYPEDEF_D2I2D_OF(void); | |||
373 | * ... | 368 | * ... |
374 | * ASN1_ITEM_EXP *iptr; | 369 | * ASN1_ITEM_EXP *iptr; |
375 | * ... | 370 | * ... |
376 | * } SOMETHING; | 371 | * } SOMETHING; |
377 | * | 372 | * |
378 | * It would be initialised as e.g.: | 373 | * It would be initialised as e.g.: |
379 | * | 374 | * |
@@ -461,7 +456,7 @@ typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); | |||
461 | */ | 456 | */ |
462 | 457 | ||
463 | /* If this is set we convert all character strings | 458 | /* If this is set we convert all character strings |
464 | * to UTF8 first | 459 | * to UTF8 first |
465 | */ | 460 | */ |
466 | 461 | ||
467 | #define ASN1_STRFLGS_UTF8_CONVERT 0x10 | 462 | #define ASN1_STRFLGS_UTF8_CONVERT 0x10 |
@@ -511,10 +506,9 @@ DECLARE_ASN1_SET_OF(ASN1_INTEGER) | |||
511 | 506 | ||
512 | DECLARE_STACK_OF(ASN1_GENERALSTRING) | 507 | DECLARE_STACK_OF(ASN1_GENERALSTRING) |
513 | 508 | ||
514 | typedef struct asn1_type_st | 509 | typedef struct asn1_type_st { |
515 | { | ||
516 | int type; | 510 | int type; |
517 | union { | 511 | union { |
518 | char *ptr; | 512 | char *ptr; |
519 | ASN1_BOOLEAN boolean; | 513 | ASN1_BOOLEAN boolean; |
520 | ASN1_STRING * asn1_string; | 514 | ASN1_STRING * asn1_string; |
@@ -538,8 +532,8 @@ typedef struct asn1_type_st | |||
538 | ASN1_STRING * set; | 532 | ASN1_STRING * set; |
539 | ASN1_STRING * sequence; | 533 | ASN1_STRING * sequence; |
540 | ASN1_VALUE * asn1_value; | 534 | ASN1_VALUE * asn1_value; |
541 | } value; | 535 | } value; |
542 | } ASN1_TYPE; | 536 | } ASN1_TYPE; |
543 | 537 | ||
544 | DECLARE_STACK_OF(ASN1_TYPE) | 538 | DECLARE_STACK_OF(ASN1_TYPE) |
545 | DECLARE_ASN1_SET_OF(ASN1_TYPE) | 539 | DECLARE_ASN1_SET_OF(ASN1_TYPE) |
@@ -549,11 +543,10 @@ typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; | |||
549 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) | 543 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) |
550 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) | 544 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) |
551 | 545 | ||
552 | typedef struct NETSCAPE_X509_st | 546 | typedef struct NETSCAPE_X509_st { |
553 | { | ||
554 | ASN1_OCTET_STRING *header; | 547 | ASN1_OCTET_STRING *header; |
555 | X509 *cert; | 548 | X509 *cert; |
556 | } NETSCAPE_X509; | 549 | } NETSCAPE_X509; |
557 | 550 | ||
558 | /* This is used to contain a list of bit names */ | 551 | /* This is used to contain a list of bit names */ |
559 | typedef struct BIT_STRING_BITNAME_st { | 552 | typedef struct BIT_STRING_BITNAME_st { |
@@ -760,7 +753,7 @@ typedef struct BIT_STRING_BITNAME_st { | |||
760 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ | 753 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ |
761 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) | 754 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) |
762 | 755 | ||
763 | /* for the is_set parameter to i2d_ASN1_SET */ | 756 | /* for the is_set parameter to i2d_ASN1_SET */ |
764 | #define IS_SEQUENCE 0 | 757 | #define IS_SEQUENCE 0 |
765 | #define IS_SET 1 | 758 | #define IS_SET 1 |
766 | 759 | ||
@@ -769,86 +762,88 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) | |||
769 | int ASN1_TYPE_get(ASN1_TYPE *a); | 762 | int ASN1_TYPE_get(ASN1_TYPE *a); |
770 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); | 763 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); |
771 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); | 764 | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); |
772 | int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); | 765 | int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); |
773 | 766 | ||
774 | ASN1_OBJECT * ASN1_OBJECT_new(void ); | 767 | ASN1_OBJECT *ASN1_OBJECT_new(void ); |
775 | void ASN1_OBJECT_free(ASN1_OBJECT *a); | 768 | void ASN1_OBJECT_free(ASN1_OBJECT *a); |
776 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); | 769 | int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); |
777 | ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, | 770 | ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, |
778 | long length); | 771 | long length); |
779 | ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, | 772 | ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, |
780 | long length); | 773 | long length); |
781 | 774 | ||
782 | DECLARE_ASN1_ITEM(ASN1_OBJECT) | 775 | DECLARE_ASN1_ITEM(ASN1_OBJECT) |
783 | 776 | ||
784 | DECLARE_STACK_OF(ASN1_OBJECT) | 777 | DECLARE_STACK_OF(ASN1_OBJECT) |
785 | DECLARE_ASN1_SET_OF(ASN1_OBJECT) | 778 | DECLARE_ASN1_SET_OF(ASN1_OBJECT) |
786 | 779 | ||
787 | ASN1_STRING * ASN1_STRING_new(void); | 780 | ASN1_STRING *ASN1_STRING_new(void); |
788 | void ASN1_STRING_free(ASN1_STRING *a); | 781 | void ASN1_STRING_free(ASN1_STRING *a); |
789 | int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); | 782 | int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); |
790 | ASN1_STRING * ASN1_STRING_dup(const ASN1_STRING *a); | 783 | ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a); |
791 | ASN1_STRING * ASN1_STRING_type_new(int type ); | 784 | ASN1_STRING *ASN1_STRING_type_new(int type ); |
792 | int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); | 785 | int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); |
793 | /* Since this is used to store all sorts of things, via macros, for now, make | 786 | /* Since this is used to store all sorts of things, via macros, for now, make |
794 | its data void * */ | 787 | its data void * */ |
795 | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); | 788 | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); |
796 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); | 789 | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); |
797 | int ASN1_STRING_length(const ASN1_STRING *x); | 790 | int ASN1_STRING_length(const ASN1_STRING *x); |
798 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); | 791 | void ASN1_STRING_length_set(ASN1_STRING *x, int n); |
799 | int ASN1_STRING_type(ASN1_STRING *x); | 792 | int ASN1_STRING_type(ASN1_STRING *x); |
800 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); | 793 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); |
801 | 794 | ||
802 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) | 795 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) |
803 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); | 796 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); |
804 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, | 797 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, |
805 | long length); | 798 | const unsigned char **pp, long length); |
806 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, | 799 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); |
807 | int length ); | 800 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); |
808 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); | 801 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); |
809 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); | 802 | int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, |
810 | int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, | 803 | unsigned char *flags, int flags_len); |
811 | unsigned char *flags, int flags_len); | ||
812 | 804 | ||
813 | #ifndef OPENSSL_NO_BIO | 805 | #ifndef OPENSSL_NO_BIO |
814 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | 806 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, |
815 | BIT_STRING_BITNAME *tbl, int indent); | 807 | BIT_STRING_BITNAME *tbl, int indent); |
816 | #endif | 808 | #endif |
817 | int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); | 809 | int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); |
818 | int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | 810 | int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, |
819 | BIT_STRING_BITNAME *tbl); | 811 | BIT_STRING_BITNAME *tbl); |
820 | 812 | ||
821 | int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); | 813 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); |
822 | int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length); | 814 | int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length); |
823 | 815 | ||
824 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) | 816 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) |
825 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); | 817 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); |
826 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, | 818 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, |
827 | long length); | 819 | long length); |
828 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, | 820 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, |
829 | long length); | 821 | long length); |
830 | ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); | 822 | ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); |
831 | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); | 823 | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); |
832 | 824 | ||
833 | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) | 825 | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) |
834 | 826 | ||
835 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); | 827 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); |
836 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); | 828 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); |
837 | ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | 829 | ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, |
838 | int offset_day, long offset_sec); | 830 | int offset_day, long offset_sec); |
839 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); | 831 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); |
840 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); | 832 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
841 | 833 | ||
842 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | 834 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); |
843 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); | 835 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, |
836 | time_t t); | ||
844 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, | 837 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, |
845 | time_t t, int offset_day, long offset_sec); | 838 | time_t t, int offset_day, long offset_sec); |
846 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); | 839 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); |
847 | 840 | ||
848 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) | 841 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) |
849 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); | 842 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); |
850 | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b); | 843 | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, |
851 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); | 844 | const ASN1_OCTET_STRING *b); |
845 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, | ||
846 | int len); | ||
852 | 847 | ||
853 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) | 848 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) |
854 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) | 849 | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) |
@@ -870,46 +865,44 @@ DECLARE_ASN1_FUNCTIONS(ASN1_TIME) | |||
870 | 865 | ||
871 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) | 866 | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) |
872 | 867 | ||
873 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); | 868 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); |
874 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s,time_t t, | 869 | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, |
875 | int offset_day, long offset_sec); | 870 | long offset_sec); |
876 | int ASN1_TIME_check(ASN1_TIME *t); | 871 | int ASN1_TIME_check(ASN1_TIME *t); |
877 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); | 872 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, |
873 | ASN1_GENERALIZEDTIME **out); | ||
878 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); | 874 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); |
879 | 875 | ||
880 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, | 876 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, |
881 | i2d_of_void *i2d, int ex_tag, int ex_class, | 877 | i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); |
882 | int is_set); | ||
883 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, | 878 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, |
884 | const unsigned char **pp, | 879 | const unsigned char **pp, long length, d2i_of_void *d2i, |
885 | long length, d2i_of_void *d2i, | 880 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, int ex_class); |
886 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, | ||
887 | int ex_class); | ||
888 | 881 | ||
889 | #ifndef OPENSSL_NO_BIO | 882 | #ifndef OPENSSL_NO_BIO |
890 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 883 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); |
891 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); | 884 | int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); |
892 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); | 885 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); |
893 | int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size); | 886 | int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); |
894 | int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a); | 887 | int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); |
895 | int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size); | 888 | int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); |
896 | int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); | 889 | int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); |
897 | #endif | 890 | #endif |
898 | int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); | 891 | int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); |
899 | 892 | ||
900 | int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num); | 893 | int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); |
901 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, | 894 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, |
902 | const char *sn, const char *ln); | 895 | const char *sn, const char *ln); |
903 | 896 | ||
904 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); | 897 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); |
905 | long ASN1_INTEGER_get(const ASN1_INTEGER *a); | 898 | long ASN1_INTEGER_get(const ASN1_INTEGER *a); |
906 | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); | 899 | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); |
907 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai,BIGNUM *bn); | 900 | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); |
908 | 901 | ||
909 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); | 902 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); |
910 | long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); | 903 | long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); |
911 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); | 904 | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); |
912 | BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn); | 905 | BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); |
913 | 906 | ||
914 | /* General */ | 907 | /* General */ |
915 | /* given a string, return the correct type, max is the maximum length */ | 908 | /* given a string, return the correct type, max is the maximum length */ |
@@ -917,11 +910,11 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int max); | |||
917 | 910 | ||
918 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); | 911 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); |
919 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, | 912 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, |
920 | long length, int Ptag, int Pclass); | 913 | long length, int Ptag, int Pclass); |
921 | unsigned long ASN1_tag2bit(int tag); | 914 | unsigned long ASN1_tag2bit(int tag); |
922 | /* type is one or more of the B_ASN1_ values. */ | 915 | /* type is one or more of the B_ASN1_ values. */ |
923 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp, | 916 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, |
924 | long length,int type); | 917 | long length, int type); |
925 | 918 | ||
926 | /* PARSING */ | 919 | /* PARSING */ |
927 | int asn1_Finish(ASN1_CTX *c); | 920 | int asn1_Finish(ASN1_CTX *c); |
@@ -929,11 +922,11 @@ int asn1_const_Finish(ASN1_const_CTX *c); | |||
929 | 922 | ||
930 | /* SPECIALS */ | 923 | /* SPECIALS */ |
931 | int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, | 924 | int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, |
932 | int *pclass, long omax); | 925 | int *pclass, long omax); |
933 | int ASN1_check_infinite_end(unsigned char **p,long len); | 926 | int ASN1_check_infinite_end(unsigned char **p, long len); |
934 | int ASN1_const_check_infinite_end(const unsigned char **p,long len); | 927 | int ASN1_const_check_infinite_end(const unsigned char **p, long len); |
935 | void ASN1_put_object(unsigned char **pp, int constructed, int length, | 928 | void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, |
936 | int tag, int xclass); | 929 | int xclass); |
937 | int ASN1_put_eoc(unsigned char **pp); | 930 | int ASN1_put_eoc(unsigned char **pp); |
938 | int ASN1_object_size(int constructed, int length, int tag); | 931 | int ASN1_object_size(int constructed, int length, int tag); |
939 | 932 | ||
@@ -968,7 +961,7 @@ void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); | |||
968 | CHECKED_PPTR_OF(type, x))) | 961 | CHECKED_PPTR_OF(type, x))) |
969 | 962 | ||
970 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); | 963 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); |
971 | int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); | 964 | int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x); |
972 | 965 | ||
973 | #define ASN1_i2d_fp_of(type,i2d,out,x) \ | 966 | #define ASN1_i2d_fp_of(type,i2d,out,x) \ |
974 | (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ | 967 | (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ |
@@ -996,7 +989,7 @@ void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); | |||
996 | CHECKED_PPTR_OF(type, x))) | 989 | CHECKED_PPTR_OF(type, x))) |
997 | 990 | ||
998 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); | 991 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); |
999 | int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x); | 992 | int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x); |
1000 | 993 | ||
1001 | #define ASN1_i2d_bio_of(type,i2d,out,x) \ | 994 | #define ASN1_i2d_bio_of(type,i2d,out,x) \ |
1002 | (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ | 995 | (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ |
@@ -1015,9 +1008,9 @@ int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); | |||
1015 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); | 1008 | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); |
1016 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); | 1009 | int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); |
1017 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | 1010 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, |
1018 | unsigned char *buf, int off); | 1011 | unsigned char *buf, int off); |
1019 | int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent); | 1012 | int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); |
1020 | int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump); | 1013 | int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump); |
1021 | #endif | 1014 | #endif |
1022 | const char *ASN1_tag2str(int tag); | 1015 | const char *ASN1_tag2str(int tag); |
1023 | 1016 | ||
@@ -1027,37 +1020,35 @@ DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509) | |||
1027 | 1020 | ||
1028 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); | 1021 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); |
1029 | 1022 | ||
1030 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, | 1023 | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); |
1031 | unsigned char *data, int len); | 1024 | int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len); |
1032 | int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, | 1025 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, |
1033 | unsigned char *data, int max_len); | 1026 | int len); |
1034 | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, | 1027 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, |
1035 | unsigned char *data, int len); | 1028 | int max_len); |
1036 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, | ||
1037 | unsigned char *data, int max_len); | ||
1038 | 1029 | ||
1039 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | 1030 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, |
1040 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); | 1031 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); |
1041 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | 1032 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, |
1042 | unsigned char **buf, int *len ); | 1033 | unsigned char **buf, int *len ); |
1043 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); | 1034 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); |
1044 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | 1035 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); |
1045 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, | 1036 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, |
1046 | ASN1_OCTET_STRING **oct); | 1037 | ASN1_OCTET_STRING **oct); |
1047 | 1038 | ||
1048 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); | 1039 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, |
1040 | ASN1_OCTET_STRING **oct); | ||
1049 | 1041 | ||
1050 | void ASN1_STRING_set_default_mask(unsigned long mask); | 1042 | void ASN1_STRING_set_default_mask(unsigned long mask); |
1051 | int ASN1_STRING_set_default_mask_asc(const char *p); | 1043 | int ASN1_STRING_set_default_mask_asc(const char *p); |
1052 | unsigned long ASN1_STRING_get_default_mask(void); | 1044 | unsigned long ASN1_STRING_get_default_mask(void); |
1053 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, | 1045 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, |
1054 | int inform, unsigned long mask); | 1046 | int inform, unsigned long mask); |
1055 | int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, | 1047 | int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, |
1056 | int inform, unsigned long mask, | 1048 | int inform, unsigned long mask, long minsize, long maxsize); |
1057 | long minsize, long maxsize); | ||
1058 | 1049 | ||
1059 | ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, | 1050 | ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, |
1060 | const unsigned char *in, int inlen, int inform, int nid); | 1051 | const unsigned char *in, int inlen, int inform, int nid); |
1061 | ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); | 1052 | ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); |
1062 | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); | 1053 | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); |
1063 | void ASN1_STRING_TABLE_cleanup(void); | 1054 | void ASN1_STRING_TABLE_cleanup(void); |
@@ -1067,7 +1058,8 @@ void ASN1_STRING_TABLE_cleanup(void); | |||
1067 | /* Old API compatible functions */ | 1058 | /* Old API compatible functions */ |
1068 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); | 1059 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); |
1069 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); | 1060 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); |
1070 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); | 1061 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, |
1062 | long len, const ASN1_ITEM *it); | ||
1071 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | 1063 | 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); | 1064 | int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); |
1073 | 1065 | ||
@@ -1079,7 +1071,7 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | |||
1079 | /* ASN1 Print flags */ | 1071 | /* ASN1 Print flags */ |
1080 | 1072 | ||
1081 | /* Indicate missing OPTIONAL fields */ | 1073 | /* Indicate missing OPTIONAL fields */ |
1082 | #define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 | 1074 | #define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 |
1083 | /* Mark start and end of SEQUENCE */ | 1075 | /* Mark start and end of SEQUENCE */ |
1084 | #define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 | 1076 | #define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 |
1085 | /* Mark start and end of SEQUENCE/SET OF */ | 1077 | /* Mark start and end of SEQUENCE/SET OF */ |
@@ -1098,7 +1090,7 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); | |||
1098 | #define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 | 1090 | #define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 |
1099 | 1091 | ||
1100 | int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, | 1092 | int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, |
1101 | const ASN1_ITEM *it, const ASN1_PCTX *pctx); | 1093 | const ASN1_ITEM *it, const ASN1_PCTX *pctx); |
1102 | ASN1_PCTX *ASN1_PCTX_new(void); | 1094 | ASN1_PCTX *ASN1_PCTX_new(void); |
1103 | void ASN1_PCTX_free(ASN1_PCTX *p); | 1095 | void ASN1_PCTX_free(ASN1_PCTX *p); |
1104 | unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); | 1096 | unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); |
@@ -1117,14 +1109,12 @@ BIO_METHOD *BIO_f_asn1(void); | |||
1117 | BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); | 1109 | BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); |
1118 | 1110 | ||
1119 | int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, | 1111 | int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, |
1120 | const ASN1_ITEM *it); | 1112 | const ASN1_ITEM *it); |
1121 | int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, | 1113 | int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, |
1122 | const char *hdr, | 1114 | const char *hdr, const ASN1_ITEM *it); |
1123 | const ASN1_ITEM *it); | ||
1124 | int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, | 1115 | int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, |
1125 | int ctype_nid, int econt_nid, | 1116 | int ctype_nid, int econt_nid, STACK_OF(X509_ALGOR) *mdalgs, |
1126 | STACK_OF(X509_ALGOR) *mdalgs, | 1117 | const ASN1_ITEM *it); |
1127 | const ASN1_ITEM *it); | ||
1128 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); | 1118 | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); |
1129 | int SMIME_crlf_copy(BIO *in, BIO *out, int flags); | 1119 | int SMIME_crlf_copy(BIO *in, BIO *out, int flags); |
1130 | int SMIME_text(BIO *in, BIO *out); | 1120 | int SMIME_text(BIO *in, BIO *out); |
diff --git a/src/lib/libssl/src/crypto/asn1/asn1_locl.h b/src/lib/libssl/src/crypto/asn1/asn1_locl.h index 64bf8ec2fa..bcbb605202 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1_locl.h +++ b/src/lib/libssl/src/crypto/asn1/asn1_locl.h | |||
@@ -10,7 +10,7 @@ | |||
10 | * are met: | 10 | * are met: |
11 | * | 11 | * |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * | 14 | * |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
@@ -60,8 +60,7 @@ | |||
60 | 60 | ||
61 | /* ASN1 print context structure */ | 61 | /* ASN1 print context structure */ |
62 | 62 | ||
63 | struct asn1_pctx_st | 63 | struct asn1_pctx_st { |
64 | { | ||
65 | unsigned long flags; | 64 | unsigned long flags; |
66 | unsigned long nm_flags; | 65 | unsigned long nm_flags; |
67 | unsigned long cert_flags; | 66 | unsigned long cert_flags; |
@@ -71,8 +70,7 @@ struct asn1_pctx_st | |||
71 | 70 | ||
72 | /* ASN1 public key method structure */ | 71 | /* ASN1 public key method structure */ |
73 | 72 | ||
74 | struct evp_pkey_asn1_method_st | 73 | struct evp_pkey_asn1_method_st { |
75 | { | ||
76 | int pkey_id; | 74 | int pkey_id; |
77 | int pkey_base_id; | 75 | int pkey_base_id; |
78 | unsigned long pkey_flags; | 76 | unsigned long pkey_flags; |
@@ -84,44 +82,40 @@ struct evp_pkey_asn1_method_st | |||
84 | int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk); | 82 | int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk); |
85 | int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); | 83 | int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); |
86 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 84 | int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
87 | ASN1_PCTX *pctx); | 85 | ASN1_PCTX *pctx); |
88 | 86 | ||
89 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); | 87 | int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf); |
90 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); | 88 | int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk); |
91 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 89 | int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
92 | ASN1_PCTX *pctx); | 90 | ASN1_PCTX *pctx); |
93 | 91 | ||
94 | int (*pkey_size)(const EVP_PKEY *pk); | 92 | int (*pkey_size)(const EVP_PKEY *pk); |
95 | int (*pkey_bits)(const EVP_PKEY *pk); | 93 | int (*pkey_bits)(const EVP_PKEY *pk); |
96 | 94 | ||
97 | int (*param_decode)(EVP_PKEY *pkey, | 95 | int (*param_decode)(EVP_PKEY *pkey, const unsigned char **pder, |
98 | const unsigned char **pder, int derlen); | 96 | int derlen); |
99 | int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder); | 97 | int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder); |
100 | int (*param_missing)(const EVP_PKEY *pk); | 98 | int (*param_missing)(const EVP_PKEY *pk); |
101 | int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); | 99 | int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); |
102 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); | 100 | int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); |
103 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, | 101 | int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, |
104 | ASN1_PCTX *pctx); | 102 | ASN1_PCTX *pctx); |
105 | int (*sig_print)(BIO *out, | 103 | int (*sig_print)(BIO *out, const X509_ALGOR *sigalg, |
106 | const X509_ALGOR *sigalg, const ASN1_STRING *sig, | 104 | const ASN1_STRING *sig, int indent, ASN1_PCTX *pctx); |
107 | int indent, ASN1_PCTX *pctx); | ||
108 | |||
109 | 105 | ||
110 | void (*pkey_free)(EVP_PKEY *pkey); | 106 | void (*pkey_free)(EVP_PKEY *pkey); |
111 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); | 107 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2); |
112 | 108 | ||
113 | /* Legacy functions for old PEM */ | 109 | /* Legacy functions for old PEM */ |
114 | 110 | ||
115 | int (*old_priv_decode)(EVP_PKEY *pkey, | 111 | int (*old_priv_decode)(EVP_PKEY *pkey, const unsigned char **pder, |
116 | const unsigned char **pder, int derlen); | 112 | int derlen); |
117 | int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); | 113 | int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder); |
118 | /* Custom ASN1 signature verification */ | 114 | /* Custom ASN1 signature verification */ |
119 | int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, | 115 | int (*item_verify)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, |
120 | X509_ALGOR *a, ASN1_BIT_STRING *sig, | 116 | X509_ALGOR *a, ASN1_BIT_STRING *sig, EVP_PKEY *pkey); |
121 | EVP_PKEY *pkey); | ||
122 | int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, | 117 | int (*item_sign)(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, |
123 | X509_ALGOR *alg1, X509_ALGOR *alg2, | 118 | X509_ALGOR *alg1, X509_ALGOR *alg2, ASN1_BIT_STRING *sig); |
124 | ASN1_BIT_STRING *sig); | ||
125 | 119 | ||
126 | } /* EVP_PKEY_ASN1_METHOD */; | 120 | } /* EVP_PKEY_ASN1_METHOD */; |
127 | 121 | ||
@@ -134,13 +128,12 @@ struct evp_pkey_asn1_method_st | |||
134 | 128 | ||
135 | #define X509_CRL_METHOD_DYNAMIC 1 | 129 | #define X509_CRL_METHOD_DYNAMIC 1 |
136 | 130 | ||
137 | struct x509_crl_method_st | 131 | struct x509_crl_method_st { |
138 | { | ||
139 | int flags; | 132 | int flags; |
140 | int (*crl_init)(X509_CRL *crl); | 133 | int (*crl_init)(X509_CRL *crl); |
141 | int (*crl_free)(X509_CRL *crl); | 134 | int (*crl_free)(X509_CRL *crl); |
142 | int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, | 135 | int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, |
143 | ASN1_INTEGER *ser, X509_NAME *issuer); | 136 | ASN1_INTEGER *ser, X509_NAME *issuer); |
144 | int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk); | 137 | int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk); |
145 | }; | 138 | }; |
146 | 139 | ||
@@ -154,5 +147,5 @@ struct x509_crl_method_st | |||
154 | #define UNICODE_IS_SURROGATE(x) \ | 147 | #define UNICODE_IS_SURROGATE(x) \ |
155 | ((x) >= UNICODE_SURROGATE_MIN && (x) <= UNICODE_SURROGATE_MAX) | 148 | ((x) >= UNICODE_SURROGATE_MIN && (x) <= UNICODE_SURROGATE_MAX) |
156 | 149 | ||
157 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); | 150 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); |
158 | int UTF8_putc(unsigned char *str, int len, unsigned long value); | 151 | int UTF8_putc(unsigned char *str, int len, unsigned long value); |
diff --git a/src/lib/libssl/src/crypto/asn1/asn1_mac.h b/src/lib/libssl/src/crypto/asn1/asn1_mac.h index ecc2c77228..da03a8cb92 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1_mac.h +++ b/src/lib/libssl/src/crypto/asn1/asn1_mac.h | |||
@@ -5,21 +5,21 @@ | |||
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -67,7 +67,7 @@ extern "C" { | |||
67 | 67 | ||
68 | #ifndef ASN1_MAC_ERR_LIB | 68 | #ifndef ASN1_MAC_ERR_LIB |
69 | #define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 | 69 | #define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #define ASN1_MAC_H_err(f,r,line) \ | 72 | #define ASN1_MAC_H_err(f,r,line) \ |
73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) | 73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) |
@@ -433,7 +433,7 @@ err:\ | |||
433 | return(r); | 433 | return(r); |
434 | 434 | ||
435 | int asn1_GetSequence(ASN1_const_CTX *c, long *length); | 435 | int asn1_GetSequence(ASN1_const_CTX *c, long *length); |
436 | void asn1_add_error(const unsigned char *address,int offset); | 436 | void asn1_add_error(const unsigned char *address, int offset); |
437 | #ifdef __cplusplus | 437 | #ifdef __cplusplus |
438 | } | 438 | } |
439 | #endif | 439 | #endif |