diff options
author | jmagne <jmagne@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-04-15 00:39:19 +0000 |
---|---|---|
committer | jmagne <jmagne@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-04-15 00:39:19 +0000 |
commit | cb1463e369ce7f659d7e090c161e3c4a2f60a3f9 (patch) | |
tree | 1876ba4b8a5962ea3ff0352cfbc354a31f9d1bf9 /pki/base/common | |
parent | ed0400290cfdc9144d3e672c8ec563ebbcae915d (diff) | |
download | pki-cb1463e369ce7f659d7e090c161e3c4a2f60a3f9.tar.gz pki-cb1463e369ce7f659d7e090c161e3c4a2f60a3f9.tar.xz pki-cb1463e369ce7f659d7e090c161e3c4a2f60a3f9.zip |
Fix bugzilla bug# 695015 - Serial No. of a revoked certificate is not populated in the CA signedAudit messages.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1961 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/common')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java b/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java index 6c66f49e5..5d04ea9f5 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/DoRevoke.java @@ -249,10 +249,18 @@ public class DoRevoke extends CMSServlet { cmsReq.setStatus(CMSRequest.UNAUTHORIZED); return; } + if (mAuthMgr != null && mAuthMgr.equals(IAuthSubsystem.CERTUSERDB_AUTHMGR_ID)) { - if (authToken != null) { + + String serialNumber = req.getParameter("serialNumber"); + X509CertImpl sslCert = (X509CertImpl) getSSLClientCertificate(req); + + if (serialNumber != null) { + eeSerialNumber = serialNumber; + } + authMgr = authToken.getInString(AuthToken.TOKEN_AUTHMGR_INST_NAME); String agentID = authToken.getInString("userid"); @@ -273,6 +281,7 @@ public class DoRevoke extends CMSServlet { eeSubjectDN = sslCert.getSubjectDN().toString(); eeSerialNumber = sslCert.getSerialNumber().toString(); } + } if (authorized) { @@ -391,6 +400,7 @@ public class DoRevoke extends CMSServlet { String auditApprovalStatus = ILogger.SIGNED_AUDIT_EMPTY_VALUE; String auditReasonNum = String.valueOf(reason); + CMS.debug("DoRevoke: eeSerialNumber: " + eeSerialNumber + " auditSerialNumber: " + auditSerialNumber); long startTime = CMS.getCurrentDate().getTime(); try { @@ -1114,10 +1124,33 @@ public class DoRevoke extends CMSServlet { if (eeSerialNumber != null) { serialNumber = eeSerialNumber.trim(); + // find out if the value is hex or decimal + + int value = -1; + + //try int + try { + value = Integer.parseInt(serialNumber,10); + } catch (NumberFormatException e) { + } + + //try hex + if( value == -1) { + try { + value = Integer.parseInt(serialNumber,16); + + } catch (NumberFormatException e) { + } + } + // give up if it isn't hex or dec + if ( value == -1) { + throw new NumberFormatException(); + } + // convert it to hexadecimal serialNumber = "0x" + Integer.toHexString( - Integer.valueOf(serialNumber).intValue()); + value); } else { serialNumber = ILogger.SIGNED_AUDIT_EMPTY_VALUE; } |