8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: ServicesDefaultValues.java,v 1.38 2009/01/28 05:35:02 ww203982 Exp $
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott * Portions Copyrighted 2013-2016 ForgeRock AS.
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshottimport org.forgerock.openam.utils.ValidateIPaddress;
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshottimport com.iplanet.am.util.SecureRandomManager;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.iplanet.am.util.SystemProperties;
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshottimport com.sun.identity.shared.encode.Base64;
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonimport com.sun.identity.shared.xml.XMLUtils;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This class holds the default values of service schema.
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott public static final String RANDOM_SECURE = "@128_BIT_RANDOM_SECURE@";
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static ServicesDefaultValues instance = new ServicesDefaultValues();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static Set preappendSlash = new HashSet();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_PRODUCT_NAME);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_OLD_CONSOLE_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_CONSOLE_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster preappendSlash.add(SetupConstants.CONFIG_VAR_SERVER_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster trimSlash.add(SetupConstants.CONFIG_VAR_CONSOLE_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster trimSlash.add(SetupConstants.CONFIG_VAR_SERVER_URI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResourceBundle bundle = ResourceBundle.getBundle(
0be6372051459d02acfe49de71e8d6653f0b412eAlin Brici "serviceDefaultValues");
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott secureRandom = SecureRandomManager.getSecureRandom();
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott throw new IllegalStateException("Failed to initialise secure random");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This method validates the form fields and populates the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * map with valid values.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param request is the Servlet Request.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_BASE_DIR, base);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.encryptkey",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // this set the encryption password for crypt class.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // otherwises password in serverconfig.xml will be incorrect
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SystemProperties.initializeProperties("am.encryption.pwd", ekey);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.invalidhostname",
0be6372051459d02acfe49de71e8d6653f0b412eAlin Brici throw new ConfiguratorException("configurator.invalidcookiedomain",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String dbOption = (String)map.get(SetupConstants.CONFIG_VAR_DATA_STORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean embedded = dbOption.equals(SetupConstants.SMS_EMBED_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster AMSetupDSConfig dsConfig = AMSetupDSConfig.getInstance();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_SSL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean ssl = (sslEnabled != null) && sslEnabled.equals("SSL");
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "configurator.dsconnnectfailure", null, locale);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington SetupConstants.CONFIG_VAR_ROOT_SUFFIX))) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.invalidsuffix",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.DIT_LOADED, dsConfig.isDITLoaded(ssl));
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste // Enable data store notifications and switch persistent search on for sms.
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste // This is now done by default for embedded data stores as well as external
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste // to ensure consistent behaviour for refreshing data store cache.
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste map.put(SetupConstants.DATASTORE_NOTIFICATION, "true");
441eb21527d5501b2edf4dcd91b9756f8a784d0bJaco Jooste map.put(SetupConstants.DISABLE_PERSISTENT_SEARCH, "aci,um");
4e8a549dc885858e1d99b551f4964753e68d3046Mark de Reeper Map userRepo = (Map)map.get(SetupConstants.USER_STORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean bUseExtUMDS = (userRepo != null) && !userRepo.isEmpty();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String s = (String) userRepo.get(SetupConstants.USER_STORE_SSL);
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace final String isSecure = ((s != null) && s.equals("SSL")) ? "true" : "false";
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace map.put(SetupConstants.LDAP_CONNECTION_MODE_TAG, SetupConstants.LDAP_CONNECTION_MODE_LDAPS);
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace map.put(SetupConstants.LDAP_CONNECTION_MODE_TAG, SetupConstants.LDAP_CONNECTION_MODE_LDAP);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.get(SetupConstants.CONFIG_VAR_DS_MGR_PWD));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.get(SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_HOST));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.get(SetupConstants.CONFIG_VAR_DIRECTORY_SERVER_PORT));
597f05fe6c5f9c5b48ee85ea72f7af5cfc8ae83eSachiko Wallace map.put(SetupConstants.LDAP_CONNECTION_MODE_TAG, SetupConstants.LDAP_CONNECTION_MODE_LDAP);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington String normalizedDN = DN.valueOf(umRootSuffix).toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String escapedDN = SMSSchema.escapeSpecialCharacters(normalizedDN);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.UM_NORMALIZED_ORGBASE, escapedDN);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Set the platform locale.
0be6372051459d02acfe49de71e8d6653f0b412eAlin Brici map.put(SetupConstants.CONFIG_VAR_PLATFORM_LOCALE,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates serverURL.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if service URL is valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String hostURL = (String)map.get(SetupConstants.CONFIG_VAR_SERVER_URL);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean valid = (hostURL != null) && (hostURL.length() > 0);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_HOST, hostName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_PROTO, protocol);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_PORT, port);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid: localhost (no period)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid: abc.sun.com (two periods)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param hostname is the user specified host name.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if syntax for host is correct.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static boolean isHostnameValid(String hostname) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean valid = (hostname != null) && (hostname.length() > 0);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((idx != -1) && (idx != (hostname.length() -1))) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates if cookie Domain is syntactically correct.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param cookieDomain is the user specified cookie domain.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if syntax for cookie domain is correct.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static boolean isCookieDomainValid(String cookieDomain) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean valid = (cookieDomain == null) || (cookieDomain.length() == 0);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // need to have a period and cannot be the last char.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster valid = (idx1 == -1) || (idx1 != (cookieDomain.length() -1));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster int idx2 = cookieDomain.lastIndexOf(".", idx1-1);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * need to be have a period before the last one e.g.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * .sun.com and cannot be ..com
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the cookie Domain based on the hostname.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param cookieDomain is the user specified cookie domain.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param hostname is the host for which the cookie domain is set.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return cookieDomain containing the valid cookie domain for
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the specified hostname.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if ((idx == -1) || (idx == (hostname.length() -1)) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if ((cookieDomain == null) || (cookieDomain.length() == 0)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // try to determine the cookie domain if it is not set
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String topLevelDomain = hostname.substring(idx+1);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates the encryption key.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if ecryption key is valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static boolean isEncryptionKeyValid() {
cfba646ddfa9d543f0c40e4c7788c65b4a24b34dPhill Cunnington ekey = AMSetupUtils.getRandomString().trim();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_ENCRYPTION_KEY, ekey);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster // in future release need to check if length of greater from 10.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return ((ekey != null) && (ekey.length() > 0)) ? true : false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Validates Admin passwords.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static void validatePassword(Locale locale) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_CONFIRM_ADMIN_PWD)).trim();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if (isPasswordValid(adminPwd, confirmAdminPwd, locale)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.ENC_PWD_PROPERTY, (((String) map.get(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_ENCRYPTION_KEY)).trim()));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.HASH_ADMIN_PWD, (String)Hash.hash(adminPwd));
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String urlAccessAgentPwdConfirm = ((String)map.get(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster SetupConstants.CONFIG_VAR_AMLDAPUSERPASSWD_CONFIRM)).trim();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster validateURLAccessAgentPassword(adminPwd, urlAccessAgentPwd,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.remove(SetupConstants.CONFIG_VAR_AMLDAPUSERPASSWD_CONFIRM);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String dbOption = (String)map.get(SetupConstants.CONFIG_VAR_DATA_STORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dbOption.equals(SetupConstants.SMS_EMBED_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean dbSunDS = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster boolean dbMsAD = false;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else { // Keep old behavior for now.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dbSunDS = dbOption.equals(SetupConstants.SMS_DS_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster dbMsAD = dbOption.equals(SetupConstants.SMS_AD_DATASTORE);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_DS_MGR_PWD, adminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String ldapUserPwd = (String)map.get(SetupConstants.LDAP_USER_PWD);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String encryptAdminPwd = Crypt.encrypt(adminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.ENCRYPTED_ADMIN_PWD, encryptAdminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.ENCRYPTED_AD_ADMIN_PWD, encryptAdminPwd);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.remove(SetupConstants.CONFIG_VAR_CONFIRM_ADMIN_PWD);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid: password greater than 8 characters
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * valid: password and confirm passwords match
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param pwd is the Admin password.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param cPwd is the confirm Admin password.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param locale Locale of the HTTP Request.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return <code>true</code> if password is valid.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.nopasswdmatch",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.passwdlength",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private static boolean validateURLAccessAgentPassword(
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "configurator.urlaccessagent.passwd.nomatch", null, locale);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "configurator.urlaccessagent.passwd.match.amadmin.pwd",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster throw new ConfiguratorException("configurator.passwdlength",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster return true;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the map of default attribute name to its value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the map of default attribute name to its value.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Set the deploy URI.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param deployURI Deploy URI.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param map Service attribute values.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static void setDeployURI(String deployURI, Map map) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_PRODUCT_NAME, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_OLD_CONSOLE_URI, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_CONSOLE_URI, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster map.put(SetupConstants.CONFIG_VAR_SERVER_URI, deployURI);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param orig String to be tag swapped.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Returns the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param orig String to be tag swapped.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @param bXML <code>true</code> if it is an XML file. and value
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * needs to be escaped.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * @return the tag swapped string.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public static String tagSwap(String orig, boolean bXML) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster value = XMLUtils.escapeSpecialCharacters(value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orig = orig.replaceAll("/@" + key + "@", value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster } else if (key.equals(SetupConstants.CONFIG_VAR_ROOT_SUFFIX)) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster String normalized = DNUtils.normalizeDN(value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster tmp = (bXML) ? XMLUtils.escapeSpecialCharacters(tmp) :
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "@" + SetupConstants.SM_ROOT_SUFFIX_HAT + "@", tmp);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington String rfced = DN.valueOf(value).toString();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster tmp = (bXML) ? XMLUtils.escapeSpecialCharacters(rfced) :
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster "@" + SetupConstants.CONFIG_VAR_ROOT_SUFFIX + "@",
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster key.equals(SetupConstants.SM_ROOT_SUFFIX_HAT) ||
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster key.equals(SetupConstants.NORMALIZED_ORG_BASE) ||
9fa57a4f31580310b62bb2f08906e6b73d510817jeff.schenk key.equals(SetupConstants.SM_ROOT_SUFFIX_HAT) ||
9fa57a4f31580310b62bb2f08906e6b73d510817jeff.schenk key.equals(SetupConstants.CONFIG_VAR_SESSION_ROOT_SUFFIX) ||
9fa57a4f31580310b62bb2f08906e6b73d510817jeff.schenk key.equals(SetupConstants.CONFIG_VAR_SESSION_STORE_TYPE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orig = orig.replaceAll("@" + key + "@", value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster value = XMLUtils.escapeSpecialCharacters(value);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster orig = orig.replaceAll("@" + key + "@", value);
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott // Each Secure Random tag should be a newly generated random.
d78764efc954da87cd81023cc846a6a5af360d95Robert Wapshott byte[] bytes = new byte[16]; // 16 * 8 = 128 bits