int constructed;
int indent;
{
- static char *fmt="%-18s";
- static char *fmt2="%2d %-15s";
- char *p,str[128],*p2=NULL;
+ static const char fmt[]="%-18s";
+ static const char fmt2[]="%2d %-15s";
+ char str[128];
+ const char *p,*p2=NULL;
if (constructed & V_ASN1_CONSTRUCTED)
p="cons: ";
p="BOOLEAN";
else if (tag == V_ASN1_INTEGER)
p="INTEGER";
+ else if (tag == V_ASN1_ENUMERATED)
+ p="ENUMERATED";
else if (tag == V_ASN1_BIT_STRING)
p="BIT STRING";
else if (tag == V_ASN1_OCTET_STRING)
p="GENERALIZEDTIME";
else if (tag == V_ASN1_GRAPHICSTRING)
p="GRAPHICSTRING";
- else if (tag == V_ASN1_ISO64STRING)
- p="ISO64STRING";
+ else if (tag == V_ASN1_VISIBLESTRING)
+ p="VISIBLESTRING";
else if (tag == V_ASN1_GENERALSTRING)
p="GENERALSTRING";
else if (tag == V_ASN1_UNIVERSALSTRING)
if ( (tag == V_ASN1_PRINTABLESTRING) ||
(tag == V_ASN1_T61STRING) ||
(tag == V_ASN1_IA5STRING) ||
- (tag == V_ASN1_UTCTIME))
+ (tag == V_ASN1_VISIBLESTRING) ||
+ (tag == V_ASN1_UTCTIME) ||
+ (tag == V_ASN1_GENERALIZEDTIME))
{
if (BIO_write(bp,":",1) <= 0) goto end;
if ((len > 0) &&
}
ASN1_INTEGER_free(bs);
}
+ else if (tag == V_ASN1_ENUMERATED)
+ {
+ ASN1_ENUMERATED *bs;
+ int i;
+
+ opp=op;
+ bs=d2i_ASN1_ENUMERATED(NULL,&opp,len+hl);
+ if (bs != NULL)
+ {
+ if (BIO_write(bp,":",1) <= 0) goto end;
+ if (bs->type == V_ASN1_NEG_ENUMERATED)
+ if (BIO_write(bp,"-",1) <= 0)
+ goto end;
+ for (i=0; i<bs->length; i++)
+ {
+ if (BIO_printf(bp,"%02X",
+ bs->data[i]) <= 0)
+ goto end;
+ }
+ if (bs->length == 0)
+ {
+ if (BIO_write(bp,"00",2) <= 0)
+ goto end;
+ }
+ }
+ else
+ {
+ if (BIO_write(bp,"BAD ENUMERATED",11) <= 0)
+ goto end;
+ }
+ ASN1_ENUMERATED_free(bs);
+ }
if (!nl)
{