asn1pars.c (127128) | asn1pars.c (142425) |
---|---|
1/* apps/asn1pars.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 * --- 264 unchanged lines hidden (view full) --- 273 /* If any structs to parse go through in sequence */ 274 275 if (sk_num(osk)) 276 { 277 tmpbuf=(unsigned char *)str; 278 tmplen=num; 279 for (i=0; i<sk_num(osk); i++) 280 { | 1/* apps/asn1pars.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 * --- 264 unchanged lines hidden (view full) --- 273 /* If any structs to parse go through in sequence */ 274 275 if (sk_num(osk)) 276 { 277 tmpbuf=(unsigned char *)str; 278 tmplen=num; 279 for (i=0; i<sk_num(osk); i++) 280 { |
281 int typ; |
|
281 ASN1_TYPE *atmp; 282 j=atoi(sk_value(osk,i)); 283 if (j == 0) 284 { 285 BIO_printf(bio_err,"'%s' is an invalid number\n",sk_value(osk,i)); 286 continue; 287 } 288 tmpbuf+=j; 289 tmplen-=j; 290 atmp = at; 291 at = d2i_ASN1_TYPE(NULL,&tmpbuf,tmplen); 292 ASN1_TYPE_free(atmp); 293 if(!at) 294 { 295 BIO_printf(bio_err,"Error parsing structure\n"); 296 ERR_print_errors(bio_err); 297 goto end; 298 } | 282 ASN1_TYPE *atmp; 283 j=atoi(sk_value(osk,i)); 284 if (j == 0) 285 { 286 BIO_printf(bio_err,"'%s' is an invalid number\n",sk_value(osk,i)); 287 continue; 288 } 289 tmpbuf+=j; 290 tmplen-=j; 291 atmp = at; 292 at = d2i_ASN1_TYPE(NULL,&tmpbuf,tmplen); 293 ASN1_TYPE_free(atmp); 294 if(!at) 295 { 296 BIO_printf(bio_err,"Error parsing structure\n"); 297 ERR_print_errors(bio_err); 298 goto end; 299 } |
300 typ = ASN1_TYPE_get(at); 301 if ((typ == V_ASN1_OBJECT) 302 || (typ == V_ASN1_NULL)) 303 { 304 BIO_printf(bio_err, "Can't parse %s type\n", 305 typ == V_ASN1_NULL ? "NULL" : "OBJECT"); 306 ERR_print_errors(bio_err); 307 goto end; 308 } |
|
299 /* hmm... this is a little evil but it works */ 300 tmpbuf=at->value.asn1_string->data; 301 tmplen=at->value.asn1_string->length; 302 } 303 str=(char *)tmpbuf; 304 num=tmplen; 305 } 306 --- 39 unchanged lines hidden --- | 309 /* hmm... this is a little evil but it works */ 310 tmpbuf=at->value.asn1_string->data; 311 tmplen=at->value.asn1_string->length; 312 } 313 str=(char *)tmpbuf; 314 num=tmplen; 315 } 316 --- 39 unchanged lines hidden --- |