summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_bytes.c
diff options
context:
space:
mode:
authordjm <>2008-09-06 12:17:54 +0000
committerdjm <>2008-09-06 12:17:54 +0000
commit38ce604e3cc97706b876b0525ddff0121115456d (patch)
tree7ccc28afe1789ea3dbedf72365f955d5b8e105b5 /src/lib/libcrypto/asn1/a_bytes.c
parent12867252827c8efaa8ddd1fa3b3d6e321e2bcdef (diff)
downloadopenbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.gz
openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.bz2
openbsd-38ce604e3cc97706b876b0525ddff0121115456d.zip
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/asn1/a_bytes.c')
-rw-r--r--src/lib/libcrypto/asn1/a_bytes.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c
index 2407f7c87a..92d630cdba 100644
--- a/src/lib/libcrypto/asn1/a_bytes.c
+++ b/src/lib/libcrypto/asn1/a_bytes.c
@@ -60,14 +60,15 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62 62
63static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c); 63static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c);
64/* type is a 'bitmap' of acceptable string types. 64/* type is a 'bitmap' of acceptable string types.
65 */ 65 */
66ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp, 66ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
67 long length, int type) 67 long length, int type)
68 { 68 {
69 ASN1_STRING *ret=NULL; 69 ASN1_STRING *ret=NULL;
70 unsigned char *p,*s; 70 const unsigned char *p;
71 unsigned char *s;
71 long len; 72 long len;
72 int inf,tag,xclass; 73 int inf,tag,xclass;
73 int i=0; 74 int i=0;
@@ -153,11 +154,12 @@ int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass)
153 return(r); 154 return(r);
154 } 155 }
155 156
156ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length, 157ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
157 int Ptag, int Pclass) 158 long length, int Ptag, int Pclass)
158 { 159 {
159 ASN1_STRING *ret=NULL; 160 ASN1_STRING *ret=NULL;
160 unsigned char *p,*s; 161 const unsigned char *p;
162 unsigned char *s;
161 long len; 163 long len;
162 int inf,tag,xclass; 164 int inf,tag,xclass;
163 int i=0; 165 int i=0;
@@ -185,7 +187,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
185 187
186 if (inf & V_ASN1_CONSTRUCTED) 188 if (inf & V_ASN1_CONSTRUCTED)
187 { 189 {
188 ASN1_CTX c; 190 ASN1_const_CTX c;
189 191
190 c.pp=pp; 192 c.pp=pp;
191 c.p=p; 193 c.p=p;
@@ -247,7 +249,7 @@ err:
247 * them into the one structure that is then returned */ 249 * them into the one structure that is then returned */
248/* There have been a few bug fixes for this function from 250/* There have been a few bug fixes for this function from
249 * Paul Keogh <paul.keogh@sse.ie>, many thanks to him */ 251 * Paul Keogh <paul.keogh@sse.ie>, many thanks to him */
250static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c) 252static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c)
251 { 253 {
252 ASN1_STRING *os=NULL; 254 ASN1_STRING *os=NULL;
253 BUF_MEM b; 255 BUF_MEM b;
@@ -268,7 +270,7 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
268 { 270 {
269 if (c->inf & 1) 271 if (c->inf & 1)
270 { 272 {
271 c->eos=ASN1_check_infinite_end(&c->p, 273 c->eos=ASN1_const_check_infinite_end(&c->p,
272 (long)(c->max-c->p)); 274 (long)(c->max-c->p));
273 if (c->eos) break; 275 if (c->eos) break;
274 } 276 }
@@ -296,7 +298,7 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
296 num+=os->length; 298 num+=os->length;
297 } 299 }
298 300
299 if (!asn1_Finish(c)) goto err; 301 if (!asn1_const_Finish(c)) goto err;
300 302
301 a->length=num; 303 a->length=num;
302 if (a->data != NULL) OPENSSL_free(a->data); 304 if (a->data != NULL) OPENSSL_free(a->data);