summaryrefslogtreecommitdiffstats
path: root/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
diff options
context:
space:
mode:
authorChristina Fu <cfu@redhat.com>2016-05-17 17:57:11 -0700
committerChristina Fu <cfu@redhat.com>2016-05-18 10:18:48 -0700
commit5fe2ebbf66a5ebe0acc11ea7868db8a79b332ddb (patch)
treebda4b60c941995d9e65172c832e0aa323ea32e4b /base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
parent81c1d8fdd2c6e6248190cdeafe3ce032c8876e95 (diff)
downloadpki-5fe2ebbf66a5ebe0acc11ea7868db8a79b332ddb.tar.gz
pki-5fe2ebbf66a5ebe0acc11ea7868db8a79b332ddb.tar.xz
pki-5fe2ebbf66a5ebe0acc11ea7868db8a79b332ddb.zip
Ticket #1527 reopened: retrieved wrong ca connector config parameter
This ticket was reopened due to retrieving wrong ca connector config param for the case when format is done within an enrollment. The following is attempted: op.enroll.userKey.ca.conn while the following is intended: op.format.userKey.ca.conn In addition, this patch also fixes the following issues; a. reason param name is not conforming: "reason" instead of "revokeReason" b. adding default reason to format TPS profiles c. by default mappingResolver.formatProfileMappingResolver resolves to tokenKey, while enroll resolves to userKey. -> now changed the userKey d. if revocation fails during format, it was forgiving. -> now changed so that error is logged in activity log and exception thrown and bail out
Diffstat (limited to 'base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java')
-rw-r--r--base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
index bbc9fcb5e..5b471ca24 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
@@ -1376,7 +1376,7 @@ public class TPSProcessor {
".ca.conn";
CMS.debug(method + " finding config: " + config);
} else {
- config = "op." + currentTokenOperation + "." +
+ config = TPSEngine.OP_FORMAT_PREFIX + "." +
selectedTokenType +
".ca.conn";
CMS.debug(method + " finding config: " + config);
@@ -1424,7 +1424,9 @@ public class TPSProcessor {
String logMsg;
IConfigStore configStore = CMS.getConfigStore();
- String configName = TPSEngine.OP_FORMAT_PREFIX + "." + selectedTokenType + ".revokeCert.revokeReason";
+ String configName = TPSEngine.OP_FORMAT_PREFIX + "." + selectedTokenType + ".revokeCert.reason";
+ CMS.debug(method + " finding config: " + configName);
+
RevocationReason revokeReason = RevocationReason.UNSPECIFIED;
try {
int revokeReasonInt = configStore.getInteger(configName);
@@ -2137,7 +2139,19 @@ public class TPSProcessor {
revokeCertificates(tokenRecord.getId(), reason, caConnId);
} catch (TPSException te) {
// failed revocation; capture message and continue
- logMsg = te.getMessage();
+ String failMsg = "revoke certificates failure";
+ logMsg = failMsg + ":" + te.toString();
+ CMS.debug("TPSProcessor.format: " + logMsg);
+ tps.tdb.tdbActivity(ActivityDatabase.OP_FORMAT, tokenRecord, session.getIpAddress(), logMsg,
+ "failure");
+ throw new TPSException(logMsg, TPSStatus.STATUS_ERROR_CONTACT_ADMIN);
+ } catch (Exception ee) {
+ String failMsg = "revoke certificates failure";
+ logMsg = failMsg + ":" + ee.toString();
+ CMS.debug("TPSProcessor.format: " + logMsg);
+ tps.tdb.tdbActivity(ActivityDatabase.OP_FORMAT, tokenRecord, session.getIpAddress(), logMsg,
+ "failure");
+ throw new TPSException(logMsg, TPSStatus.STATUS_ERROR_CONTACT_ADMIN);
}
}
@@ -2160,7 +2174,7 @@ public class TPSProcessor {
tps.tdb.tdbActivity(ActivityDatabase.OP_FORMAT, tokenRecord, session.getIpAddress(), failMsg,
"failure");
- throw new TPSException(logMsg);
+ throw new TPSException(logMsg, TPSStatus.STATUS_ERROR_CONTACT_ADMIN);
}
logMsg = "format operation succeeded";