Blob Blame History Raw
From 47fccfaa32bf327c56c5789f373e4d18c714556f Mon Sep 17 00:00:00 2001
From: Jack Magne <jmagne@redhat.com>
Date: Fri, 10 Nov 2017 15:55:36 -0800
Subject: [PATCH] ReFix for  #2824 TPS new configuration to allow the protocol
 of the to determine applet loaded.

The problem discovered was that in only the external registration case, there was a problem obtaining the protocol
information for the token being enrolled. This simple fix makes sure the protocol info is obtained correctly for external
reg and non external reg enrollment cases.

Change-Id: Iccd40adbdafd5e94e04cbb8c391bd2706e483a1f
(cherry picked from commit e48374cd8a744fad5a03f64e8685ec3b3c465553)
(cherry picked from commit 3718b369598c3ecfdb6733c25b08e4b51042423f)
---
 .../src/org/dogtagpki/server/tps/processor/TPSProcessor.java   | 10 ++++++----
 1 file changed, 6 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 4ec277e..03d6532 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
@@ -33,8 +33,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import netscape.security.x509.RevocationReason;
-
 import org.dogtagpki.server.tps.TPSSession;
 import org.dogtagpki.server.tps.TPSSubsystem;
 import org.dogtagpki.server.tps.authentication.AuthUIParameter;
@@ -102,6 +100,8 @@ import com.netscape.cms.servlet.tks.SecureChannelProtocol;
 import com.netscape.cmsutil.crypto.CryptoUtil;
 import com.netscape.symkey.SessionKey;
 
+import netscape.security.x509.RevocationReason;
+
 public class TPSProcessor {
 
     public static final int RESULT_NO_ERROR = 0;
@@ -556,8 +556,10 @@ public class TPSProcessor {
             CMS.debug("TPSProcessor.setupSecureChannel: obtained randomData");
         }
 
-        // We already do this when checking for applet upgrade earlier.
-        //acquireChannelPlatformAndProtocolInfo();
+        // Do this on behalf of external reg, which needs it
+        // If already called, the routine will return anyway.
+
+        acquireChannelPlatformAndProtocolInfo();
 
         TPSBuffer initUpdateResp = initializeUpdate(keyVersion, keyIndex, randomData);
 
-- 
1.8.3.1