diff options
21 files changed, 2 insertions, 1618 deletions
diff --git a/src/lib/libcrypto/asn1/a_digest.c b/src/lib/libcrypto/asn1/a_digest.c index cbdeea6ac0..8a4b24a06b 100644 --- a/src/lib/libcrypto/asn1/a_digest.c +++ b/src/lib/libcrypto/asn1/a_digest.c | |||
@@ -70,32 +70,6 @@ | |||
70 | #include <openssl/buffer.h> | 70 | #include <openssl/buffer.h> |
71 | #include <openssl/x509.h> | 71 | #include <openssl/x509.h> |
72 | 72 | ||
73 | #ifndef NO_ASN1_OLD | ||
74 | |||
75 | int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, | ||
76 | unsigned char *md, unsigned int *len) | ||
77 | { | ||
78 | int i; | ||
79 | unsigned char *str,*p; | ||
80 | |||
81 | i=i2d(data,NULL); | ||
82 | if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) | ||
83 | { | ||
84 | ASN1err(ASN1_F_ASN1_DIGEST,ERR_R_MALLOC_FAILURE); | ||
85 | return(0); | ||
86 | } | ||
87 | p=str; | ||
88 | i2d(data,&p); | ||
89 | |||
90 | if (!EVP_Digest(str, i, md, len, type, NULL)) | ||
91 | return 0; | ||
92 | OPENSSL_free(str); | ||
93 | return(1); | ||
94 | } | ||
95 | |||
96 | #endif | ||
97 | |||
98 | |||
99 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | 73 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, |
100 | unsigned char *md, unsigned int *len) | 74 | unsigned char *md, unsigned int *len) |
101 | { | 75 | { |
@@ -110,4 +84,3 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | |||
110 | OPENSSL_free(str); | 84 | OPENSSL_free(str); |
111 | return(1); | 85 | return(1); |
112 | } | 86 | } |
113 | |||
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c deleted file mode 100644 index d726c8d3a8..0000000000 --- a/src/lib/libcrypto/asn1/a_set.c +++ /dev/null | |||
@@ -1,241 +0,0 @@ | |||
1 | /* crypto/asn1/a_set.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
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 | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
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. | ||
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. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
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: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
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 | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
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 | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/asn1_mac.h> | ||
62 | |||
63 | #ifndef NO_ASN1_OLD | ||
64 | |||
65 | typedef struct | ||
66 | { | ||
67 | unsigned char *pbData; | ||
68 | int cbData; | ||
69 | } MYBLOB; | ||
70 | |||
71 | /* SetBlobCmp | ||
72 | * This function compares two elements of SET_OF block | ||
73 | */ | ||
74 | static int SetBlobCmp(const void *elem1, const void *elem2 ) | ||
75 | { | ||
76 | const MYBLOB *b1 = (const MYBLOB *)elem1; | ||
77 | const MYBLOB *b2 = (const MYBLOB *)elem2; | ||
78 | int r; | ||
79 | |||
80 | r = memcmp(b1->pbData, b2->pbData, | ||
81 | b1->cbData < b2->cbData ? b1->cbData : b2->cbData); | ||
82 | if(r != 0) | ||
83 | return r; | ||
84 | return b1->cbData-b2->cbData; | ||
85 | } | ||
86 | |||
87 | /* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ | ||
88 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, | ||
89 | i2d_of_void *i2d, int ex_tag, int ex_class, | ||
90 | int is_set) | ||
91 | { | ||
92 | int ret=0,r; | ||
93 | int i; | ||
94 | unsigned char *p; | ||
95 | unsigned char *pStart, *pTempMem; | ||
96 | MYBLOB *rgSetBlob; | ||
97 | int totSize; | ||
98 | |||
99 | if (a == NULL) return(0); | ||
100 | for (i=sk_OPENSSL_BLOCK_num(a)-1; i>=0; i--) | ||
101 | ret+=i2d(sk_OPENSSL_BLOCK_value(a,i),NULL); | ||
102 | r=ASN1_object_size(1,ret,ex_tag); | ||
103 | if (pp == NULL) return(r); | ||
104 | |||
105 | p= *pp; | ||
106 | ASN1_put_object(&p,1,ret,ex_tag,ex_class); | ||
107 | |||
108 | /* Modified by gp@nsj.co.jp */ | ||
109 | /* And then again by Ben */ | ||
110 | /* And again by Steve */ | ||
111 | |||
112 | if(!is_set || (sk_OPENSSL_BLOCK_num(a) < 2)) | ||
113 | { | ||
114 | for (i=0; i<sk_OPENSSL_BLOCK_num(a); i++) | ||
115 | i2d(sk_OPENSSL_BLOCK_value(a,i),&p); | ||
116 | |||
117 | *pp=p; | ||
118 | return(r); | ||
119 | } | ||
120 | |||
121 | pStart = p; /* Catch the beg of Setblobs*/ | ||
122 | /* In this array we will store the SET blobs */ | ||
123 | rgSetBlob = OPENSSL_malloc(sk_OPENSSL_BLOCK_num(a) * sizeof(MYBLOB)); | ||
124 | if (rgSetBlob == NULL) | ||
125 | { | ||
126 | ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE); | ||
127 | return(0); | ||
128 | } | ||
129 | |||
130 | for (i=0; i<sk_OPENSSL_BLOCK_num(a); i++) | ||
131 | { | ||
132 | rgSetBlob[i].pbData = p; /* catch each set encode blob */ | ||
133 | i2d(sk_OPENSSL_BLOCK_value(a,i),&p); | ||
134 | rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; /* Length of this | ||
135 | SetBlob | ||
136 | */ | ||
137 | } | ||
138 | *pp=p; | ||
139 | totSize = p - pStart; /* This is the total size of all set blobs */ | ||
140 | |||
141 | /* Now we have to sort the blobs. I am using a simple algo. | ||
142 | *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/ | ||
143 | qsort( rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp); | ||
144 | if (!(pTempMem = OPENSSL_malloc(totSize))) | ||
145 | { | ||
146 | ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE); | ||
147 | return(0); | ||
148 | } | ||
149 | |||
150 | /* Copy to temp mem */ | ||
151 | p = pTempMem; | ||
152 | for(i=0; i<sk_OPENSSL_BLOCK_num(a); ++i) | ||
153 | { | ||
154 | memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData); | ||
155 | p += rgSetBlob[i].cbData; | ||
156 | } | ||
157 | |||
158 | /* Copy back to user mem*/ | ||
159 | memcpy(pStart, pTempMem, totSize); | ||
160 | OPENSSL_free(pTempMem); | ||
161 | OPENSSL_free(rgSetBlob); | ||
162 | |||
163 | return(r); | ||
164 | } | ||
165 | |||
166 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, | ||
167 | const unsigned char **pp, | ||
168 | long length, d2i_of_void *d2i, | ||
169 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, | ||
170 | int ex_class) | ||
171 | { | ||
172 | ASN1_const_CTX c; | ||
173 | STACK_OF(OPENSSL_BLOCK) *ret=NULL; | ||
174 | |||
175 | if ((a == NULL) || ((*a) == NULL)) | ||
176 | { | ||
177 | if ((ret=sk_OPENSSL_BLOCK_new_null()) == NULL) | ||
178 | { | ||
179 | ASN1err(ASN1_F_D2I_ASN1_SET,ERR_R_MALLOC_FAILURE); | ||
180 | goto err; | ||
181 | } | ||
182 | } | ||
183 | else | ||
184 | ret=(*a); | ||
185 | |||
186 | c.p= *pp; | ||
187 | c.max=(length == 0)?0:(c.p+length); | ||
188 | |||
189 | c.inf=ASN1_get_object(&c.p,&c.slen,&c.tag,&c.xclass,c.max-c.p); | ||
190 | if (c.inf & 0x80) goto err; | ||
191 | if (ex_class != c.xclass) | ||
192 | { | ||
193 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_BAD_CLASS); | ||
194 | goto err; | ||
195 | } | ||
196 | if (ex_tag != c.tag) | ||
197 | { | ||
198 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_BAD_TAG); | ||
199 | goto err; | ||
200 | } | ||
201 | if ((c.slen+c.p) > c.max) | ||
202 | { | ||
203 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_LENGTH_ERROR); | ||
204 | goto err; | ||
205 | } | ||
206 | /* check for infinite constructed - it can be as long | ||
207 | * as the amount of data passed to us */ | ||
208 | if (c.inf == (V_ASN1_CONSTRUCTED+1)) | ||
209 | c.slen=length+ *pp-c.p; | ||
210 | c.max=c.p+c.slen; | ||
211 | |||
212 | while (c.p < c.max) | ||
213 | { | ||
214 | char *s; | ||
215 | |||
216 | if (M_ASN1_D2I_end_sequence()) break; | ||
217 | /* XXX: This was called with 4 arguments, incorrectly, it seems | ||
218 | if ((s=func(NULL,&c.p,c.slen,c.max-c.p)) == NULL) */ | ||
219 | if ((s=d2i(NULL,&c.p,c.slen)) == NULL) | ||
220 | { | ||
221 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_ERROR_PARSING_SET_ELEMENT); | ||
222 | asn1_add_error(*pp,(int)(c.p- *pp)); | ||
223 | goto err; | ||
224 | } | ||
225 | if (!sk_OPENSSL_BLOCK_push(ret,s)) goto err; | ||
226 | } | ||
227 | if (a != NULL) (*a)=ret; | ||
228 | *pp=c.p; | ||
229 | return(ret); | ||
230 | err: | ||
231 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) | ||
232 | { | ||
233 | if (free_func != NULL) | ||
234 | sk_OPENSSL_BLOCK_pop_free(ret,free_func); | ||
235 | else | ||
236 | sk_OPENSSL_BLOCK_free(ret); | ||
237 | } | ||
238 | return(NULL); | ||
239 | } | ||
240 | |||
241 | #endif | ||
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c index 7b4a193d6b..01b6292b65 100644 --- a/src/lib/libcrypto/asn1/a_sign.c +++ b/src/lib/libcrypto/asn1/a_sign.c | |||
@@ -125,94 +125,6 @@ | |||
125 | #include <openssl/buffer.h> | 125 | #include <openssl/buffer.h> |
126 | #include "asn1_locl.h" | 126 | #include "asn1_locl.h" |
127 | 127 | ||
128 | #ifndef NO_ASN1_OLD | ||
129 | |||
130 | int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, | ||
131 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, | ||
132 | const EVP_MD *type) | ||
133 | { | ||
134 | EVP_MD_CTX ctx; | ||
135 | unsigned char *p,*buf_in=NULL,*buf_out=NULL; | ||
136 | int i,inl=0,outl=0,outll=0; | ||
137 | X509_ALGOR *a; | ||
138 | |||
139 | EVP_MD_CTX_init(&ctx); | ||
140 | for (i=0; i<2; i++) | ||
141 | { | ||
142 | if (i == 0) | ||
143 | a=algor1; | ||
144 | else | ||
145 | a=algor2; | ||
146 | if (a == NULL) continue; | ||
147 | if (type->pkey_type == NID_dsaWithSHA1) | ||
148 | { | ||
149 | /* special case: RFC 2459 tells us to omit 'parameters' | ||
150 | * with id-dsa-with-sha1 */ | ||
151 | ASN1_TYPE_free(a->parameter); | ||
152 | a->parameter = NULL; | ||
153 | } | ||
154 | else if ((a->parameter == NULL) || | ||
155 | (a->parameter->type != V_ASN1_NULL)) | ||
156 | { | ||
157 | ASN1_TYPE_free(a->parameter); | ||
158 | if ((a->parameter=ASN1_TYPE_new()) == NULL) goto err; | ||
159 | a->parameter->type=V_ASN1_NULL; | ||
160 | } | ||
161 | ASN1_OBJECT_free(a->algorithm); | ||
162 | a->algorithm=OBJ_nid2obj(type->pkey_type); | ||
163 | if (a->algorithm == NULL) | ||
164 | { | ||
165 | ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_UNKNOWN_OBJECT_TYPE); | ||
166 | goto err; | ||
167 | } | ||
168 | if (a->algorithm->length == 0) | ||
169 | { | ||
170 | ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD); | ||
171 | goto err; | ||
172 | } | ||
173 | } | ||
174 | inl=i2d(data,NULL); | ||
175 | buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl); | ||
176 | outll=outl=EVP_PKEY_size(pkey); | ||
177 | buf_out=(unsigned char *)OPENSSL_malloc((unsigned int)outl); | ||
178 | if ((buf_in == NULL) || (buf_out == NULL)) | ||
179 | { | ||
180 | outl=0; | ||
181 | ASN1err(ASN1_F_ASN1_SIGN,ERR_R_MALLOC_FAILURE); | ||
182 | goto err; | ||
183 | } | ||
184 | p=buf_in; | ||
185 | |||
186 | i2d(data,&p); | ||
187 | if (!EVP_SignInit_ex(&ctx,type, NULL) | ||
188 | || !EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl) | ||
189 | || !EVP_SignFinal(&ctx,(unsigned char *)buf_out, | ||
190 | (unsigned int *)&outl,pkey)) | ||
191 | { | ||
192 | outl=0; | ||
193 | ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB); | ||
194 | goto err; | ||
195 | } | ||
196 | if (signature->data != NULL) OPENSSL_free(signature->data); | ||
197 | signature->data=buf_out; | ||
198 | buf_out=NULL; | ||
199 | signature->length=outl; | ||
200 | /* In the interests of compatibility, I'll make sure that | ||
201 | * the bit string has a 'not-used bits' value of 0 | ||
202 | */ | ||
203 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); | ||
204 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; | ||
205 | err: | ||
206 | EVP_MD_CTX_cleanup(&ctx); | ||
207 | if (buf_in != NULL) | ||
208 | { OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); } | ||
209 | if (buf_out != NULL) | ||
210 | { OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); } | ||
211 | return(outl); | ||
212 | } | ||
213 | |||
214 | #endif | ||
215 | |||
216 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | 128 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, |
217 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey, | 129 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey, |
218 | const EVP_MD *type) | 130 | const EVP_MD *type) |
diff --git a/src/lib/libcrypto/asn1/a_verify.c b/src/lib/libcrypto/asn1/a_verify.c index fc84cd3d19..5eb47d768c 100644 --- a/src/lib/libcrypto/asn1/a_verify.c +++ b/src/lib/libcrypto/asn1/a_verify.c | |||
@@ -72,65 +72,6 @@ | |||
72 | #include <openssl/buffer.h> | 72 | #include <openssl/buffer.h> |
73 | #include <openssl/evp.h> | 73 | #include <openssl/evp.h> |
74 | 74 | ||
75 | #ifndef NO_ASN1_OLD | ||
76 | |||
77 | int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, | ||
78 | char *data, EVP_PKEY *pkey) | ||
79 | { | ||
80 | EVP_MD_CTX ctx; | ||
81 | const EVP_MD *type; | ||
82 | unsigned char *p,*buf_in=NULL; | ||
83 | int ret= -1,i,inl; | ||
84 | |||
85 | EVP_MD_CTX_init(&ctx); | ||
86 | i=OBJ_obj2nid(a->algorithm); | ||
87 | type=EVP_get_digestbyname(OBJ_nid2sn(i)); | ||
88 | if (type == NULL) | ||
89 | { | ||
90 | ASN1err(ASN1_F_ASN1_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); | ||
91 | goto err; | ||
92 | } | ||
93 | |||
94 | inl=i2d(data,NULL); | ||
95 | buf_in=OPENSSL_malloc((unsigned int)inl); | ||
96 | if (buf_in == NULL) | ||
97 | { | ||
98 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE); | ||
99 | goto err; | ||
100 | } | ||
101 | p=buf_in; | ||
102 | |||
103 | i2d(data,&p); | ||
104 | if (!EVP_VerifyInit_ex(&ctx,type, NULL) | ||
105 | || !EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl)) | ||
106 | { | ||
107 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); | ||
108 | ret=0; | ||
109 | goto err; | ||
110 | } | ||
111 | |||
112 | OPENSSL_cleanse(buf_in,(unsigned int)inl); | ||
113 | OPENSSL_free(buf_in); | ||
114 | |||
115 | if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, | ||
116 | (unsigned int)signature->length,pkey) <= 0) | ||
117 | { | ||
118 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); | ||
119 | ret=0; | ||
120 | goto err; | ||
121 | } | ||
122 | /* we don't need to zero the 'ctx' because we just checked | ||
123 | * public information */ | ||
124 | /* memset(&ctx,0,sizeof(ctx)); */ | ||
125 | ret=1; | ||
126 | err: | ||
127 | EVP_MD_CTX_cleanup(&ctx); | ||
128 | return(ret); | ||
129 | } | ||
130 | |||
131 | #endif | ||
132 | |||
133 | |||
134 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, | 75 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, |
135 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) | 76 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) |
136 | { | 77 | { |
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index c48ce3cb92..c4fa8c649b 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -765,10 +765,6 @@ typedef struct BIT_STRING_BITNAME_st { | |||
765 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ | 765 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ |
766 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) | 766 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) |
767 | 767 | ||
768 | /* for the is_set parameter to i2d_ASN1_SET */ | ||
769 | #define IS_SEQUENCE 0 | ||
770 | #define IS_SET 1 | ||
771 | |||
772 | DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) | 768 | DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) |
773 | 769 | ||
774 | int ASN1_TYPE_get(ASN1_TYPE *a); | 770 | int ASN1_TYPE_get(ASN1_TYPE *a); |
@@ -888,15 +884,6 @@ int ASN1_TIME_check(ASN1_TIME *t); | |||
888 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); | 884 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); |
889 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); | 885 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); |
890 | 886 | ||
891 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, | ||
892 | i2d_of_void *i2d, int ex_tag, int ex_class, | ||
893 | int is_set); | ||
894 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, | ||
895 | const unsigned char **pp, | ||
896 | long length, d2i_of_void *d2i, | ||
897 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, | ||
898 | int ex_class); | ||
899 | |||
900 | #ifndef OPENSSL_NO_BIO | 887 | #ifndef OPENSSL_NO_BIO |
901 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 888 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); |
902 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); | 889 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); |
@@ -1047,19 +1034,7 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, | |||
1047 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, | 1034 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, |
1048 | unsigned char *data, int max_len); | 1035 | unsigned char *data, int max_len); |
1049 | 1036 | ||
1050 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | ||
1051 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); | ||
1052 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | ||
1053 | unsigned char **buf, int *len ); | ||
1054 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); | ||
1055 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | 1037 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); |
1056 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, | ||
1057 | ASN1_OCTET_STRING **oct); | ||
1058 | |||
1059 | #define ASN1_pack_string_of(type,obj,i2d,oct) \ | ||
1060 | (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \ | ||
1061 | CHECKED_I2D_OF(type, i2d), \ | ||
1062 | oct)) | ||
1063 | 1038 | ||
1064 | 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, ASN1_OCTET_STRING **oct); |
1065 | 1040 | ||
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h index 87bd0e9e1d..c60b197552 100644 --- a/src/lib/libcrypto/asn1/asn1_mac.h +++ b/src/lib/libcrypto/asn1/asn1_mac.h | |||
@@ -176,19 +176,10 @@ err:\ | |||
176 | M_ASN1_D2I_get_imp(b,func, type);\ | 176 | M_ASN1_D2I_get_imp(b,func, type);\ |
177 | } | 177 | } |
178 | 178 | ||
179 | #define M_ASN1_D2I_get_set(r,func,free_func) \ | ||
180 | M_ASN1_D2I_get_imp_set(r,func,free_func, \ | ||
181 | V_ASN1_SET,V_ASN1_UNIVERSAL); | ||
182 | |||
183 | #define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ | 179 | #define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ |
184 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ | 180 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ |
185 | V_ASN1_SET,V_ASN1_UNIVERSAL); | 181 | V_ASN1_SET,V_ASN1_UNIVERSAL); |
186 | 182 | ||
187 | #define M_ASN1_D2I_get_set_opt(r,func,free_func) \ | ||
188 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | ||
189 | V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ | ||
190 | { M_ASN1_D2I_get_set(r,func,free_func); } | ||
191 | |||
192 | #define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ | 183 | #define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ |
193 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | 184 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ |
194 | V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ | 185 | V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ |
@@ -210,15 +201,6 @@ err:\ | |||
210 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 201 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
211 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); | 202 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); |
212 | 203 | ||
213 | #define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ | ||
214 | if ((c.slen != 0) && \ | ||
215 | (M_ASN1_next == \ | ||
216 | (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ | ||
217 | { \ | ||
218 | M_ASN1_D2I_get_imp_set(b,func,free_func,\ | ||
219 | tag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
220 | } | ||
221 | |||
222 | #define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ | 204 | #define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ |
223 | if ((c.slen != 0) && \ | 205 | if ((c.slen != 0) && \ |
224 | (M_ASN1_next == \ | 206 | (M_ASN1_next == \ |
@@ -228,39 +210,19 @@ err:\ | |||
228 | tag,V_ASN1_CONTEXT_SPECIFIC); \ | 210 | tag,V_ASN1_CONTEXT_SPECIFIC); \ |
229 | } | 211 | } |
230 | 212 | ||
231 | #define M_ASN1_D2I_get_seq(r,func,free_func) \ | ||
232 | M_ASN1_D2I_get_imp_set(r,func,free_func,\ | ||
233 | V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); | ||
234 | |||
235 | #define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ | 213 | #define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ |
236 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ | 214 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ |
237 | V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) | 215 | V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) |
238 | 216 | ||
239 | #define M_ASN1_D2I_get_seq_opt(r,func,free_func) \ | ||
240 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | ||
241 | V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ | ||
242 | { M_ASN1_D2I_get_seq(r,func,free_func); } | ||
243 | |||
244 | #define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ | 217 | #define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ |
245 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | 218 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ |
246 | V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ | 219 | V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ |
247 | { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } | 220 | { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } |
248 | 221 | ||
249 | #define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \ | ||
250 | M_ASN1_D2I_get_imp_set(r,func,free_func,\ | ||
251 | x,V_ASN1_CONTEXT_SPECIFIC); | ||
252 | |||
253 | #define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ | 222 | #define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ |
254 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ | 223 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ |
255 | x,V_ASN1_CONTEXT_SPECIFIC); | 224 | x,V_ASN1_CONTEXT_SPECIFIC); |
256 | 225 | ||
257 | #define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \ | ||
258 | c.q=c.p; \ | ||
259 | if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\ | ||
260 | (void (*)())free_func,a,b) == NULL) \ | ||
261 | { c.line=__LINE__; goto err; } \ | ||
262 | c.slen-=(c.p-c.q); | ||
263 | |||
264 | #define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ | 226 | #define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ |
265 | c.q=c.p; \ | 227 | c.q=c.p; \ |
266 | if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ | 228 | if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ |
@@ -299,33 +261,6 @@ err:\ | |||
299 | c.slen-=(c.p-c.q); \ | 261 | c.slen-=(c.p-c.q); \ |
300 | } | 262 | } |
301 | 263 | ||
302 | #define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \ | ||
303 | if ((c.slen != 0) && (M_ASN1_next == \ | ||
304 | (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ | ||
305 | { \ | ||
306 | int Tinf,Ttag,Tclass; \ | ||
307 | long Tlen; \ | ||
308 | \ | ||
309 | c.q=c.p; \ | ||
310 | Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ | ||
311 | if (Tinf & 0x80) \ | ||
312 | { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ | ||
313 | c.line=__LINE__; goto err; } \ | ||
314 | if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ | ||
315 | Tlen = c.slen - (c.p - c.q) - 2; \ | ||
316 | if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \ | ||
317 | (void (*)())free_func, \ | ||
318 | b,V_ASN1_UNIVERSAL) == NULL) \ | ||
319 | { c.line=__LINE__; goto err; } \ | ||
320 | if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ | ||
321 | Tlen = c.slen - (c.p - c.q); \ | ||
322 | if(!ASN1_check_infinite_end(&c.p, Tlen)) \ | ||
323 | { c.error=ERR_R_MISSING_ASN1_EOS; \ | ||
324 | c.line=__LINE__; goto err; } \ | ||
325 | }\ | ||
326 | c.slen-=(c.p-c.q); \ | ||
327 | } | ||
328 | |||
329 | #define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ | 264 | #define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ |
330 | if ((c.slen != 0) && (M_ASN1_next == \ | 265 | if ((c.slen != 0) && (M_ASN1_next == \ |
331 | (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ | 266 | (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ |
@@ -384,17 +319,10 @@ err:\ | |||
384 | #define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) | 319 | #define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) |
385 | #define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) | 320 | #define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) |
386 | 321 | ||
387 | #define M_ASN1_I2D_len_SET(a,f) \ | ||
388 | ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); | ||
389 | |||
390 | #define M_ASN1_I2D_len_SET_type(type,a,f) \ | 322 | #define M_ASN1_I2D_len_SET_type(type,a,f) \ |
391 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ | 323 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ |
392 | V_ASN1_UNIVERSAL,IS_SET); | 324 | V_ASN1_UNIVERSAL,IS_SET); |
393 | 325 | ||
394 | #define M_ASN1_I2D_len_SEQUENCE(a,f) \ | ||
395 | ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ | ||
396 | IS_SEQUENCE); | ||
397 | |||
398 | #define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ | 326 | #define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ |
399 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ | 327 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ |
400 | V_ASN1_UNIVERSAL,IS_SEQUENCE) | 328 | V_ASN1_UNIVERSAL,IS_SEQUENCE) |
@@ -407,32 +335,15 @@ err:\ | |||
407 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 335 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
408 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); | 336 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); |
409 | 337 | ||
410 | #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ | ||
411 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); | ||
412 | |||
413 | #define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ | 338 | #define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ |
414 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ | 339 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ |
415 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); | 340 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); |
416 | 341 | ||
417 | #define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \ | ||
418 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
419 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
420 | IS_SET); | ||
421 | |||
422 | #define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ | 342 | #define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ |
423 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 343 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
424 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ | 344 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ |
425 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); | 345 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); |
426 | 346 | ||
427 | #define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \ | ||
428 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
429 | IS_SEQUENCE); | ||
430 | |||
431 | #define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \ | ||
432 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
433 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
434 | IS_SEQUENCE); | ||
435 | |||
436 | #define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ | 347 | #define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ |
437 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 348 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
438 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ | 349 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ |
@@ -446,21 +357,6 @@ err:\ | |||
446 | ret+=ASN1_object_size(1,v,mtag); \ | 357 | ret+=ASN1_object_size(1,v,mtag); \ |
447 | } | 358 | } |
448 | 359 | ||
449 | #define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \ | ||
450 | if ((a != NULL) && (sk_num(a) != 0))\ | ||
451 | { \ | ||
452 | v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ | ||
453 | ret+=ASN1_object_size(1,v,mtag); \ | ||
454 | } | ||
455 | |||
456 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ | ||
457 | if ((a != NULL) && (sk_num(a) != 0))\ | ||
458 | { \ | ||
459 | v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \ | ||
460 | IS_SEQUENCE); \ | ||
461 | ret+=ASN1_object_size(1,v,mtag); \ | ||
462 | } | ||
463 | |||
464 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ | 360 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ |
465 | if ((a != NULL) && (sk_##type##_num(a) != 0))\ | 361 | if ((a != NULL) && (sk_##type##_num(a) != 0))\ |
466 | { \ | 362 | { \ |
@@ -481,19 +377,10 @@ err:\ | |||
481 | *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ | 377 | *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ |
482 | } | 378 | } |
483 | 379 | ||
484 | #define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\ | ||
485 | V_ASN1_UNIVERSAL,IS_SET) | ||
486 | #define M_ASN1_I2D_put_SET_type(type,a,f) \ | 380 | #define M_ASN1_I2D_put_SET_type(type,a,f) \ |
487 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) | 381 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) |
488 | #define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ | ||
489 | V_ASN1_CONTEXT_SPECIFIC,IS_SET) | ||
490 | #define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ | 382 | #define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ |
491 | i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) | 383 | i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) |
492 | #define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ | ||
493 | V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE) | ||
494 | |||
495 | #define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\ | ||
496 | V_ASN1_UNIVERSAL,IS_SEQUENCE) | ||
497 | 384 | ||
498 | #define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ | 385 | #define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ |
499 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ | 386 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ |
@@ -503,22 +390,12 @@ err:\ | |||
503 | if ((a != NULL) && (sk_num(a) != 0)) \ | 390 | if ((a != NULL) && (sk_num(a) != 0)) \ |
504 | M_ASN1_I2D_put_SEQUENCE(a,f); | 391 | M_ASN1_I2D_put_SEQUENCE(a,f); |
505 | 392 | ||
506 | #define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \ | ||
507 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
508 | { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
509 | IS_SET); } | ||
510 | |||
511 | #define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ | 393 | #define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ |
512 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 394 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
513 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ | 395 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ |
514 | V_ASN1_CONTEXT_SPECIFIC, \ | 396 | V_ASN1_CONTEXT_SPECIFIC, \ |
515 | IS_SET); } | 397 | IS_SET); } |
516 | 398 | ||
517 | #define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \ | ||
518 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
519 | { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
520 | IS_SEQUENCE); } | ||
521 | |||
522 | #define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ | 399 | #define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ |
523 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 400 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
524 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ | 401 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ |
@@ -532,20 +409,6 @@ err:\ | |||
532 | f(a,&p); \ | 409 | f(a,&p); \ |
533 | } | 410 | } |
534 | 411 | ||
535 | #define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \ | ||
536 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
537 | { \ | ||
538 | ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
539 | i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ | ||
540 | } | ||
541 | |||
542 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ | ||
543 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
544 | { \ | ||
545 | ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
546 | i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \ | ||
547 | } | ||
548 | |||
549 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ | 412 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ |
550 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 413 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
551 | { \ | 414 | { \ |
diff --git a/src/lib/libcrypto/asn1/asn_pack.c b/src/lib/libcrypto/asn1/asn_pack.c index ad738217d7..1886508654 100644 --- a/src/lib/libcrypto/asn1/asn_pack.c +++ b/src/lib/libcrypto/asn1/asn_pack.c | |||
@@ -60,93 +60,6 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | #ifndef NO_ASN1_OLD | ||
64 | |||
65 | /* ASN1 packing and unpacking functions */ | ||
66 | |||
67 | /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ | ||
68 | |||
69 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | ||
70 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)) | ||
71 | { | ||
72 | STACK_OF(OPENSSL_BLOCK) *sk; | ||
73 | const unsigned char *pbuf; | ||
74 | pbuf = buf; | ||
75 | if (!(sk = d2i_ASN1_SET(NULL, &pbuf, len, d2i, free_func, | ||
76 | V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL))) | ||
77 | ASN1err(ASN1_F_ASN1_SEQ_UNPACK,ASN1_R_DECODE_ERROR); | ||
78 | return sk; | ||
79 | } | ||
80 | |||
81 | /* Turn a STACK structures into an ASN1 encoded SEQUENCE OF structure in a | ||
82 | * OPENSSL_malloc'ed buffer | ||
83 | */ | ||
84 | |||
85 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | ||
86 | unsigned char **buf, int *len) | ||
87 | { | ||
88 | int safelen; | ||
89 | unsigned char *safe, *p; | ||
90 | if (!(safelen = i2d_ASN1_SET(safes, NULL, i2d, V_ASN1_SEQUENCE, | ||
91 | V_ASN1_UNIVERSAL, IS_SEQUENCE))) { | ||
92 | ASN1err(ASN1_F_ASN1_SEQ_PACK,ASN1_R_ENCODE_ERROR); | ||
93 | return NULL; | ||
94 | } | ||
95 | if (!(safe = OPENSSL_malloc (safelen))) { | ||
96 | ASN1err(ASN1_F_ASN1_SEQ_PACK,ERR_R_MALLOC_FAILURE); | ||
97 | return NULL; | ||
98 | } | ||
99 | p = safe; | ||
100 | i2d_ASN1_SET(safes, &p, i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, | ||
101 | IS_SEQUENCE); | ||
102 | if (len) *len = safelen; | ||
103 | if (buf) *buf = safe; | ||
104 | return safe; | ||
105 | } | ||
106 | |||
107 | /* Extract an ASN1 object from an ASN1_STRING */ | ||
108 | |||
109 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i) | ||
110 | { | ||
111 | const unsigned char *p; | ||
112 | char *ret; | ||
113 | |||
114 | p = oct->data; | ||
115 | if(!(ret = d2i(NULL, &p, oct->length))) | ||
116 | ASN1err(ASN1_F_ASN1_UNPACK_STRING,ASN1_R_DECODE_ERROR); | ||
117 | return ret; | ||
118 | } | ||
119 | |||
120 | /* Pack an ASN1 object into an ASN1_STRING */ | ||
121 | |||
122 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, ASN1_STRING **oct) | ||
123 | { | ||
124 | unsigned char *p; | ||
125 | ASN1_STRING *octmp; | ||
126 | |||
127 | if (!oct || !*oct) { | ||
128 | if (!(octmp = ASN1_STRING_new ())) { | ||
129 | ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); | ||
130 | return NULL; | ||
131 | } | ||
132 | if (oct) *oct = octmp; | ||
133 | } else octmp = *oct; | ||
134 | |||
135 | if (!(octmp->length = i2d(obj, NULL))) { | ||
136 | ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); | ||
137 | return NULL; | ||
138 | } | ||
139 | if (!(p = OPENSSL_malloc (octmp->length))) { | ||
140 | ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); | ||
141 | return NULL; | ||
142 | } | ||
143 | octmp->data = p; | ||
144 | i2d (obj, &p); | ||
145 | return octmp; | ||
146 | } | ||
147 | |||
148 | #endif | ||
149 | |||
150 | /* ASN1_ITEM versions of the above */ | 63 | /* ASN1_ITEM versions of the above */ |
151 | 64 | ||
152 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) | 65 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) |
diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index dacca0dc21..8139cade49 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.10 2014/04/15 20:13:07 miod Exp $ | 1 | # $OpenBSD: Makefile,v 1.11 2014/04/15 20:19:55 miod Exp $ |
2 | 2 | ||
3 | LIB= crypto | 3 | LIB= crypto |
4 | 4 | ||
@@ -51,7 +51,7 @@ SRCS+= aes_ctr.c aes_ige.c aes_wrap.c | |||
51 | 51 | ||
52 | # asn1/ | 52 | # asn1/ |
53 | SRCS+= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c | 53 | SRCS+= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c |
54 | SRCS+= a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c | 54 | SRCS+= a_print.c a_type.c a_dup.c a_d2i_fp.c a_i2d_fp.c |
55 | SRCS+= a_enum.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c | 55 | SRCS+= a_enum.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c |
56 | SRCS+= x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c x_bignum.c | 56 | SRCS+= x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c x_bignum.c |
57 | SRCS+= x_long.c x_name.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c | 57 | SRCS+= x_long.c x_name.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c |
diff --git a/src/lib/libcrypto/stack/safestack.h b/src/lib/libcrypto/stack/safestack.h index ea3aa0d800..56978a2b01 100644 --- a/src/lib/libcrypto/stack/safestack.h +++ b/src/lib/libcrypto/stack/safestack.h | |||
@@ -178,26 +178,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
178 | #define SKM_sk_is_sorted(type, st) \ | 178 | #define SKM_sk_is_sorted(type, st) \ |
179 | sk_is_sorted(CHECKED_STACK_OF(type, st)) | 179 | sk_is_sorted(CHECKED_STACK_OF(type, st)) |
180 | 180 | ||
181 | #define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | ||
182 | (STACK_OF(type) *)d2i_ASN1_SET( \ | ||
183 | (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \ | ||
184 | pp, length, \ | ||
185 | CHECKED_D2I_OF(type, d2i_func), \ | ||
186 | CHECKED_SK_FREE_FUNC(type, free_func), \ | ||
187 | ex_tag, ex_class) | ||
188 | |||
189 | #define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ | ||
190 | i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \ | ||
191 | CHECKED_I2D_OF(type, i2d_func), \ | ||
192 | ex_tag, ex_class, is_set) | ||
193 | |||
194 | #define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ | ||
195 | ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \ | ||
196 | CHECKED_I2D_OF(type, i2d_func), buf, len) | ||
197 | |||
198 | #define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ | ||
199 | (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func)) | ||
200 | |||
201 | #define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ | 181 | #define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ |
202 | (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ | 182 | (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ |
203 | CHECKED_D2I_OF(type, d2i_func), \ | 183 | CHECKED_D2I_OF(type, d2i_func), \ |
@@ -2198,226 +2178,126 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
2198 | SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2178 | SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2199 | #define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2179 | #define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2200 | SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2180 | SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2201 | #define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \ | ||
2202 | SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len)) | ||
2203 | #define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \ | ||
2204 | SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func)) | ||
2205 | 2181 | ||
2206 | #define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2182 | #define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2207 | SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2183 | SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2208 | #define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2184 | #define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2209 | SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2185 | SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2210 | #define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \ | ||
2211 | SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len)) | ||
2212 | #define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \ | ||
2213 | SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func)) | ||
2214 | 2186 | ||
2215 | #define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2187 | #define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2216 | SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2188 | SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2217 | #define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2189 | #define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2218 | SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2190 | SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2219 | #define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \ | ||
2220 | SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len)) | ||
2221 | #define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \ | ||
2222 | SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func)) | ||
2223 | 2191 | ||
2224 | #define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2192 | #define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2225 | SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2193 | SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2226 | #define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2194 | #define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2227 | SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2195 | SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2228 | #define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \ | ||
2229 | SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len)) | ||
2230 | #define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \ | ||
2231 | SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func)) | ||
2232 | 2196 | ||
2233 | #define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2197 | #define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2234 | SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2198 | SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2235 | #define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2199 | #define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2236 | SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2200 | SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2237 | #define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \ | ||
2238 | SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len)) | ||
2239 | #define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \ | ||
2240 | SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func)) | ||
2241 | 2201 | ||
2242 | #define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2202 | #define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2243 | SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2203 | SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2244 | #define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2204 | #define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2245 | SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2205 | SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2246 | #define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \ | ||
2247 | SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len)) | ||
2248 | #define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \ | ||
2249 | SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func)) | ||
2250 | 2206 | ||
2251 | #define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2207 | #define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2252 | SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2208 | SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2253 | #define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2209 | #define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2254 | SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2210 | SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2255 | #define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \ | ||
2256 | SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len)) | ||
2257 | #define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \ | ||
2258 | SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func)) | ||
2259 | 2211 | ||
2260 | #define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2212 | #define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2261 | SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2213 | SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2262 | #define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2214 | #define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2263 | SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2215 | SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2264 | #define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \ | ||
2265 | SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len)) | ||
2266 | #define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \ | ||
2267 | SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func)) | ||
2268 | 2216 | ||
2269 | #define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2217 | #define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2270 | SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2218 | SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2271 | #define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2219 | #define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2272 | SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2220 | SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2273 | #define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \ | ||
2274 | SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len)) | ||
2275 | #define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \ | ||
2276 | SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func)) | ||
2277 | 2221 | ||
2278 | #define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2222 | #define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2279 | SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2223 | SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2280 | #define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2224 | #define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2281 | SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2225 | SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2282 | #define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \ | ||
2283 | SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len)) | ||
2284 | #define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \ | ||
2285 | SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func)) | ||
2286 | 2226 | ||
2287 | #define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2227 | #define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2288 | SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2228 | SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2289 | #define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2229 | #define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2290 | SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2230 | SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2291 | #define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \ | ||
2292 | SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len)) | ||
2293 | #define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \ | ||
2294 | SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func)) | ||
2295 | 2231 | ||
2296 | #define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2232 | #define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2297 | SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2233 | SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2298 | #define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2234 | #define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2299 | SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2235 | SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2300 | #define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \ | ||
2301 | SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len)) | ||
2302 | #define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \ | ||
2303 | SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func)) | ||
2304 | 2236 | ||
2305 | #define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2237 | #define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2306 | SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2238 | SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2307 | #define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2239 | #define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2308 | SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2240 | SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2309 | #define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \ | ||
2310 | SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len)) | ||
2311 | #define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \ | ||
2312 | SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func)) | ||
2313 | 2241 | ||
2314 | #define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2242 | #define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2315 | SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2243 | SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2316 | #define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2244 | #define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2317 | SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2245 | SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2318 | #define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \ | ||
2319 | SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len)) | ||
2320 | #define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \ | ||
2321 | SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func)) | ||
2322 | 2246 | ||
2323 | #define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2247 | #define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2324 | SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2248 | SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2325 | #define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2249 | #define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2326 | SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2250 | SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2327 | #define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \ | ||
2328 | SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len)) | ||
2329 | #define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \ | ||
2330 | SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func)) | ||
2331 | 2251 | ||
2332 | #define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2252 | #define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2333 | SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2253 | SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2334 | #define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2254 | #define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2335 | SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2255 | SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2336 | #define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \ | ||
2337 | SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len)) | ||
2338 | #define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \ | ||
2339 | SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func)) | ||
2340 | 2256 | ||
2341 | #define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2257 | #define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2342 | SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2258 | SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2343 | #define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2259 | #define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2344 | SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2260 | SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2345 | #define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \ | ||
2346 | SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len)) | ||
2347 | #define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \ | ||
2348 | SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func)) | ||
2349 | 2261 | ||
2350 | #define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2262 | #define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2351 | SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2263 | SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2352 | #define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2264 | #define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2353 | SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2265 | SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2354 | #define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \ | ||
2355 | SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len)) | ||
2356 | #define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \ | ||
2357 | SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func)) | ||
2358 | 2266 | ||
2359 | #define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2267 | #define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2360 | SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2268 | SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2361 | #define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2269 | #define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2362 | SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2270 | SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2363 | #define ASN1_seq_pack_X509(st, i2d_func, buf, len) \ | ||
2364 | SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len)) | ||
2365 | #define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \ | ||
2366 | SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func)) | ||
2367 | 2271 | ||
2368 | #define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2272 | #define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2369 | SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2273 | SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2370 | #define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2274 | #define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2371 | SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2275 | SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2372 | #define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \ | ||
2373 | SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len)) | ||
2374 | #define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \ | ||
2375 | SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func)) | ||
2376 | 2276 | ||
2377 | #define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2277 | #define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2378 | SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2278 | SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2379 | #define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2279 | #define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2380 | SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2280 | SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2381 | #define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \ | ||
2382 | SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len)) | ||
2383 | #define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \ | ||
2384 | SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func)) | ||
2385 | 2281 | ||
2386 | #define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2282 | #define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2387 | SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2283 | SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2388 | #define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2284 | #define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2389 | SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2285 | SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2390 | #define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \ | ||
2391 | SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len)) | ||
2392 | #define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \ | ||
2393 | SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func)) | ||
2394 | 2286 | ||
2395 | #define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2287 | #define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2396 | SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2288 | SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2397 | #define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2289 | #define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2398 | SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2290 | SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2399 | #define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \ | ||
2400 | SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len)) | ||
2401 | #define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \ | ||
2402 | SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func)) | ||
2403 | 2291 | ||
2404 | #define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2292 | #define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2405 | SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2293 | SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2406 | #define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2294 | #define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2407 | SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2295 | SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2408 | #define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \ | ||
2409 | SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len)) | ||
2410 | #define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \ | ||
2411 | SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func)) | ||
2412 | 2296 | ||
2413 | #define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2297 | #define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2414 | SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2298 | SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2415 | #define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2299 | #define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2416 | SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2300 | SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2417 | #define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \ | ||
2418 | SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len)) | ||
2419 | #define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \ | ||
2420 | SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func)) | ||
2421 | 2301 | ||
2422 | #define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ | 2302 | #define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ |
2423 | SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) | 2303 | SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) |
diff --git a/src/lib/libcrypto/util/mkstack.pl b/src/lib/libcrypto/util/mkstack.pl index f708610a78..77b0ec4943 100644 --- a/src/lib/libcrypto/util/mkstack.pl +++ b/src/lib/libcrypto/util/mkstack.pl | |||
@@ -129,19 +129,6 @@ EOF | |||
129 | EOF | 129 | EOF |
130 | } | 130 | } |
131 | 131 | ||
132 | foreach $type_thing (sort @asn1setlst) { | ||
133 | $new_stackfile .= <<EOF; | ||
134 | |||
135 | #define d2i_ASN1_SET_OF_${type_thing}(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\ | ||
136 | SKM_ASN1_SET_OF_d2i($type_thing, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | ||
137 | #define i2d_ASN1_SET_OF_${type_thing}(st, pp, i2d_func, ex_tag, ex_class, is_set) \\ | ||
138 | SKM_ASN1_SET_OF_i2d($type_thing, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | ||
139 | #define ASN1_seq_pack_${type_thing}(st, i2d_func, buf, len) \\ | ||
140 | SKM_ASN1_seq_pack($type_thing, (st), (i2d_func), (buf), (len)) | ||
141 | #define ASN1_seq_unpack_${type_thing}(buf, len, d2i_func, free_func) \\ | ||
142 | SKM_ASN1_seq_unpack($type_thing, (buf), (len), (d2i_func), (free_func)) | ||
143 | EOF | ||
144 | } | ||
145 | foreach $type_thing (sort @p12stklst) { | 132 | foreach $type_thing (sort @p12stklst) { |
146 | $new_stackfile .= <<EOF; | 133 | $new_stackfile .= <<EOF; |
147 | 134 | ||
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 121847b244..27befbbbb0 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
@@ -697,7 +697,6 @@ int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); | |||
697 | #ifndef OPENSSL_NO_DSA | 697 | #ifndef OPENSSL_NO_DSA |
698 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); | 698 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); |
699 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); | 699 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); |
700 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); | ||
701 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | 700 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); |
702 | #endif | 701 | #endif |
703 | #ifndef OPENSSL_NO_EC | 702 | #ifndef OPENSSL_NO_EC |
@@ -881,16 +880,6 @@ X509_INFO * X509_INFO_new(void); | |||
881 | void X509_INFO_free(X509_INFO *a); | 880 | void X509_INFO_free(X509_INFO *a); |
882 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | 881 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); |
883 | 882 | ||
884 | int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, | ||
885 | ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); | ||
886 | |||
887 | int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data, | ||
888 | unsigned char *md,unsigned int *len); | ||
889 | |||
890 | int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, | ||
891 | X509_ALGOR *algor2, ASN1_BIT_STRING *signature, | ||
892 | char *data,EVP_PKEY *pkey, const EVP_MD *type); | ||
893 | |||
894 | int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, | 883 | int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, |
895 | unsigned char *md,unsigned int *len); | 884 | unsigned char *md,unsigned int *len); |
896 | 885 | ||
diff --git a/src/lib/libssl/src/crypto/asn1/a_digest.c b/src/lib/libssl/src/crypto/asn1/a_digest.c index cbdeea6ac0..8a4b24a06b 100644 --- a/src/lib/libssl/src/crypto/asn1/a_digest.c +++ b/src/lib/libssl/src/crypto/asn1/a_digest.c | |||
@@ -70,32 +70,6 @@ | |||
70 | #include <openssl/buffer.h> | 70 | #include <openssl/buffer.h> |
71 | #include <openssl/x509.h> | 71 | #include <openssl/x509.h> |
72 | 72 | ||
73 | #ifndef NO_ASN1_OLD | ||
74 | |||
75 | int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, | ||
76 | unsigned char *md, unsigned int *len) | ||
77 | { | ||
78 | int i; | ||
79 | unsigned char *str,*p; | ||
80 | |||
81 | i=i2d(data,NULL); | ||
82 | if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) | ||
83 | { | ||
84 | ASN1err(ASN1_F_ASN1_DIGEST,ERR_R_MALLOC_FAILURE); | ||
85 | return(0); | ||
86 | } | ||
87 | p=str; | ||
88 | i2d(data,&p); | ||
89 | |||
90 | if (!EVP_Digest(str, i, md, len, type, NULL)) | ||
91 | return 0; | ||
92 | OPENSSL_free(str); | ||
93 | return(1); | ||
94 | } | ||
95 | |||
96 | #endif | ||
97 | |||
98 | |||
99 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | 73 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, |
100 | unsigned char *md, unsigned int *len) | 74 | unsigned char *md, unsigned int *len) |
101 | { | 75 | { |
@@ -110,4 +84,3 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | |||
110 | OPENSSL_free(str); | 84 | OPENSSL_free(str); |
111 | return(1); | 85 | return(1); |
112 | } | 86 | } |
113 | |||
diff --git a/src/lib/libssl/src/crypto/asn1/a_set.c b/src/lib/libssl/src/crypto/asn1/a_set.c deleted file mode 100644 index d726c8d3a8..0000000000 --- a/src/lib/libssl/src/crypto/asn1/a_set.c +++ /dev/null | |||
@@ -1,241 +0,0 @@ | |||
1 | /* crypto/asn1/a_set.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
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 | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
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. | ||
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. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
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: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
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 | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
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 | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/asn1_mac.h> | ||
62 | |||
63 | #ifndef NO_ASN1_OLD | ||
64 | |||
65 | typedef struct | ||
66 | { | ||
67 | unsigned char *pbData; | ||
68 | int cbData; | ||
69 | } MYBLOB; | ||
70 | |||
71 | /* SetBlobCmp | ||
72 | * This function compares two elements of SET_OF block | ||
73 | */ | ||
74 | static int SetBlobCmp(const void *elem1, const void *elem2 ) | ||
75 | { | ||
76 | const MYBLOB *b1 = (const MYBLOB *)elem1; | ||
77 | const MYBLOB *b2 = (const MYBLOB *)elem2; | ||
78 | int r; | ||
79 | |||
80 | r = memcmp(b1->pbData, b2->pbData, | ||
81 | b1->cbData < b2->cbData ? b1->cbData : b2->cbData); | ||
82 | if(r != 0) | ||
83 | return r; | ||
84 | return b1->cbData-b2->cbData; | ||
85 | } | ||
86 | |||
87 | /* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ | ||
88 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, | ||
89 | i2d_of_void *i2d, int ex_tag, int ex_class, | ||
90 | int is_set) | ||
91 | { | ||
92 | int ret=0,r; | ||
93 | int i; | ||
94 | unsigned char *p; | ||
95 | unsigned char *pStart, *pTempMem; | ||
96 | MYBLOB *rgSetBlob; | ||
97 | int totSize; | ||
98 | |||
99 | if (a == NULL) return(0); | ||
100 | for (i=sk_OPENSSL_BLOCK_num(a)-1; i>=0; i--) | ||
101 | ret+=i2d(sk_OPENSSL_BLOCK_value(a,i),NULL); | ||
102 | r=ASN1_object_size(1,ret,ex_tag); | ||
103 | if (pp == NULL) return(r); | ||
104 | |||
105 | p= *pp; | ||
106 | ASN1_put_object(&p,1,ret,ex_tag,ex_class); | ||
107 | |||
108 | /* Modified by gp@nsj.co.jp */ | ||
109 | /* And then again by Ben */ | ||
110 | /* And again by Steve */ | ||
111 | |||
112 | if(!is_set || (sk_OPENSSL_BLOCK_num(a) < 2)) | ||
113 | { | ||
114 | for (i=0; i<sk_OPENSSL_BLOCK_num(a); i++) | ||
115 | i2d(sk_OPENSSL_BLOCK_value(a,i),&p); | ||
116 | |||
117 | *pp=p; | ||
118 | return(r); | ||
119 | } | ||
120 | |||
121 | pStart = p; /* Catch the beg of Setblobs*/ | ||
122 | /* In this array we will store the SET blobs */ | ||
123 | rgSetBlob = OPENSSL_malloc(sk_OPENSSL_BLOCK_num(a) * sizeof(MYBLOB)); | ||
124 | if (rgSetBlob == NULL) | ||
125 | { | ||
126 | ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE); | ||
127 | return(0); | ||
128 | } | ||
129 | |||
130 | for (i=0; i<sk_OPENSSL_BLOCK_num(a); i++) | ||
131 | { | ||
132 | rgSetBlob[i].pbData = p; /* catch each set encode blob */ | ||
133 | i2d(sk_OPENSSL_BLOCK_value(a,i),&p); | ||
134 | rgSetBlob[i].cbData = p - rgSetBlob[i].pbData; /* Length of this | ||
135 | SetBlob | ||
136 | */ | ||
137 | } | ||
138 | *pp=p; | ||
139 | totSize = p - pStart; /* This is the total size of all set blobs */ | ||
140 | |||
141 | /* Now we have to sort the blobs. I am using a simple algo. | ||
142 | *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/ | ||
143 | qsort( rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp); | ||
144 | if (!(pTempMem = OPENSSL_malloc(totSize))) | ||
145 | { | ||
146 | ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE); | ||
147 | return(0); | ||
148 | } | ||
149 | |||
150 | /* Copy to temp mem */ | ||
151 | p = pTempMem; | ||
152 | for(i=0; i<sk_OPENSSL_BLOCK_num(a); ++i) | ||
153 | { | ||
154 | memcpy(p, rgSetBlob[i].pbData, rgSetBlob[i].cbData); | ||
155 | p += rgSetBlob[i].cbData; | ||
156 | } | ||
157 | |||
158 | /* Copy back to user mem*/ | ||
159 | memcpy(pStart, pTempMem, totSize); | ||
160 | OPENSSL_free(pTempMem); | ||
161 | OPENSSL_free(rgSetBlob); | ||
162 | |||
163 | return(r); | ||
164 | } | ||
165 | |||
166 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, | ||
167 | const unsigned char **pp, | ||
168 | long length, d2i_of_void *d2i, | ||
169 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, | ||
170 | int ex_class) | ||
171 | { | ||
172 | ASN1_const_CTX c; | ||
173 | STACK_OF(OPENSSL_BLOCK) *ret=NULL; | ||
174 | |||
175 | if ((a == NULL) || ((*a) == NULL)) | ||
176 | { | ||
177 | if ((ret=sk_OPENSSL_BLOCK_new_null()) == NULL) | ||
178 | { | ||
179 | ASN1err(ASN1_F_D2I_ASN1_SET,ERR_R_MALLOC_FAILURE); | ||
180 | goto err; | ||
181 | } | ||
182 | } | ||
183 | else | ||
184 | ret=(*a); | ||
185 | |||
186 | c.p= *pp; | ||
187 | c.max=(length == 0)?0:(c.p+length); | ||
188 | |||
189 | c.inf=ASN1_get_object(&c.p,&c.slen,&c.tag,&c.xclass,c.max-c.p); | ||
190 | if (c.inf & 0x80) goto err; | ||
191 | if (ex_class != c.xclass) | ||
192 | { | ||
193 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_BAD_CLASS); | ||
194 | goto err; | ||
195 | } | ||
196 | if (ex_tag != c.tag) | ||
197 | { | ||
198 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_BAD_TAG); | ||
199 | goto err; | ||
200 | } | ||
201 | if ((c.slen+c.p) > c.max) | ||
202 | { | ||
203 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_LENGTH_ERROR); | ||
204 | goto err; | ||
205 | } | ||
206 | /* check for infinite constructed - it can be as long | ||
207 | * as the amount of data passed to us */ | ||
208 | if (c.inf == (V_ASN1_CONSTRUCTED+1)) | ||
209 | c.slen=length+ *pp-c.p; | ||
210 | c.max=c.p+c.slen; | ||
211 | |||
212 | while (c.p < c.max) | ||
213 | { | ||
214 | char *s; | ||
215 | |||
216 | if (M_ASN1_D2I_end_sequence()) break; | ||
217 | /* XXX: This was called with 4 arguments, incorrectly, it seems | ||
218 | if ((s=func(NULL,&c.p,c.slen,c.max-c.p)) == NULL) */ | ||
219 | if ((s=d2i(NULL,&c.p,c.slen)) == NULL) | ||
220 | { | ||
221 | ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_ERROR_PARSING_SET_ELEMENT); | ||
222 | asn1_add_error(*pp,(int)(c.p- *pp)); | ||
223 | goto err; | ||
224 | } | ||
225 | if (!sk_OPENSSL_BLOCK_push(ret,s)) goto err; | ||
226 | } | ||
227 | if (a != NULL) (*a)=ret; | ||
228 | *pp=c.p; | ||
229 | return(ret); | ||
230 | err: | ||
231 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) | ||
232 | { | ||
233 | if (free_func != NULL) | ||
234 | sk_OPENSSL_BLOCK_pop_free(ret,free_func); | ||
235 | else | ||
236 | sk_OPENSSL_BLOCK_free(ret); | ||
237 | } | ||
238 | return(NULL); | ||
239 | } | ||
240 | |||
241 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/asn1/a_sign.c b/src/lib/libssl/src/crypto/asn1/a_sign.c index 7b4a193d6b..01b6292b65 100644 --- a/src/lib/libssl/src/crypto/asn1/a_sign.c +++ b/src/lib/libssl/src/crypto/asn1/a_sign.c | |||
@@ -125,94 +125,6 @@ | |||
125 | #include <openssl/buffer.h> | 125 | #include <openssl/buffer.h> |
126 | #include "asn1_locl.h" | 126 | #include "asn1_locl.h" |
127 | 127 | ||
128 | #ifndef NO_ASN1_OLD | ||
129 | |||
130 | int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, | ||
131 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, | ||
132 | const EVP_MD *type) | ||
133 | { | ||
134 | EVP_MD_CTX ctx; | ||
135 | unsigned char *p,*buf_in=NULL,*buf_out=NULL; | ||
136 | int i,inl=0,outl=0,outll=0; | ||
137 | X509_ALGOR *a; | ||
138 | |||
139 | EVP_MD_CTX_init(&ctx); | ||
140 | for (i=0; i<2; i++) | ||
141 | { | ||
142 | if (i == 0) | ||
143 | a=algor1; | ||
144 | else | ||
145 | a=algor2; | ||
146 | if (a == NULL) continue; | ||
147 | if (type->pkey_type == NID_dsaWithSHA1) | ||
148 | { | ||
149 | /* special case: RFC 2459 tells us to omit 'parameters' | ||
150 | * with id-dsa-with-sha1 */ | ||
151 | ASN1_TYPE_free(a->parameter); | ||
152 | a->parameter = NULL; | ||
153 | } | ||
154 | else if ((a->parameter == NULL) || | ||
155 | (a->parameter->type != V_ASN1_NULL)) | ||
156 | { | ||
157 | ASN1_TYPE_free(a->parameter); | ||
158 | if ((a->parameter=ASN1_TYPE_new()) == NULL) goto err; | ||
159 | a->parameter->type=V_ASN1_NULL; | ||
160 | } | ||
161 | ASN1_OBJECT_free(a->algorithm); | ||
162 | a->algorithm=OBJ_nid2obj(type->pkey_type); | ||
163 | if (a->algorithm == NULL) | ||
164 | { | ||
165 | ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_UNKNOWN_OBJECT_TYPE); | ||
166 | goto err; | ||
167 | } | ||
168 | if (a->algorithm->length == 0) | ||
169 | { | ||
170 | ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD); | ||
171 | goto err; | ||
172 | } | ||
173 | } | ||
174 | inl=i2d(data,NULL); | ||
175 | buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl); | ||
176 | outll=outl=EVP_PKEY_size(pkey); | ||
177 | buf_out=(unsigned char *)OPENSSL_malloc((unsigned int)outl); | ||
178 | if ((buf_in == NULL) || (buf_out == NULL)) | ||
179 | { | ||
180 | outl=0; | ||
181 | ASN1err(ASN1_F_ASN1_SIGN,ERR_R_MALLOC_FAILURE); | ||
182 | goto err; | ||
183 | } | ||
184 | p=buf_in; | ||
185 | |||
186 | i2d(data,&p); | ||
187 | if (!EVP_SignInit_ex(&ctx,type, NULL) | ||
188 | || !EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl) | ||
189 | || !EVP_SignFinal(&ctx,(unsigned char *)buf_out, | ||
190 | (unsigned int *)&outl,pkey)) | ||
191 | { | ||
192 | outl=0; | ||
193 | ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB); | ||
194 | goto err; | ||
195 | } | ||
196 | if (signature->data != NULL) OPENSSL_free(signature->data); | ||
197 | signature->data=buf_out; | ||
198 | buf_out=NULL; | ||
199 | signature->length=outl; | ||
200 | /* In the interests of compatibility, I'll make sure that | ||
201 | * the bit string has a 'not-used bits' value of 0 | ||
202 | */ | ||
203 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); | ||
204 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; | ||
205 | err: | ||
206 | EVP_MD_CTX_cleanup(&ctx); | ||
207 | if (buf_in != NULL) | ||
208 | { OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); } | ||
209 | if (buf_out != NULL) | ||
210 | { OPENSSL_cleanse((char *)buf_out,outll); OPENSSL_free(buf_out); } | ||
211 | return(outl); | ||
212 | } | ||
213 | |||
214 | #endif | ||
215 | |||
216 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | 128 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, |
217 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey, | 129 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey, |
218 | const EVP_MD *type) | 130 | const EVP_MD *type) |
diff --git a/src/lib/libssl/src/crypto/asn1/a_verify.c b/src/lib/libssl/src/crypto/asn1/a_verify.c index fc84cd3d19..5eb47d768c 100644 --- a/src/lib/libssl/src/crypto/asn1/a_verify.c +++ b/src/lib/libssl/src/crypto/asn1/a_verify.c | |||
@@ -72,65 +72,6 @@ | |||
72 | #include <openssl/buffer.h> | 72 | #include <openssl/buffer.h> |
73 | #include <openssl/evp.h> | 73 | #include <openssl/evp.h> |
74 | 74 | ||
75 | #ifndef NO_ASN1_OLD | ||
76 | |||
77 | int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, | ||
78 | char *data, EVP_PKEY *pkey) | ||
79 | { | ||
80 | EVP_MD_CTX ctx; | ||
81 | const EVP_MD *type; | ||
82 | unsigned char *p,*buf_in=NULL; | ||
83 | int ret= -1,i,inl; | ||
84 | |||
85 | EVP_MD_CTX_init(&ctx); | ||
86 | i=OBJ_obj2nid(a->algorithm); | ||
87 | type=EVP_get_digestbyname(OBJ_nid2sn(i)); | ||
88 | if (type == NULL) | ||
89 | { | ||
90 | ASN1err(ASN1_F_ASN1_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); | ||
91 | goto err; | ||
92 | } | ||
93 | |||
94 | inl=i2d(data,NULL); | ||
95 | buf_in=OPENSSL_malloc((unsigned int)inl); | ||
96 | if (buf_in == NULL) | ||
97 | { | ||
98 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE); | ||
99 | goto err; | ||
100 | } | ||
101 | p=buf_in; | ||
102 | |||
103 | i2d(data,&p); | ||
104 | if (!EVP_VerifyInit_ex(&ctx,type, NULL) | ||
105 | || !EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl)) | ||
106 | { | ||
107 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); | ||
108 | ret=0; | ||
109 | goto err; | ||
110 | } | ||
111 | |||
112 | OPENSSL_cleanse(buf_in,(unsigned int)inl); | ||
113 | OPENSSL_free(buf_in); | ||
114 | |||
115 | if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, | ||
116 | (unsigned int)signature->length,pkey) <= 0) | ||
117 | { | ||
118 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); | ||
119 | ret=0; | ||
120 | goto err; | ||
121 | } | ||
122 | /* we don't need to zero the 'ctx' because we just checked | ||
123 | * public information */ | ||
124 | /* memset(&ctx,0,sizeof(ctx)); */ | ||
125 | ret=1; | ||
126 | err: | ||
127 | EVP_MD_CTX_cleanup(&ctx); | ||
128 | return(ret); | ||
129 | } | ||
130 | |||
131 | #endif | ||
132 | |||
133 | |||
134 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, | 75 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, |
135 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) | 76 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) |
136 | { | 77 | { |
diff --git a/src/lib/libssl/src/crypto/asn1/asn1.h b/src/lib/libssl/src/crypto/asn1/asn1.h index c48ce3cb92..c4fa8c649b 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1.h +++ b/src/lib/libssl/src/crypto/asn1/asn1.h | |||
@@ -765,10 +765,6 @@ typedef struct BIT_STRING_BITNAME_st { | |||
765 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ | 765 | (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ |
766 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) | 766 | ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) |
767 | 767 | ||
768 | /* for the is_set parameter to i2d_ASN1_SET */ | ||
769 | #define IS_SEQUENCE 0 | ||
770 | #define IS_SET 1 | ||
771 | |||
772 | DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) | 768 | DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) |
773 | 769 | ||
774 | int ASN1_TYPE_get(ASN1_TYPE *a); | 770 | int ASN1_TYPE_get(ASN1_TYPE *a); |
@@ -888,15 +884,6 @@ int ASN1_TIME_check(ASN1_TIME *t); | |||
888 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); | 884 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); |
889 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); | 885 | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); |
890 | 886 | ||
891 | int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, | ||
892 | i2d_of_void *i2d, int ex_tag, int ex_class, | ||
893 | int is_set); | ||
894 | STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, | ||
895 | const unsigned char **pp, | ||
896 | long length, d2i_of_void *d2i, | ||
897 | void (*free_func)(OPENSSL_BLOCK), int ex_tag, | ||
898 | int ex_class); | ||
899 | |||
900 | #ifndef OPENSSL_NO_BIO | 887 | #ifndef OPENSSL_NO_BIO |
901 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 888 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); |
902 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); | 889 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); |
@@ -1047,19 +1034,7 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, | |||
1047 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, | 1034 | int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, |
1048 | unsigned char *data, int max_len); | 1035 | unsigned char *data, int max_len); |
1049 | 1036 | ||
1050 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | ||
1051 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)); | ||
1052 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | ||
1053 | unsigned char **buf, int *len ); | ||
1054 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); | ||
1055 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | 1037 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); |
1056 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, | ||
1057 | ASN1_OCTET_STRING **oct); | ||
1058 | |||
1059 | #define ASN1_pack_string_of(type,obj,i2d,oct) \ | ||
1060 | (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \ | ||
1061 | CHECKED_I2D_OF(type, i2d), \ | ||
1062 | oct)) | ||
1063 | 1038 | ||
1064 | 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, ASN1_OCTET_STRING **oct); |
1065 | 1040 | ||
diff --git a/src/lib/libssl/src/crypto/asn1/asn1_mac.h b/src/lib/libssl/src/crypto/asn1/asn1_mac.h index 87bd0e9e1d..c60b197552 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1_mac.h +++ b/src/lib/libssl/src/crypto/asn1/asn1_mac.h | |||
@@ -176,19 +176,10 @@ err:\ | |||
176 | M_ASN1_D2I_get_imp(b,func, type);\ | 176 | M_ASN1_D2I_get_imp(b,func, type);\ |
177 | } | 177 | } |
178 | 178 | ||
179 | #define M_ASN1_D2I_get_set(r,func,free_func) \ | ||
180 | M_ASN1_D2I_get_imp_set(r,func,free_func, \ | ||
181 | V_ASN1_SET,V_ASN1_UNIVERSAL); | ||
182 | |||
183 | #define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ | 179 | #define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ |
184 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ | 180 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ |
185 | V_ASN1_SET,V_ASN1_UNIVERSAL); | 181 | V_ASN1_SET,V_ASN1_UNIVERSAL); |
186 | 182 | ||
187 | #define M_ASN1_D2I_get_set_opt(r,func,free_func) \ | ||
188 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | ||
189 | V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ | ||
190 | { M_ASN1_D2I_get_set(r,func,free_func); } | ||
191 | |||
192 | #define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ | 183 | #define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ |
193 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | 184 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ |
194 | V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ | 185 | V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ |
@@ -210,15 +201,6 @@ err:\ | |||
210 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 201 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
211 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); | 202 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); |
212 | 203 | ||
213 | #define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ | ||
214 | if ((c.slen != 0) && \ | ||
215 | (M_ASN1_next == \ | ||
216 | (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ | ||
217 | { \ | ||
218 | M_ASN1_D2I_get_imp_set(b,func,free_func,\ | ||
219 | tag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
220 | } | ||
221 | |||
222 | #define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ | 204 | #define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ |
223 | if ((c.slen != 0) && \ | 205 | if ((c.slen != 0) && \ |
224 | (M_ASN1_next == \ | 206 | (M_ASN1_next == \ |
@@ -228,39 +210,19 @@ err:\ | |||
228 | tag,V_ASN1_CONTEXT_SPECIFIC); \ | 210 | tag,V_ASN1_CONTEXT_SPECIFIC); \ |
229 | } | 211 | } |
230 | 212 | ||
231 | #define M_ASN1_D2I_get_seq(r,func,free_func) \ | ||
232 | M_ASN1_D2I_get_imp_set(r,func,free_func,\ | ||
233 | V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); | ||
234 | |||
235 | #define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ | 213 | #define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ |
236 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ | 214 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ |
237 | V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) | 215 | V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) |
238 | 216 | ||
239 | #define M_ASN1_D2I_get_seq_opt(r,func,free_func) \ | ||
240 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | ||
241 | V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ | ||
242 | { M_ASN1_D2I_get_seq(r,func,free_func); } | ||
243 | |||
244 | #define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ | 217 | #define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ |
245 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ | 218 | if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ |
246 | V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ | 219 | V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ |
247 | { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } | 220 | { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } |
248 | 221 | ||
249 | #define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \ | ||
250 | M_ASN1_D2I_get_imp_set(r,func,free_func,\ | ||
251 | x,V_ASN1_CONTEXT_SPECIFIC); | ||
252 | |||
253 | #define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ | 222 | #define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ |
254 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ | 223 | M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ |
255 | x,V_ASN1_CONTEXT_SPECIFIC); | 224 | x,V_ASN1_CONTEXT_SPECIFIC); |
256 | 225 | ||
257 | #define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \ | ||
258 | c.q=c.p; \ | ||
259 | if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\ | ||
260 | (void (*)())free_func,a,b) == NULL) \ | ||
261 | { c.line=__LINE__; goto err; } \ | ||
262 | c.slen-=(c.p-c.q); | ||
263 | |||
264 | #define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ | 226 | #define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ |
265 | c.q=c.p; \ | 227 | c.q=c.p; \ |
266 | if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ | 228 | if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ |
@@ -299,33 +261,6 @@ err:\ | |||
299 | c.slen-=(c.p-c.q); \ | 261 | c.slen-=(c.p-c.q); \ |
300 | } | 262 | } |
301 | 263 | ||
302 | #define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \ | ||
303 | if ((c.slen != 0) && (M_ASN1_next == \ | ||
304 | (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ | ||
305 | { \ | ||
306 | int Tinf,Ttag,Tclass; \ | ||
307 | long Tlen; \ | ||
308 | \ | ||
309 | c.q=c.p; \ | ||
310 | Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ | ||
311 | if (Tinf & 0x80) \ | ||
312 | { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ | ||
313 | c.line=__LINE__; goto err; } \ | ||
314 | if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ | ||
315 | Tlen = c.slen - (c.p - c.q) - 2; \ | ||
316 | if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \ | ||
317 | (void (*)())free_func, \ | ||
318 | b,V_ASN1_UNIVERSAL) == NULL) \ | ||
319 | { c.line=__LINE__; goto err; } \ | ||
320 | if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ | ||
321 | Tlen = c.slen - (c.p - c.q); \ | ||
322 | if(!ASN1_check_infinite_end(&c.p, Tlen)) \ | ||
323 | { c.error=ERR_R_MISSING_ASN1_EOS; \ | ||
324 | c.line=__LINE__; goto err; } \ | ||
325 | }\ | ||
326 | c.slen-=(c.p-c.q); \ | ||
327 | } | ||
328 | |||
329 | #define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ | 264 | #define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ |
330 | if ((c.slen != 0) && (M_ASN1_next == \ | 265 | if ((c.slen != 0) && (M_ASN1_next == \ |
331 | (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ | 266 | (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ |
@@ -384,17 +319,10 @@ err:\ | |||
384 | #define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) | 319 | #define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) |
385 | #define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) | 320 | #define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) |
386 | 321 | ||
387 | #define M_ASN1_I2D_len_SET(a,f) \ | ||
388 | ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); | ||
389 | |||
390 | #define M_ASN1_I2D_len_SET_type(type,a,f) \ | 322 | #define M_ASN1_I2D_len_SET_type(type,a,f) \ |
391 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ | 323 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ |
392 | V_ASN1_UNIVERSAL,IS_SET); | 324 | V_ASN1_UNIVERSAL,IS_SET); |
393 | 325 | ||
394 | #define M_ASN1_I2D_len_SEQUENCE(a,f) \ | ||
395 | ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ | ||
396 | IS_SEQUENCE); | ||
397 | |||
398 | #define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ | 326 | #define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ |
399 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ | 327 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ |
400 | V_ASN1_UNIVERSAL,IS_SEQUENCE) | 328 | V_ASN1_UNIVERSAL,IS_SEQUENCE) |
@@ -407,32 +335,15 @@ err:\ | |||
407 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 335 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
408 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); | 336 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); |
409 | 337 | ||
410 | #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ | ||
411 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); | ||
412 | |||
413 | #define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ | 338 | #define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ |
414 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ | 339 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ |
415 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); | 340 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); |
416 | 341 | ||
417 | #define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \ | ||
418 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
419 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
420 | IS_SET); | ||
421 | |||
422 | #define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ | 342 | #define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ |
423 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 343 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
424 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ | 344 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ |
425 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); | 345 | V_ASN1_CONTEXT_SPECIFIC,IS_SET); |
426 | 346 | ||
427 | #define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \ | ||
428 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
429 | IS_SEQUENCE); | ||
430 | |||
431 | #define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \ | ||
432 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
433 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
434 | IS_SEQUENCE); | ||
435 | |||
436 | #define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ | 347 | #define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ |
437 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 348 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
438 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ | 349 | ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ |
@@ -446,21 +357,6 @@ err:\ | |||
446 | ret+=ASN1_object_size(1,v,mtag); \ | 357 | ret+=ASN1_object_size(1,v,mtag); \ |
447 | } | 358 | } |
448 | 359 | ||
449 | #define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \ | ||
450 | if ((a != NULL) && (sk_num(a) != 0))\ | ||
451 | { \ | ||
452 | v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ | ||
453 | ret+=ASN1_object_size(1,v,mtag); \ | ||
454 | } | ||
455 | |||
456 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ | ||
457 | if ((a != NULL) && (sk_num(a) != 0))\ | ||
458 | { \ | ||
459 | v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \ | ||
460 | IS_SEQUENCE); \ | ||
461 | ret+=ASN1_object_size(1,v,mtag); \ | ||
462 | } | ||
463 | |||
464 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ | 360 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ |
465 | if ((a != NULL) && (sk_##type##_num(a) != 0))\ | 361 | if ((a != NULL) && (sk_##type##_num(a) != 0))\ |
466 | { \ | 362 | { \ |
@@ -481,19 +377,10 @@ err:\ | |||
481 | *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ | 377 | *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ |
482 | } | 378 | } |
483 | 379 | ||
484 | #define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\ | ||
485 | V_ASN1_UNIVERSAL,IS_SET) | ||
486 | #define M_ASN1_I2D_put_SET_type(type,a,f) \ | 380 | #define M_ASN1_I2D_put_SET_type(type,a,f) \ |
487 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) | 381 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) |
488 | #define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ | ||
489 | V_ASN1_CONTEXT_SPECIFIC,IS_SET) | ||
490 | #define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ | 382 | #define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ |
491 | i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) | 383 | i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) |
492 | #define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ | ||
493 | V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE) | ||
494 | |||
495 | #define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\ | ||
496 | V_ASN1_UNIVERSAL,IS_SEQUENCE) | ||
497 | 384 | ||
498 | #define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ | 385 | #define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ |
499 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ | 386 | i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ |
@@ -503,22 +390,12 @@ err:\ | |||
503 | if ((a != NULL) && (sk_num(a) != 0)) \ | 390 | if ((a != NULL) && (sk_num(a) != 0)) \ |
504 | M_ASN1_I2D_put_SEQUENCE(a,f); | 391 | M_ASN1_I2D_put_SEQUENCE(a,f); |
505 | 392 | ||
506 | #define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \ | ||
507 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
508 | { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
509 | IS_SET); } | ||
510 | |||
511 | #define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ | 393 | #define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ |
512 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 394 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
513 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ | 395 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ |
514 | V_ASN1_CONTEXT_SPECIFIC, \ | 396 | V_ASN1_CONTEXT_SPECIFIC, \ |
515 | IS_SET); } | 397 | IS_SET); } |
516 | 398 | ||
517 | #define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \ | ||
518 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
519 | { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ | ||
520 | IS_SEQUENCE); } | ||
521 | |||
522 | #define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ | 399 | #define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ |
523 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 400 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
524 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ | 401 | { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ |
@@ -532,20 +409,6 @@ err:\ | |||
532 | f(a,&p); \ | 409 | f(a,&p); \ |
533 | } | 410 | } |
534 | 411 | ||
535 | #define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \ | ||
536 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
537 | { \ | ||
538 | ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
539 | i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ | ||
540 | } | ||
541 | |||
542 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ | ||
543 | if ((a != NULL) && (sk_num(a) != 0)) \ | ||
544 | { \ | ||
545 | ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
546 | i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \ | ||
547 | } | ||
548 | |||
549 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ | 412 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ |
550 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 413 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
551 | { \ | 414 | { \ |
diff --git a/src/lib/libssl/src/crypto/asn1/asn_pack.c b/src/lib/libssl/src/crypto/asn1/asn_pack.c index ad738217d7..1886508654 100644 --- a/src/lib/libssl/src/crypto/asn1/asn_pack.c +++ b/src/lib/libssl/src/crypto/asn1/asn_pack.c | |||
@@ -60,93 +60,6 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | #ifndef NO_ASN1_OLD | ||
64 | |||
65 | /* ASN1 packing and unpacking functions */ | ||
66 | |||
67 | /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ | ||
68 | |||
69 | STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, | ||
70 | d2i_of_void *d2i, void (*free_func)(OPENSSL_BLOCK)) | ||
71 | { | ||
72 | STACK_OF(OPENSSL_BLOCK) *sk; | ||
73 | const unsigned char *pbuf; | ||
74 | pbuf = buf; | ||
75 | if (!(sk = d2i_ASN1_SET(NULL, &pbuf, len, d2i, free_func, | ||
76 | V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL))) | ||
77 | ASN1err(ASN1_F_ASN1_SEQ_UNPACK,ASN1_R_DECODE_ERROR); | ||
78 | return sk; | ||
79 | } | ||
80 | |||
81 | /* Turn a STACK structures into an ASN1 encoded SEQUENCE OF structure in a | ||
82 | * OPENSSL_malloc'ed buffer | ||
83 | */ | ||
84 | |||
85 | unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, | ||
86 | unsigned char **buf, int *len) | ||
87 | { | ||
88 | int safelen; | ||
89 | unsigned char *safe, *p; | ||
90 | if (!(safelen = i2d_ASN1_SET(safes, NULL, i2d, V_ASN1_SEQUENCE, | ||
91 | V_ASN1_UNIVERSAL, IS_SEQUENCE))) { | ||
92 | ASN1err(ASN1_F_ASN1_SEQ_PACK,ASN1_R_ENCODE_ERROR); | ||
93 | return NULL; | ||
94 | } | ||
95 | if (!(safe = OPENSSL_malloc (safelen))) { | ||
96 | ASN1err(ASN1_F_ASN1_SEQ_PACK,ERR_R_MALLOC_FAILURE); | ||
97 | return NULL; | ||
98 | } | ||
99 | p = safe; | ||
100 | i2d_ASN1_SET(safes, &p, i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, | ||
101 | IS_SEQUENCE); | ||
102 | if (len) *len = safelen; | ||
103 | if (buf) *buf = safe; | ||
104 | return safe; | ||
105 | } | ||
106 | |||
107 | /* Extract an ASN1 object from an ASN1_STRING */ | ||
108 | |||
109 | void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i) | ||
110 | { | ||
111 | const unsigned char *p; | ||
112 | char *ret; | ||
113 | |||
114 | p = oct->data; | ||
115 | if(!(ret = d2i(NULL, &p, oct->length))) | ||
116 | ASN1err(ASN1_F_ASN1_UNPACK_STRING,ASN1_R_DECODE_ERROR); | ||
117 | return ret; | ||
118 | } | ||
119 | |||
120 | /* Pack an ASN1 object into an ASN1_STRING */ | ||
121 | |||
122 | ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, ASN1_STRING **oct) | ||
123 | { | ||
124 | unsigned char *p; | ||
125 | ASN1_STRING *octmp; | ||
126 | |||
127 | if (!oct || !*oct) { | ||
128 | if (!(octmp = ASN1_STRING_new ())) { | ||
129 | ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); | ||
130 | return NULL; | ||
131 | } | ||
132 | if (oct) *oct = octmp; | ||
133 | } else octmp = *oct; | ||
134 | |||
135 | if (!(octmp->length = i2d(obj, NULL))) { | ||
136 | ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); | ||
137 | return NULL; | ||
138 | } | ||
139 | if (!(p = OPENSSL_malloc (octmp->length))) { | ||
140 | ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); | ||
141 | return NULL; | ||
142 | } | ||
143 | octmp->data = p; | ||
144 | i2d (obj, &p); | ||
145 | return octmp; | ||
146 | } | ||
147 | |||
148 | #endif | ||
149 | |||
150 | /* ASN1_ITEM versions of the above */ | 63 | /* ASN1_ITEM versions of the above */ |
151 | 64 | ||
152 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) | 65 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) |
diff --git a/src/lib/libssl/src/crypto/stack/safestack.h b/src/lib/libssl/src/crypto/stack/safestack.h index ea3aa0d800..56978a2b01 100644 --- a/src/lib/libssl/src/crypto/stack/safestack.h +++ b/src/lib/libssl/src/crypto/stack/safestack.h | |||
@@ -178,26 +178,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
178 | #define SKM_sk_is_sorted(type, st) \ | 178 | #define SKM_sk_is_sorted(type, st) \ |
179 | sk_is_sorted(CHECKED_STACK_OF(type, st)) | 179 | sk_is_sorted(CHECKED_STACK_OF(type, st)) |
180 | 180 | ||
181 | #define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | ||
182 | (STACK_OF(type) *)d2i_ASN1_SET( \ | ||
183 | (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \ | ||
184 | pp, length, \ | ||
185 | CHECKED_D2I_OF(type, d2i_func), \ | ||
186 | CHECKED_SK_FREE_FUNC(type, free_func), \ | ||
187 | ex_tag, ex_class) | ||
188 | |||
189 | #define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ | ||
190 | i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \ | ||
191 | CHECKED_I2D_OF(type, i2d_func), \ | ||
192 | ex_tag, ex_class, is_set) | ||
193 | |||
194 | #define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ | ||
195 | ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \ | ||
196 | CHECKED_I2D_OF(type, i2d_func), buf, len) | ||
197 | |||
198 | #define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ | ||
199 | (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func)) | ||
200 | |||
201 | #define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ | 181 | #define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ |
202 | (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ | 182 | (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ |
203 | CHECKED_D2I_OF(type, d2i_func), \ | 183 | CHECKED_D2I_OF(type, d2i_func), \ |
@@ -2198,226 +2178,126 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
2198 | SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2178 | SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2199 | #define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2179 | #define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2200 | SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2180 | SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2201 | #define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \ | ||
2202 | SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len)) | ||
2203 | #define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \ | ||
2204 | SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func)) | ||
2205 | 2181 | ||
2206 | #define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2182 | #define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2207 | SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2183 | SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2208 | #define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2184 | #define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2209 | SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2185 | SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2210 | #define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \ | ||
2211 | SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len)) | ||
2212 | #define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \ | ||
2213 | SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func)) | ||
2214 | 2186 | ||
2215 | #define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2187 | #define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2216 | SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2188 | SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2217 | #define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2189 | #define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2218 | SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2190 | SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2219 | #define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \ | ||
2220 | SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len)) | ||
2221 | #define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \ | ||
2222 | SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func)) | ||
2223 | 2191 | ||
2224 | #define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2192 | #define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2225 | SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2193 | SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2226 | #define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2194 | #define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2227 | SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2195 | SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2228 | #define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \ | ||
2229 | SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len)) | ||
2230 | #define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \ | ||
2231 | SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func)) | ||
2232 | 2196 | ||
2233 | #define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2197 | #define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2234 | SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2198 | SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2235 | #define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2199 | #define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2236 | SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2200 | SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2237 | #define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \ | ||
2238 | SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len)) | ||
2239 | #define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \ | ||
2240 | SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func)) | ||
2241 | 2201 | ||
2242 | #define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2202 | #define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2243 | SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2203 | SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2244 | #define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2204 | #define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2245 | SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2205 | SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2246 | #define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \ | ||
2247 | SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len)) | ||
2248 | #define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \ | ||
2249 | SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func)) | ||
2250 | 2206 | ||
2251 | #define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2207 | #define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2252 | SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2208 | SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2253 | #define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2209 | #define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2254 | SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2210 | SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2255 | #define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \ | ||
2256 | SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len)) | ||
2257 | #define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \ | ||
2258 | SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func)) | ||
2259 | 2211 | ||
2260 | #define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2212 | #define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2261 | SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2213 | SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2262 | #define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2214 | #define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2263 | SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2215 | SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2264 | #define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \ | ||
2265 | SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len)) | ||
2266 | #define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \ | ||
2267 | SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func)) | ||
2268 | 2216 | ||
2269 | #define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2217 | #define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2270 | SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2218 | SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2271 | #define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2219 | #define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2272 | SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2220 | SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2273 | #define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \ | ||
2274 | SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len)) | ||
2275 | #define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \ | ||
2276 | SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func)) | ||
2277 | 2221 | ||
2278 | #define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2222 | #define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2279 | SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2223 | SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2280 | #define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2224 | #define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2281 | SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2225 | SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2282 | #define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \ | ||
2283 | SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len)) | ||
2284 | #define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \ | ||
2285 | SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func)) | ||
2286 | 2226 | ||
2287 | #define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2227 | #define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2288 | SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2228 | SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2289 | #define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2229 | #define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2290 | SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2230 | SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2291 | #define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \ | ||
2292 | SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len)) | ||
2293 | #define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \ | ||
2294 | SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func)) | ||
2295 | 2231 | ||
2296 | #define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2232 | #define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2297 | SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2233 | SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2298 | #define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2234 | #define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2299 | SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2235 | SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2300 | #define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \ | ||
2301 | SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len)) | ||
2302 | #define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \ | ||
2303 | SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func)) | ||
2304 | 2236 | ||
2305 | #define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2237 | #define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2306 | SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2238 | SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2307 | #define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2239 | #define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2308 | SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2240 | SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2309 | #define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \ | ||
2310 | SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len)) | ||
2311 | #define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \ | ||
2312 | SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func)) | ||
2313 | 2241 | ||
2314 | #define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2242 | #define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2315 | SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2243 | SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2316 | #define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2244 | #define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2317 | SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2245 | SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2318 | #define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \ | ||
2319 | SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len)) | ||
2320 | #define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \ | ||
2321 | SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func)) | ||
2322 | 2246 | ||
2323 | #define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2247 | #define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2324 | SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2248 | SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2325 | #define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2249 | #define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2326 | SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2250 | SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2327 | #define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \ | ||
2328 | SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len)) | ||
2329 | #define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \ | ||
2330 | SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func)) | ||
2331 | 2251 | ||
2332 | #define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2252 | #define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2333 | SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2253 | SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2334 | #define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2254 | #define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2335 | SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2255 | SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2336 | #define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \ | ||
2337 | SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len)) | ||
2338 | #define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \ | ||
2339 | SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func)) | ||
2340 | 2256 | ||
2341 | #define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2257 | #define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2342 | SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2258 | SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2343 | #define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2259 | #define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2344 | SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2260 | SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2345 | #define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \ | ||
2346 | SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len)) | ||
2347 | #define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \ | ||
2348 | SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func)) | ||
2349 | 2261 | ||
2350 | #define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2262 | #define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2351 | SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2263 | SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2352 | #define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2264 | #define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2353 | SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2265 | SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2354 | #define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \ | ||
2355 | SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len)) | ||
2356 | #define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \ | ||
2357 | SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func)) | ||
2358 | 2266 | ||
2359 | #define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2267 | #define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2360 | SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2268 | SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2361 | #define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2269 | #define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2362 | SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2270 | SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2363 | #define ASN1_seq_pack_X509(st, i2d_func, buf, len) \ | ||
2364 | SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len)) | ||
2365 | #define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \ | ||
2366 | SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func)) | ||
2367 | 2271 | ||
2368 | #define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2272 | #define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2369 | SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2273 | SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2370 | #define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2274 | #define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2371 | SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2275 | SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2372 | #define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \ | ||
2373 | SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len)) | ||
2374 | #define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \ | ||
2375 | SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func)) | ||
2376 | 2276 | ||
2377 | #define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2277 | #define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2378 | SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2278 | SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2379 | #define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2279 | #define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2380 | SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2280 | SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2381 | #define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \ | ||
2382 | SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len)) | ||
2383 | #define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \ | ||
2384 | SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func)) | ||
2385 | 2281 | ||
2386 | #define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2282 | #define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2387 | SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2283 | SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2388 | #define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2284 | #define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2389 | SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2285 | SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2390 | #define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \ | ||
2391 | SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len)) | ||
2392 | #define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \ | ||
2393 | SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func)) | ||
2394 | 2286 | ||
2395 | #define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2287 | #define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2396 | SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2288 | SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2397 | #define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2289 | #define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2398 | SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2290 | SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2399 | #define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \ | ||
2400 | SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len)) | ||
2401 | #define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \ | ||
2402 | SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func)) | ||
2403 | 2291 | ||
2404 | #define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2292 | #define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2405 | SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2293 | SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2406 | #define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2294 | #define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2407 | SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2295 | SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2408 | #define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \ | ||
2409 | SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len)) | ||
2410 | #define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \ | ||
2411 | SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func)) | ||
2412 | 2296 | ||
2413 | #define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2297 | #define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2414 | SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2298 | SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2415 | #define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2299 | #define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
2416 | SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | 2300 | SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) |
2417 | #define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \ | ||
2418 | SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len)) | ||
2419 | #define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \ | ||
2420 | SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func)) | ||
2421 | 2301 | ||
2422 | #define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ | 2302 | #define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ |
2423 | SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) | 2303 | SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) |
diff --git a/src/lib/libssl/src/crypto/x509/x509.h b/src/lib/libssl/src/crypto/x509/x509.h index 121847b244..27befbbbb0 100644 --- a/src/lib/libssl/src/crypto/x509/x509.h +++ b/src/lib/libssl/src/crypto/x509/x509.h | |||
@@ -697,7 +697,6 @@ int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); | |||
697 | #ifndef OPENSSL_NO_DSA | 697 | #ifndef OPENSSL_NO_DSA |
698 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); | 698 | DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); |
699 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); | 699 | int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); |
700 | DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); | ||
701 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); | 700 | int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); |
702 | #endif | 701 | #endif |
703 | #ifndef OPENSSL_NO_EC | 702 | #ifndef OPENSSL_NO_EC |
@@ -881,16 +880,6 @@ X509_INFO * X509_INFO_new(void); | |||
881 | void X509_INFO_free(X509_INFO *a); | 880 | void X509_INFO_free(X509_INFO *a); |
882 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); | 881 | char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); |
883 | 882 | ||
884 | int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, | ||
885 | ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); | ||
886 | |||
887 | int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data, | ||
888 | unsigned char *md,unsigned int *len); | ||
889 | |||
890 | int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, | ||
891 | X509_ALGOR *algor2, ASN1_BIT_STRING *signature, | ||
892 | char *data,EVP_PKEY *pkey, const EVP_MD *type); | ||
893 | |||
894 | int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, | 883 | int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, |
895 | unsigned char *md,unsigned int *len); | 884 | unsigned char *md,unsigned int *len); |
896 | 885 | ||
diff --git a/src/lib/libssl/src/util/mkstack.pl b/src/lib/libssl/src/util/mkstack.pl index f708610a78..77b0ec4943 100644 --- a/src/lib/libssl/src/util/mkstack.pl +++ b/src/lib/libssl/src/util/mkstack.pl | |||
@@ -129,19 +129,6 @@ EOF | |||
129 | EOF | 129 | EOF |
130 | } | 130 | } |
131 | 131 | ||
132 | foreach $type_thing (sort @asn1setlst) { | ||
133 | $new_stackfile .= <<EOF; | ||
134 | |||
135 | #define d2i_ASN1_SET_OF_${type_thing}(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\ | ||
136 | SKM_ASN1_SET_OF_d2i($type_thing, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | ||
137 | #define i2d_ASN1_SET_OF_${type_thing}(st, pp, i2d_func, ex_tag, ex_class, is_set) \\ | ||
138 | SKM_ASN1_SET_OF_i2d($type_thing, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) | ||
139 | #define ASN1_seq_pack_${type_thing}(st, i2d_func, buf, len) \\ | ||
140 | SKM_ASN1_seq_pack($type_thing, (st), (i2d_func), (buf), (len)) | ||
141 | #define ASN1_seq_unpack_${type_thing}(buf, len, d2i_func, free_func) \\ | ||
142 | SKM_ASN1_seq_unpack($type_thing, (buf), (len), (d2i_func), (free_func)) | ||
143 | EOF | ||
144 | } | ||
145 | foreach $type_thing (sort @p12stklst) { | 132 | foreach $type_thing (sort @p12stklst) { |
146 | $new_stackfile .= <<EOF; | 133 | $new_stackfile .= <<EOF; |
147 | 134 | ||