I've attached a small patch to make "open asn1parse" print out the
contents of "GENERAL" stings in ASN.1 files.  I've found that there are
cases when then the "GENERAL" strings contain a lot of useful
information.

-- 
-----------------------------------------------------------------------
|          Steven Elliott          |      [EMAIL PROTECTED]     |
-----------------------------------------------------------------------

Change to make "openessl asn1parse" print general strings.
    Steven Elliott <[EMAIL PROTECTED]>


--- crypto/asn1/asn1_par.c.orig	2006-02-17 17:40:24.000000000 -0600
+++ crypto/asn1/asn1_par.c	2006-02-17 18:08:15.000000000 -0600
@@ -382,6 +382,30 @@
 					}
 				M_ASN1_ENUMERATED_free(bs);
 				}
+			else if (tag == V_ASN1_GENERALSTRING)
+				{
+				ASN1_GENERALSTRING *gs;
+				int i;
+
+				opp=op;
+				gs=d2i_ASN1_GENERALSTRING(NULL,&opp,len+hl);
+				if (gs != NULL)
+					{
+					if (BIO_write(bp,":",1) <= 0) goto end;
+					for (i=0; i<gs->length; i++)
+						{
+						if (BIO_printf(bp,"%c",
+						       gs->data[i]) <= 0)
+							goto end;
+						}
+					}
+				else
+					{
+					if (BIO_write(bp,"BAD GENERALSTRING",17) <= 0)
+						goto end;
+					}
+				M_ASN1_GENERALSTRING_free(gs);
+				}
 			else if (len > 0 && dump)
 				{
 				if (!nl) 

Reply via email to