diff options
-rw-r--r-- | pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java b/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java index 97dde1a31..246d9a478 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java +++ b/pki/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java @@ -173,6 +173,14 @@ public class CRSEnrollment extends HttpServlet mTokenName = scepConfig.getString("tokenname", ""); mUseCA = false; } + if (!(mTokenName.equalsIgnoreCase(Constants.PR_INTERNAL_TOKEN) || + mTokenName.equalsIgnoreCase("Internal Key Storage Token") || + mTokenName.length() == 0)) { + int i = mNickname.indexOf(':'); + if (!((i > -1) && (mTokenName.length() == i) && (mNickname.startsWith(mTokenName)))) { + mNickname = mTokenName + ":" + mNickname; + } + } } } catch (EBaseException e) { CMS.debug("CRSEnrollment: init: EBaseException: "+e); @@ -1979,10 +1987,7 @@ throws EBaseException { } else { keyStorageToken = cm.getTokenByName(mTokenName); internalKeyStorageToken = null; - mNickname = mTokenName + ":" + mNickname; - CMS.debug("CRSEnrollment: CryptoContext: token name: "+mTokenName+"'"); } - CMS.debug("CRSEnrollment: CryptoContext: mNickname: '"+mNickname+"'"); if (!mUseCA && internalKeyStorageToken == null) { PasswordCallback cb = CMS.getPasswordCallback(); keyStorageToken.login(cb); // ONE_TIME by default. |