Skip to content

Commit

Permalink
Refactored ProfileSubmitCMCServlet.auditInfoCertValue().
Browse files Browse the repository at this point in the history
The ProfileSubmitCMCServlet.auditInfoCertValue() has been modified
to accept X509CertImpl like CAProcessor.auditInfoCertValue().

Change-Id: Ib3b4c4c19250df73a769590488cb5716a50a065b
  • Loading branch information
edewata committed Apr 20, 2017
1 parent 41fcfc4 commit e74fca2
Showing 1 changed file with 6 additions and 10 deletions.
Expand Up @@ -642,7 +642,6 @@ public void process(CMSRequest cmsReq) throws EBaseException {
String auditMessage = null;
String auditSubjectID = auditSubjectID();
String auditRequesterID = ILogger.UNIDENTIFIED;
String auditInfoCertValue = ILogger.SIGNED_AUDIT_EMPTY_VALUE;

try {
///////////////////////////////////////////////
Expand Down Expand Up @@ -672,8 +671,8 @@ public void process(CMSRequest cmsReq) throws EBaseException {
profile.submit(authToken, reqs[k]);
reqs[k].setRequestStatus(RequestStatus.COMPLETE);

// reset the "auditInfoCertValue"
auditInfoCertValue = auditInfoCertValue(reqs[k]);
X509CertImpl x509cert = reqs[k].getExtDataInCert(IEnrollProfile.REQUEST_ISSUED_CERT);
String auditInfoCertValue = auditInfoCertValue(x509cert);

if (auditInfoCertValue != null) {
if (!(auditInfoCertValue.equals(
Expand Down Expand Up @@ -777,8 +776,8 @@ public void process(CMSRequest cmsReq) throws EBaseException {
profile.getRequestQueue().markAsServiced(provedReq);
CMS.debug("ProfileSubmitCMCServlet: provedReq set to complete");

// reset the "auditInfoCertValue"
auditInfoCertValue = auditInfoCertValue(reqs[0]);
X509CertImpl x509cert = reqs[0].getExtDataInCert(IEnrollProfile.REQUEST_ISSUED_CERT);
String auditInfoCertValue = auditInfoCertValue(x509cert);

if (auditInfoCertValue != null) {
if (!(auditInfoCertValue.equals(
Expand Down Expand Up @@ -896,18 +895,15 @@ private String auditRequesterID(IRequest request) {
* "X509CertImpl" for a signed audit log message.
* <P>
*
* @param request request containing an X509CertImpl
* @param x509cert an X509CertImpl
* @return cert string containing the certificate
*/
private String auditInfoCertValue(IRequest request) {
private String auditInfoCertValue(X509CertImpl x509cert) {
// if no signed audit object exists, bail
if (mSignedAuditLogger == null) {
return null;
}

X509CertImpl x509cert = request.getExtDataInCert(
IEnrollProfile.REQUEST_ISSUED_CERT);

if (x509cert == null) {
return ILogger.SIGNED_AUDIT_EMPTY_VALUE;
}
Expand Down

0 comments on commit e74fca2

Please sign in to comment.