diff -urN openssl-0.9.5-orig/apps/asn1pars.c openssl-0.9.5-work/apps/asn1pars.c
--- openssl-0.9.5-orig/apps/asn1pars.c	Fri Feb 11 03:46:52 2000
+++ openssl-0.9.5-work/apps/asn1pars.c	Tue Mar 14 13:42:28 2000
@@ -72,6 +72,7 @@
 /* -inform arg	- input format - default PEM (DER or PEM)
  * -in arg	- input file - default stdin
  * -i		- indent the details by depth
+ * -x           - print out with xml
  * -offset	- where in the file to start
  * -length	- how many bytes to use
  * -oid file	- extra oid description file
@@ -88,7 +89,7 @@
 	unsigned int length=0;
 	long num,tmplen;
 	BIO *in=NULL,*out=NULL,*b64=NULL, *derout = NULL;
-	int informat,indent=0, noout = 0;
+	int informat,indent=0, noout = 0, xml=0;
 	char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
 	unsigned char *tmpbuf;
 	BUF_MEM *buf=NULL;
@@ -132,6 +133,7 @@
 			{
 			indent=1;
 			}
+		else if (strcmp(*argv,"-x") == 0) xml=1;
 		else if (strcmp(*argv,"-noout") == 0) noout = 1;
 		else if (strcmp(*argv,"-oid") == 0)
 			{
@@ -176,6 +178,7 @@
 		BIO_printf(bio_err," -offset arg   offset into file\n");
 		BIO_printf(bio_err," -length arg   length of section in file\n");
 		BIO_printf(bio_err," -i            indent entries\n");
+		BIO_printf(bio_err," -x            print out xml\n");
 		BIO_printf(bio_err," -oid file     file of extra oid definitions\n");
 		BIO_printf(bio_err," -strparse offset\n");
 		BIO_printf(bio_err,"               a series of these can be used to 'dig' into multiple\n");
@@ -292,12 +295,25 @@
 			goto end;
 		}
 	}
-	if (!noout &&
+	if (!noout) {
+	  if (xml) { 
+	    if (
+	    !ASN1_parse_xml(out,(unsigned char *)&(str[offset]),length,indent))
+	    {
+	      ERR_print_errors(bio_err);
+	      goto end;
+	    }
+	  }
+	  else {
+            if (
 	    !ASN1_parse(out,(unsigned char *)&(str[offset]),length,indent))
 		{
 		ERR_print_errors(bio_err);
 		goto end;
 		}
+	  }
+	}
+	
 	ret=0;
 end:
 	BIO_free(derout);
diff -urN openssl-0.9.5-orig/crypto/asn1/asn1.h openssl-0.9.5-work/crypto/asn1/asn1.h
--- openssl-0.9.5-orig/crypto/asn1/asn1.h	Sat Feb 26 13:25:26 2000
+++ openssl-0.9.5-work/crypto/asn1/asn1.h	Tue Mar 14 13:42:28 2000
@@ -739,6 +739,7 @@
 int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
 int ASN1_STRING_print(BIO *bp,ASN1_STRING *v);
 int ASN1_parse(BIO *bp,unsigned char *pp,long len,int indent);
+int ASN1_parse_xml(BIO *, unsigned char *, long, int);
 #endif
 const char *ASN1_tag2str(int tag);
 
diff -urN openssl-0.9.5-orig/crypto/asn1/asn1_par.c openssl-0.9.5-work/crypto/asn1/asn1_par.c
--- openssl-0.9.5-orig/crypto/asn1/asn1_par.c	Tue Oct 19 20:49:24 1999
+++ openssl-0.9.5-work/crypto/asn1/asn1_par.c	Tue Mar 14 13:42:28 2000
@@ -383,3 +383,325 @@
 	return tag2str[tag];
 }
 
+
+/*---------------- xml part --------------*/
+
+const char *ASN1_tag2str_xml(int);
+
+static int asn1_parse2_xml(BIO *bp, unsigned char **pp, long length,
+	int offset, int depth, int indent);
+
+int ASN1_parse_xml(BIO *bp, unsigned char *pp, long len, int indent)
+	{
+	return(asn1_parse2_xml(bp,&pp,len,0,0,indent));
+	}
+
+static int asn1_parse2_xml(BIO *bp, unsigned char **pp, long length, int offset,
+	     int depth, int indent)
+	{
+	unsigned char *p,*ep,*tot,*op,*opp;
+	long len;
+	int tag,xclass,ret=0;
+	int nl,hl,j,r;
+	int seq = 0;
+	ASN1_OBJECT *o=NULL;
+	ASN1_OCTET_STRING *os=NULL;
+	/* ASN1_BMPSTRING *bmp=NULL;*/
+
+	p= *pp;
+	tot=p+length;
+	op=p-1;
+	while ((p < tot) && (op < p))
+		{
+		op=p;
+		j=ASN1_get_object(&p,&len,&tag,&xclass,length);
+#ifdef LINT
+		j=j;
+#endif
+		if (j & 0x80)
+			{
+			if (BIO_write(bp,"Error in encoding\n",18) <= 0)
+				goto end;
+			ret=0;
+			goto end;
+			}
+		hl=(p-op);
+		length-=hl;
+		/* if j == 0x21 it is a constructed indefinite length object */
+
+		{ int i; for (i=0; i<depth; i++) BIO_printf(bp, "  "); }
+		if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
+		  BIO_printf(bp,"<PRIVATE tag='%d'",tag);
+		else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == 
+			 V_ASN1_CONTEXT_SPECIFIC)
+		  BIO_printf(bp,"<CONTEXT_SPECIFIC tag='%d'",tag);
+		else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
+		  BIO_printf(bp,"<APPLICATION tag='%d'",tag);
+		else 
+		  BIO_printf(bp,"<%s index='%d'", ASN1_tag2str_xml(tag), seq++);
+		BIO_printf(bp," level='%d'>", depth);
+
+		if (j & V_ASN1_CONSTRUCTED)
+			{
+			ep=p+len;
+			if (BIO_write(bp,"\n",1) <= 0) goto end;
+			if (len > length)
+				{
+				BIO_printf(bp,
+					"length is greater than %ld\n",length);
+				ret=0;
+				goto end;
+				}
+			if ((j == 0x21) && (len == 0))
+				{
+				for (;;)
+					{
+					r=asn1_parse2_xml(bp,&p,(long)(tot-p),
+						offset+(p - *pp),depth+1,
+						indent);
+					if (r == 0) { ret=0; goto end; }
+					if ((r == 2) || (p >= tot)) break;
+					}
+				}
+			else
+				while (p < ep)
+					{
+					r=asn1_parse2_xml(bp,&p,(long)len,
+						offset+(p - *pp),depth+1,
+						indent);
+					if (r == 0) { ret=0; goto end; }
+					}
+
+			{ int i; for (i=0; i<depth; i++) BIO_printf(bp, "  "); }
+			if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
+			  BIO_printf(bp,"</PRIVATE>\n");
+			else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == 
+				 V_ASN1_CONTEXT_SPECIFIC)
+			  BIO_printf(bp,"</CONTEXT_SPECIFIC>\n");
+			else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
+			  BIO_printf(bp,"</APPLICATION>\n");
+			else 
+			  BIO_printf(bp,"</%s>\n", ASN1_tag2str_xml(tag));
+
+			}
+		else if (xclass != 0)
+			{
+			unsigned int c; int i;
+			for (i=0; i< len; i++) {
+			  c = ((unsigned char*)p)[i];
+			  BIO_printf(bp, "%02X", c);
+			}
+			p+=len;
+
+			if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
+			  BIO_printf(bp,"</PRIVATE>\n");
+			else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == 
+				 V_ASN1_CONTEXT_SPECIFIC)
+			  BIO_printf(bp,"</CONTEXT_SPECIFIC>\n");
+			else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
+			  BIO_printf(bp,"</APPLICATION>\n");
+			else 
+			  BIO_printf(bp,"</%s>\n", ASN1_tag2str_xml(tag));
+
+			// if (BIO_write(bp,"\n",1) <= 0) goto end;
+			}
+		else
+			{
+			nl=0;
+			if (	(tag == V_ASN1_PRINTABLESTRING) ||
+				(tag == V_ASN1_T61STRING) ||
+				(tag == V_ASN1_IA5STRING) ||
+				(tag == V_ASN1_VISIBLESTRING) ||
+				(tag == V_ASN1_UTCTIME) ||
+				(tag == V_ASN1_GENERALIZEDTIME))
+			  {
+			    int i;
+			    for (i=0; i<len; i++) {
+			      if (((char *)p)[i] == '<')
+				BIO_printf(bp,"&lt;");
+			      else if (((char *)p)[i] == '&')
+				BIO_printf(bp,"&amp;");
+			      else BIO_printf(bp, "%c", ((char *)p)[i]);
+			    }
+			  }
+			else if (tag == V_ASN1_OBJECT)
+				{
+				opp=op;
+				if (d2i_ASN1_OBJECT(&o,&opp,len+hl) != NULL)
+					{
+					i2a_ASN1_OBJECT(bp,o);
+					}
+				else
+					{
+				    //if (BIO_write(bp,":BAD OBJECT",11) <= 0)
+				    //goto end;
+					}
+				}
+			else if (tag == V_ASN1_BOOLEAN)
+				{
+				int ii;
+
+				opp=op;
+				ii=d2i_ASN1_BOOLEAN(NULL,&opp,len+hl);
+				if (ii < 0)
+					{
+				      //if (BIO_write(bp,"Bad boolean\n",12))
+				      //goto end;
+					}
+				BIO_printf(bp,"%d",ii);
+				}
+			else if (tag == V_ASN1_BMPSTRING)
+				{
+				/* do the BMP thang */
+				}
+			else if (tag == V_ASN1_OCTET_STRING ||
+				 tag == V_ASN1_BIT_STRING)
+				{
+				int i,printable=1;
+
+				opp=op;
+				if (tag == V_ASN1_OCTET_STRING)
+				  os=d2i_ASN1_OCTET_STRING(NULL,&opp,len+hl);
+				else os=d2i_ASN1_BIT_STRING(NULL,&opp,len+hl);
+				if (os != NULL)
+					{
+					opp=os->data;
+
+					/*
+					for (i=0; i<os->length; i++)
+						{
+						if ((	(opp[i] < ' ') &&
+							(opp[i] != '\n') &&
+							(opp[i] != '\r') &&
+							(opp[i] != '\t')) ||
+							(opp[i] > '~'))
+							{
+							printable=0;
+							break;
+							}
+						}
+					if (printable && (os->length > 0))
+						{
+						if (BIO_write(bp,(char *)opp,
+							os->length) <= 0)
+							goto end;
+						}
+					*/
+
+					if (os->length > 0)
+					  {
+					    unsigned int c;
+					    for (i=0; i< os->length; i++) {
+					      c = ((unsigned char*)opp)[i];
+					      BIO_printf(bp, "%02X", c);
+					      }
+					  }
+					M_ASN1_OCTET_STRING_free(os);
+					os=NULL;
+					}
+				}
+			else if (tag == V_ASN1_INTEGER)
+				{
+				ASN1_INTEGER *bs;
+				int i;
+
+				opp=op;
+				bs=d2i_ASN1_INTEGER(NULL,&opp,len+hl);
+				if (bs != NULL)
+					{
+					if (bs->type == V_ASN1_NEG_INTEGER)
+						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 INTEGER",11) <= 0)
+				    //goto end;
+					}
+				M_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 (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;
+					}
+				M_ASN1_ENUMERATED_free(bs);
+				}
+
+			BIO_printf(bp,"</%s>", ASN1_tag2str_xml(tag));
+			if (!nl) 
+				{
+				if (BIO_write(bp,"\n",1) <= 0) goto end;
+				}
+			p+=len;
+			if ((tag == V_ASN1_EOC) && (xclass == 0))
+				{
+				ret=2; /* End of sequence */
+				goto end;
+				}
+			}
+		length-=len;
+		}
+	ret=1;
+end:
+	if (o != NULL) ASN1_OBJECT_free(o);
+	if (os != NULL) M_ASN1_OCTET_STRING_free(os);
+	*pp=p;
+	return(ret);
+	}
+
+const char *ASN1_tag2str_xml(int tag)
+{
+	const static char *tag2str[] = {
+	 "EOC", "BOOLEAN", "INTEGER", "BIT_STRING", "OCTET_STRING", /* 0-4 */
+	 "NULL", "OBJECT", "OBJECT_DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */
+	 "ENUMERATED", "<ASN1_11>", "UTF8STRING", "<ASN1_13>", 	    /* 10-13 */
+	"<ASN1_14>", "<ASN1_15>", "SEQUENCE", "SET", 		    /* 15-17 */
+	"NUMERICSTRING", "PRINTABLESTRING", "T61STRING",	    /* 18-20 */
+	"VIDEOTEXSTRING", "IA5STRING", "UTCTIME","GENERALIZEDTIME", /* 21-24 */
+	"GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",	    /* 25-27 */
+	"UNIVERSALSTRING", "<ASN1_29>", "BMPSTRING"		    /* 28-30 */
+	};
+
+	if((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
+							tag &= ~0x100;
+
+	if(tag < 0 || tag > 30) return "(unknown)";
+	return tag2str[tag];
+}
+
diff -urN openssl-0.9.5-orig/util/libeay.num openssl-0.9.5-work/util/libeay.num
--- openssl-0.9.5-orig/util/libeay.num	Sat Feb 26 16:16:48 2000
+++ openssl-0.9.5-work/util/libeay.num	Tue Mar 14 13:42:28 2000
@@ -2227,3 +2227,4 @@
 RAND_egd                                2253
 RAND_status                             2254
 bn_dump1                                2255
+ASN1_parse_xml                          2256
