X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fasn1_par.c;h=bde3a3b2c32051dd6a0464a5232b62fda0c59c9c;hp=3906227d21a70b1c99312bcb749a435d1f083d7a;hb=bceacf938f07f84ecd2c0f2ad42b1ff90f34f93b;hpb=7dfb0b774e6592dcbfe47015168a0ac8b44e2a17 diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c index 3906227d21..bde3a3b2c3 100644 --- a/crypto/asn1/asn1_par.c +++ b/crypto/asn1/asn1_par.c @@ -108,6 +108,8 @@ int indent; 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) @@ -266,7 +268,8 @@ int indent; if ( (tag == V_ASN1_PRINTABLESTRING) || (tag == V_ASN1_T61STRING) || (tag == V_ASN1_IA5STRING) || - (tag == V_ASN1_UTCTIME)) + (tag == V_ASN1_UTCTIME) || + (tag == V_ASN1_GENERALIZEDTIME)) { if (BIO_write(bp,":",1) <= 0) goto end; if ((len > 0) && @@ -370,6 +373,38 @@ int indent; } 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; ilength; 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) {