#include <openssl/asn1.h>
static int asn1_print_info(BIO *bp, int tag, int xclass,int constructed,
- int indent);
-static int asn1_parse2(BIO *bp, const unsigned char **pp, size_t length,
- int offset, int depth, int indent, int dump);
+ int indent);
+static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
+ int offset, int depth, int indent, int dump);
static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
- int indent)
+ int indent)
{
static const char fmt[]="%-18s";
char str[128];
return(0);
}
-int ASN1_parse(BIO *bp, const unsigned char *pp, size_t len, int indent)
+int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent)
{
return(asn1_parse2(bp,&pp,len,0,0,indent,0));
}
-int ASN1_parse_dump(BIO *bp, const unsigned char *pp, size_t len, int indent,
- int dump)
+int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, int dump)
{
return(asn1_parse2(bp,&pp,len,0,0,indent,dump));
}
-static int asn1_parse2(BIO *bp, const unsigned char **pp, size_t length,
- int offset, int depth, int indent, int dump)
+static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset,
+ int depth, int indent, int dump)
{
const unsigned char *p,*ep,*tot,*op,*opp;
- size_t len;
+ long len;
int tag,xclass,ret=0;
int nl,hl,j,r;
ASN1_OBJECT *o=NULL;
if (j != (V_ASN1_CONSTRUCTED | 1))
{
if (BIO_printf(bp,"d=%-2d hl=%ld l=%4ld ",
- depth,(long)hl,(long)len) <= 0)
+ depth,(long)hl,len) <= 0)
goto end;
}
else
{
if (BIO_printf(bp,"d=%-2d hl=%ld l=inf ",
- depth,(long)hl) <= 0)
+ depth,(long)hl) <= 0)
goto end;
}
if (!asn1_print_info(bp,tag,xclass,j,(indent)?depth:0))
if (len > length)
{
BIO_printf(bp,
- "length is greater than %ld\n",
- (long)length);
+ "length is greater than %ld\n",length);
ret=0;
goto end;
}
(tag == V_ASN1_T61STRING) ||
(tag == V_ASN1_IA5STRING) ||
(tag == V_ASN1_VISIBLESTRING) ||
+ (tag == V_ASN1_NUMERICSTRING) ||
+ (tag == V_ASN1_UTF8STRING) ||
(tag == V_ASN1_UTCTIME) ||
(tag == V_ASN1_GENERALIZEDTIME))
{
ii=d2i_ASN1_BOOLEAN(NULL,&opp,len+hl);
if (ii < 0)
{
- if (BIO_write(bp,"Bad boolean\n",12))
+ if (BIO_write(bp,"Bad boolean\n",12) <= 0)
goto end;
}
BIO_printf(bp,":%d",ii);