>From 0a97324178c8c6353e20dfe35e78699a44e89fd5 Mon Sep 17 00:00:00 2001
From: Christina Fu <cfu@redhat.com>
Date: Wed, 26 Aug 2015 09:17:55 -0700
Subject: [PATCH] Ticket 1307 - CUID range issue for [RFE] Support multiple
 keySets for different cards for ExternalReg The patch fixes an issue that the
 CUID comes in from the client has a different format than that of the config
 cuid range strings.  With the right conversion, the cuid range would then be
 evaluated correctly.  The issue may only be discovered with certain cuid
 data, as it was not reproduceable in the dev environment.

---
 .../src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java    | 4 ++--
 .../src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java  | 2 +-
 base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java
index 185430f195990ed2f01e8d334d16e00437a950ca..3045b5844523acdec8e8214280c5063ce7e9c891 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java
@@ -239,7 +239,7 @@ public class TPSEnrollProcessor extends TPSProcessor {
 
                 if (!resolverInstName.equals("none") && (selectedKeySet == null)) {
                     FilterMappingParams mappingParams = createFilterMappingParams(resolverInstName,
-                            appletInfo.getCUIDhexString(), appletInfo.getMSNString(),
+                            appletInfo.getCUIDhexStringPlain(), appletInfo.getMSNString(),
                             appletInfo.getMajorVersion(), appletInfo.getMinorVersion());
                     TPSSubsystem subsystem =
                             (TPSSubsystem) CMS.getSubsystem(TPSSubsystem.ID);
@@ -267,7 +267,7 @@ public class TPSEnrollProcessor extends TPSProcessor {
 
                 if (!resolverInstName.equals("none") && (selectedTokenType == null)) {
                     FilterMappingParams mappingParams = createFilterMappingParams(resolverInstName,
-                            appletInfo.getCUIDhexString(), appletInfo.getMSNString(),
+                            appletInfo.getCUIDhexStringPlain(), appletInfo.getMSNString(),
                             appletInfo.getMajorVersion(), appletInfo.getMinorVersion());
                     TPSSubsystem subsystem =
                             (TPSSubsystem) CMS.getSubsystem(TPSSubsystem.ID);
diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java
index 3a6c0df48fec9dc89a34f5733bead7b40204238c..da2cab4d7f9f415ed1317eaff03a46f2854c7523 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java
@@ -110,7 +110,7 @@ public class TPSPinResetProcessor extends TPSProcessor {
 
             if (!resolverInstName.equals("none") && (selectedTokenType == null)) {
                 FilterMappingParams mappingParams = createFilterMappingParams(resolverInstName,
-                        appletInfo.getCUIDhexString(), appletInfo.getMSNString(),
+                        appletInfo.getCUIDhexStringPlain(), appletInfo.getMSNString(),
                         appletInfo.getMajorVersion(), appletInfo.getMinorVersion());
                 TPSSubsystem subsystem =
                         (TPSSubsystem) CMS.getSubsystem(TPSSubsystem.ID);
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 637cfa394fcc865475d27bc2ab410f0e68f0c38c..4a4f05c50af803c469f952486a4c265d36dde230 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
@@ -1866,7 +1866,7 @@ public class TPSProcessor {
 
                 if (!resolverInstName.equals("none") && (selectedKeySet == null)) {
                     FilterMappingParams mappingParams = createFilterMappingParams(resolverInstName,
-                            appletInfo.getCUIDhexString(), appletInfo.getMSNString(),
+                            appletInfo.getCUIDhexStringPlain(), appletInfo.getMSNString(),
                             appletInfo.getMajorVersion(), appletInfo.getMinorVersion());
                     TPSSubsystem subsystem =
                             (TPSSubsystem) CMS.getSubsystem(TPSSubsystem.ID);
@@ -1894,7 +1894,7 @@ public class TPSProcessor {
                 String resolverInstName = getResolverInstanceName();
 
                 if (!resolverInstName.equals("none") && (selectedKeySet == null)) {
-                    FilterMappingParams mappingParams  = createFilterMappingParams(resolverInstName, cuid, msn, major_version, minor_version);
+                    FilterMappingParams mappingParams  = createFilterMappingParams(resolverInstName, appletInfo.getCUIDhexStringPlain(), msn, major_version, minor_version);
 
                     TPSSubsystem subsystem =
                             (TPSSubsystem) CMS.getSubsystem(TPSSubsystem.ID);
-- 
1.8.4.2

