dummyitem.data = NULL;
CERT_HTMLCertInfo(CERTCertificate *cert, PRBool showImages, PRBool showIssuer){    SECStatus rv;    char *issuer, *subject, *serialNumber, *version;    char *notBefore, *notAfter;    char *ret;    char *nickname;    SECItem dummyitem;    unsigned char fingerprint[16];   /* result of MD5, always 16 bytes */    char *fpstr;    SECItem fpitem;    char *commentstring = NULL;    SECKEYPublicKey *pubk;    char *DSSPriv;    char *KMID = NULL;    char *servername;        if (!cert) {	return(0);    }    issuer = CERT_FormatName (&cert->issuer);    subject = CERT_FormatName (&cert->subject);    version = CERT_Hexify (&cert->version,1);    serialNumber = CERT_Hexify (&cert->serialNumber,1);    notBefore = DER_TimeChoiceDayToAscii(&cert->validity.notBefore);    notAfter = DER_TimeChoiceDayToAscii(&cert->validity.notAfter);    servername = CERT_FindNSStringExtension(cert,				   SEC_OID_NS_CERT_EXT_SSL_SERVER_NAME);    nickname = cert->nickname;    if ( nickname == NULL ) {	showImages = PR_FALSE;    }    dummyitem.data = NULL;    rv = CERT_FindCertExtension(cert, SEC_OID_NS_CERT_EXT_SUBJECT_LOGO,			       &dummyitem);    if ( dummyitem.data ) {	PORT_Free(dummyitem.data);    }        if ( rv || !showImages ) {	htmlcertstrings[1] = "";	htmlcertstrings[2] = "";	htmlcertstrings[3] = "";    } else {	htmlcertstrings[1] = "<img src=\"about:security?subject-logo=";	htmlcertstrings[2] = nickname;	htmlcertstrings[3] = "\">";    }    if ( servername ) {	char *tmpstr;	tmpstr = (char *)PORT_Alloc(PORT_Strlen(subject) +				    PORT_Strlen(servername) +				    sizeof("<br>") + 1);	if ( tmpstr ) {	    PORT_Strcpy(tmpstr, servername);	    PORT_Strcat(tmpstr, "<br>");	    PORT_Strcat(tmpstr, subject);	    PORT_Free(subject);	    subject = tmpstr;	}    }        htmlcertstrings[5] = subject;    dummyitem.data = NULL;        rv = CERT_FindCertExtension(cert, SEC_OID_NS_CERT_EXT_ISSUER_LOGO,			       &dummyitem);    if ( dummyitem.data ) {	PORT_Free(dummyitem.data);    }        if ( rv || !showImages ) {	htmlcertstrings[7] = "";	htmlcertstrings[8] = "";	htmlcertstrings[9] = "";    } else {	htmlcertstrings[7] = "<img src=\"about:security?issuer-logo=";	htmlcertstrings[8] = nickname;	htmlcertstrings[9] = "\">";    }        if (showIssuer == PR_TRUE) {        htmlcertstrings[11] = issuer;    } else {	htmlcertstrings[11] = "";    }    htmlcertstrings[13] = serialNumber;    htmlcertstrings[15] = notBefore;    htmlcertstrings[17] = notAfter;    pubk = CERT_ExtractPublicKey(cert);    DSSPriv = NULL;    if (pubk && (pubk->keyType == fortezzaKey)) {	htmlcertstrings[18] = "</b><br><b>Clearance:</b>";	htmlcertstrings[19] = sec_FortezzaClearance(					&pubk->u.fortezza.clearance);	htmlcertstrings[20] = "<br><b>DSS Privileges:</b>";	DSSPriv = sec_FortezzaCertPrivilege(					&pubk->u.fortezza.DSSpriviledge);	htmlcertstrings[21] = DSSPriv;	htmlcertstrings[22] = "<br><b>KEA Privileges:</b>";	htmlcertstrings[23] = sec_FortezzaMessagePrivilege(					&pubk->u.fortezza.KEApriviledge);	htmlcertstrings[24] = "<br><b>KMID:</b>";	dummyitem.data = &pubk->u.fortezza.KMID[0];	dummyitem.len = sizeof(pubk->u.fortezza.KMID);	KMID = CERT_Hexify (&dummyitem,0);	htmlcertstrings[25] = KMID;    } else {	/* clear out the headers in the non-fortezza cases */	htmlcertstrings[18] = "";	htmlcertstrings[19] = "";	htmlcertstrings[20] = "";	htmlcertstrings[21] = "";	htmlcertstrings[22] = "";	htmlcertstrings[23] = "";	htmlcertstrings[24] = "";	htmlcertstrings[25] = "</b>";    }    if (pubk) {      SECKEY_DestroyPublicKey(pubk);    }#define HTML_OFF 27    rv = PK11_HashBuf(SEC_OID_MD5, fingerprint,     	              cert->derCert.data, cert->derCert.len);        fpitem.data = fingerprint;    fpitem.len = sizeof(fingerprint);    fpstr = CERT_Hexify (&fpitem,1);        htmlcertstrings[HTML_OFF] = fpstr;    commentstring = CERT_GetCertCommentString(cert);    if (commentstring == NULL) {	htmlcertstrings[HTML_OFF+2] = "";	htmlcertstrings[HTML_OFF+3] = "";	htmlcertstrings[HTML_OFF+4] = "";    } else {	htmlcertstrings[HTML_OFF+2] =	    "<b>Comment:</b>"	    "<table border=0 cellspacing=0 cellpadding=0><tr>"	    "<td width=10> </td><td><font size=3>"	    "<textarea name=foobar rows=4 cols=55 onfocus=\"this.blur()\">";	htmlcertstrings[HTML_OFF+3] = commentstring;	htmlcertstrings[HTML_OFF+4] = "</textarea></font></td></tr></table>";    }        ret = gatherStrings(htmlcertstrings);        if ( issuer ) {	PORT_Free(issuer);    }        if ( subject ) {	PORT_Free(subject);    }        if ( version ) {	PORT_Free(version);    }        if ( serialNumber ) {	PORT_Free(serialNumber);    }        if ( notBefore ) {	PORT_Free(notBefore);    }        if ( notAfter ) {	PORT_Free(notAfter);    }        if ( fpstr ) {	PORT_Free(fpstr);    }    if (DSSPriv) {	PORT_Free(DSSPriv);    }    if (KMID) {	PORT_Free(KMID);    }    if ( commentstring ) {	PORT_Free(commentstring);    }        if ( servername ) {	PORT_Free(servername);    }        return(ret);}