diff --git a/src/share/classes/sun/security/pkcs11/Config.java b/src/share/classes/sun/security/pkcs11/Config.java index 243f49d0182d4e9c5674011af57104734be3fe9d..0a4eb27a101f7d0e161e478ba35361ac22722c34 100644 --- a/src/share/classes/sun/security/pkcs11/Config.java +++ b/src/share/classes/sun/security/pkcs11/Config.java @@ -343,6 +343,7 @@ final class Config { st.wordChars('{', '{'); // need {} for property subst st.wordChars('}', '}'); st.wordChars('*', '*'); + st.wordChars('+', '+'); st.wordChars('~', '~'); // XXX check ASCII table and add all other characters except special diff --git a/test/sun/security/pkcs11/Provider/ConfigShortPath.java b/test/sun/security/pkcs11/Provider/ConfigShortPath.java index daa1ab3c1bf6e4d969ee565b03a8049612044742..dbc58bbe1f10d637adb3b0ff3aa62de88e0e3c07 100644 --- a/test/sun/security/pkcs11/Provider/ConfigShortPath.java +++ b/test/sun/security/pkcs11/Provider/ConfigShortPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,8 +22,8 @@ */ /** * @test - * @bug 6581254 - * @summary Allow "~" in config to support windows short path + * @bug 6581254 6986789 + * @summary Allow '~' and '+' in config file * @author Valerie Peng */ @@ -32,17 +32,21 @@ import java.io.*; public class ConfigShortPath { + private static final String[] configNames = { "csp.cfg", "cspPlus.cfg" }; + public static void main(String[] args) { String testSrc = System.getProperty("test.src", "."); - String configFile = testSrc + File.separator + "csp.cfg"; - System.out.println("Testing against " + configFile); - try { - Provider p = new sun.security.pkcs11.SunPKCS11(configFile); - } catch (ProviderException pe) { - String cause = pe.getCause().getMessage(); - if (cause.indexOf("Unexpected token") != -1) { - // re-throw to indicate test failure - throw pe; + for (int i = 0; i < configNames.length; i++) { + String configFile = testSrc + File.separator + configNames[i]; + System.out.println("Testing against " + configFile); + try { + Provider p = new sun.security.pkcs11.SunPKCS11(configFile); + } catch (ProviderException pe) { + String cause = pe.getCause().getMessage(); + if (cause.indexOf("Unexpected token") != -1) { + // re-throw to indicate test failure + throw pe; + } } } } diff --git a/test/sun/security/pkcs11/Provider/cspPlus.cfg b/test/sun/security/pkcs11/Provider/cspPlus.cfg new file mode 100644 index 0000000000000000000000000000000000000000..51099cda9b882a537e36df9d110d434668fc4779 --- /dev/null +++ b/test/sun/security/pkcs11/Provider/cspPlus.cfg @@ -0,0 +1,4 @@ +showInfo = false +name = NSS +nssSecmodDirectory = /export/local/38289.JDK7.PIT.JSN-TL+7-b112_pit_security_oel5.5-x64-32/results/ResultDir/KeytoolNSS/db +nssLibraryDirectory = /export/local/common/testbase/7/security/tools/lib/nss/Linux2.6