8043277: Update jdk regression tests to extend the default security policy instead of override

Reviewed-by: alanb, mullan, chegar, sla
This commit is contained in:
Mandy Chung 2014-10-27 13:45:39 -07:00
parent 1457a8cc93
commit a76f56165c
24 changed files with 17 additions and 307 deletions

View File

@ -12,3 +12,6 @@ exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote su
# Group definitions
groups=TEST.groups [closed/TEST.groups]
# Tests using jtreg 4.1 b10 features
requiredVersion=4.1 b10

View File

@ -29,11 +29,11 @@ import java.net.URLPermission;
* @bug 8010464
* @library /lib/testlibrary/
* @build jdk.testlibrary.SimpleSSLContext
* @run main/othervm/policy=policy.1 URLTest one
* @run main/othervm/java.security.policy=policy.1 URLTest one
* @run main/othervm URLTest one
* @run main/othervm/policy=policy.2 URLTest two
* @run main/othervm/java.security.policy=policy.2 URLTest two
* @run main/othervm URLTest two
* @run main/othervm/policy=policy.3 URLTest three
* @run main/othervm/java.security.policy=policy.3 URLTest three
* @run main/othervm URLTest three
*/

View File

@ -37,60 +37,3 @@ grant {
permission "java.util.PropertyPermission" "test.src.path", "read";
};
// Normal permissions that aren't granted when run under jtreg
grant codeBase "file:${java.home}/lib/ext/ucrypto.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2ucrypto";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.OracleUcrypto";
permission java.security.SecurityPermission "clearProviderProperties.OracleUcrypto";
permission java.security.SecurityPermission "removeProviderProperty.OracleUcrypto";
permission java.io.FilePermission "${java.home}/lib/security/ucrypto-solaris.cfg", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunec.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunec";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunEC";
permission java.security.SecurityPermission "clearProviderProperties.SunEC";
permission java.security.SecurityPermission "removeProviderProperty.SunEC";
};
grant codeBase "file:${java.home}/lib/ext/sunjce_provider.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunJCE";
permission java.security.SecurityPermission "clearProviderProperties.SunJCE";
permission java.security.SecurityPermission "removeProviderProperty.SunJCE";
};
grant codeBase "file:${java.home}/lib/ext/sunpkcs11.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2pkcs11";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.*";
permission java.security.SecurityPermission "clearProviderProperties.*";
permission java.security.SecurityPermission "removeProviderProperty.*";
permission java.security.SecurityPermission "getProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.*";
// Needed for reading PKCS11 config file and NSS library check
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunmscapi.jar" {
Permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunmscapi";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunMSCAPI";
permission java.security.SecurityPermission "clearProviderProperties.SunMSCAPI";
permission java.security.SecurityPermission "removeProviderProperty.SunMSCAPI";
};
grant codeBase "file:${{java.home}}/jre/lib/rt.jar" {
permission java.security.AllPermission;
};

View File

@ -37,60 +37,3 @@ grant {
permission "java.util.PropertyPermission" "test.src.path", "read";
};
// Normal permissions that aren't granted when run under jtreg
grant codeBase "file:${java.home}/lib/ext/ucrypto.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2ucrypto";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.OracleUcrypto";
permission java.security.SecurityPermission "clearProviderProperties.OracleUcrypto";
permission java.security.SecurityPermission "removeProviderProperty.OracleUcrypto";
permission java.io.FilePermission "${java.home}/lib/security/ucrypto-solaris.cfg", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunec.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunec";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunEC";
permission java.security.SecurityPermission "clearProviderProperties.SunEC";
permission java.security.SecurityPermission "removeProviderProperty.SunEC";
};
grant codeBase "file:${java.home}/lib/ext/sunjce_provider.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunJCE";
permission java.security.SecurityPermission "clearProviderProperties.SunJCE";
permission java.security.SecurityPermission "removeProviderProperty.SunJCE";
};
grant codeBase "file:${java.home}/lib/ext/sunpkcs11.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2pkcs11";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.*";
permission java.security.SecurityPermission "clearProviderProperties.*";
permission java.security.SecurityPermission "removeProviderProperty.*";
permission java.security.SecurityPermission "getProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.*";
// Needed for reading PKCS11 config file and NSS library check
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunmscapi.jar" {
Permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunmscapi";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunMSCAPI";
permission java.security.SecurityPermission "clearProviderProperties.SunMSCAPI";
permission java.security.SecurityPermission "removeProviderProperty.SunMSCAPI";
};
grant codeBase "file:///export/repos/jdk8/build/linux-x86_64-normal-server-fastdebug/images/j2sdk-image/jre/lib/rt.jar" {
permission java.security.AllPermission;
};

View File

@ -36,61 +36,3 @@ grant {
permission "java.lang.RuntimePermission" "setFactory";
permission "java.util.PropertyPermission" "test.src.path", "read";
};
// Normal permissions that aren't granted when run under jtreg
grant codeBase "file:${java.home}/lib/ext/ucrypto.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2ucrypto";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.OracleUcrypto";
permission java.security.SecurityPermission "clearProviderProperties.OracleUcrypto";
permission java.security.SecurityPermission "removeProviderProperty.OracleUcrypto";
permission java.io.FilePermission "${java.home}/lib/security/ucrypto-solaris.cfg", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunec.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunec";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunEC";
permission java.security.SecurityPermission "clearProviderProperties.SunEC";
permission java.security.SecurityPermission "removeProviderProperty.SunEC";
};
grant codeBase "file:${java.home}/lib/ext/sunjce_provider.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunJCE";
permission java.security.SecurityPermission "clearProviderProperties.SunJCE";
permission java.security.SecurityPermission "removeProviderProperty.SunJCE";
};
grant codeBase "file:${java.home}/lib/ext/sunpkcs11.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2pkcs11";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.*";
permission java.security.SecurityPermission "clearProviderProperties.*";
permission java.security.SecurityPermission "removeProviderProperty.*";
permission java.security.SecurityPermission "getProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.*";
// Needed for reading PKCS11 config file and NSS library check
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunmscapi.jar" {
Permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunmscapi";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunMSCAPI";
permission java.security.SecurityPermission "clearProviderProperties.SunMSCAPI";
permission java.security.SecurityPermission "removeProviderProperty.SunMSCAPI";
};
grant codeBase "file:${{java.home}}/jre/lib/rt.jar" {
permission java.security.AllPermission;
};

View File

@ -33,7 +33,7 @@
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
* ActivateMe ActivateFails_Stub ShutdownThread
* @run main/othervm/policy=security.policy/timeout=240 ActivateFails
* @run main/othervm/java.security.policy=security.policy/timeout=240 ActivateFails
*/
import java.rmi.*;

View File

@ -2,10 +2,6 @@
* security policy used by the test process
*/
grant codeBase "file:${java.home}/lib/ext/*" {
permission java.security.AllPermission;
};
grant {
// standard test activation permissions
permission java.io.FilePermission "..${/}..${/}test.props", "read";

View File

@ -29,7 +29,7 @@
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
* CanCreateStubs StubClassesPermitted_Stub
* @run main/othervm/policy=security.policy/secure=java.lang.SecurityManager/timeout=240 StubClassesPermitted
* @run main/othervm/java.security.policy=security.policy/secure=java.lang.SecurityManager/timeout=240 StubClassesPermitted
*/
import java.io.*;

View File

@ -2,10 +2,6 @@
* security policy used by the test process
*/
grant codeBase "file:${java.home}/lib/ext/*" {
permission java.security.AllPermission;
};
grant {
// standard test activation permissions
permission java.io.FilePermission "..${/}..${/}test.props", "read";

View File

@ -26,7 +26,7 @@
* @bug 4532506 4999599
* @summary Serializing KeyPair on one VM (Sun),
* and Deserializing on another (IBM) fails
* @run main/othervm/policy=Serial.policy Serial
* @run main/othervm/java.security.policy=Serial.policy Serial
*/
import java.io.*;

View File

@ -1,12 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/sunjce_provider.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunJCE";
permission java.security.SecurityPermission "clearProviderProperties.SunJCE";
permission java.security.SecurityPermission "removeProviderProperty.SunJCE";
};
grant {
// XXX note package access is *not* granted to the 'sun' package
};

View File

@ -26,7 +26,7 @@
* @bug 6232513
* @summary RMI interoperability issue with DSAPublicKey obj between
* JDK1.4 & JDK1.5
* @run main/othervm/policy=SerialDSAPubKey.policy -Dsun.security.key.serial.interop=true -Dsun.security.pkcs11.enable-solaris=false SerialDSAPubKey
* @run main/othervm/java.security.policy=SerialDSAPubKey.policy -Dsun.security.key.serial.interop=true -Dsun.security.pkcs11.enable-solaris=false SerialDSAPubKey
*/
import java.io.*;

View File

@ -26,7 +26,7 @@
* @bug 4532506
* @summary Serializing KeyPair on one VM (Sun),
* and Deserializing on another (IBM) fails
* @run main/othervm/policy=SerialOld.policy SerialOld
* @run main/othervm/java.security.policy=SerialOld.policy SerialOld
*/
import java.io.*;

View File

@ -1,55 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/ucrypto.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2ucrypto";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.OracleUcrypto";
permission java.security.SecurityPermission "clearProviderProperties.OracleUcrypto";
permission java.security.SecurityPermission "removeProviderProperty.OracleUcrypto";
permission java.io.FilePermission "${java.home}/lib/security/ucrypto-solaris.cfg", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunec.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunec";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunEC";
permission java.security.SecurityPermission "clearProviderProperties.SunEC";
permission java.security.SecurityPermission "removeProviderProperty.SunEC";
};
grant codeBase "file:${java.home}/lib/ext/sunjce_provider.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunJCE";
permission java.security.SecurityPermission "clearProviderProperties.SunJCE";
permission java.security.SecurityPermission "removeProviderProperty.SunJCE";
};
grant codeBase "file:${java.home}/lib/ext/sunpkcs11.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2pkcs11";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.*";
permission java.security.SecurityPermission "clearProviderProperties.*";
permission java.security.SecurityPermission "removeProviderProperty.*";
permission java.security.SecurityPermission "getProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.*";
// Needed for reading PKCS11 config file and NSS library check
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
grant codeBase "file:${java.home}/lib/ext/sunmscapi.jar" {
Permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "loadLibrary.sunmscapi";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunMSCAPI";
permission java.security.SecurityPermission "clearProviderProperties.SunMSCAPI";
permission java.security.SecurityPermission "removeProviderProperty.SunMSCAPI";
};
grant {
permission java.io.FilePermission "${test.src}${file.separator}*", "read";

View File

@ -25,7 +25,7 @@
* @test
* @bug 4420687
* @summary Make sure that a removed provider won't be acceessable.
* @run main/othervm/policy=RemoveStaticProvider.policy RemoveStaticProvider
* @run main/othervm/java.security.policy=RemoveStaticProvider.policy RemoveStaticProvider
*/
import java.security.*;
import javax.crypto.*;

View File

@ -1,13 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/sunjce_provider.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.SunJCE";
permission java.security.SecurityPermission "clearProviderProperties.SunJCE";
permission java.security.SecurityPermission "removeProviderProperty.SunJCE";
};
grant {
permission java.security.SecurityPermission "removeProvider.SunJCE";
permission java.security.SecurityPermission "insertProvider.SunJCE";

View File

@ -35,7 +35,7 @@ import java.io.IOException;
* @summary Basic test for zip provider
*
* @run main Basic
* @run main/othervm/policy=test.policy Basic
* @run main/othervm/java.security.policy=test.policy Basic
*/
public class Basic {

View File

@ -33,7 +33,7 @@ import java.io.IOException;
* @summary Tests path operations for zip provider.
*
* @run main PathOps
* @run main/othervm/policy=test.policy.readonly PathOps
* @run main/othervm/java.security.policy=test.policy.readonly PathOps
*/
public class PathOps {

View File

@ -26,7 +26,7 @@
* @summary ZipFileSystem regression tests
*
* @run main ZFSTests
* @run main/othervm/policy=test.policy ZFSTests
* @run main/othervm/java.security.policy=test.policy ZFSTests
*/

View File

@ -43,7 +43,7 @@ import static java.nio.file.StandardCopyOption.*;
* 7157656 8002390 7012868 7012856 8015728 8038500 8040059
* @summary Test Zip filesystem provider
* @run main ZipFSTester
* @run main/othervm/policy=test.policy ZipFSTester
* @run main/othervm/java.security.policy=test.policy ZipFSTester
*/
public class ZipFSTester {

View File

@ -1,9 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/zipfs.jar" {
permission java.io.FilePermission "<<ALL FILES>>", "read,write";
permission java.lang.RuntimePermission "fileSystemProvider";
permission java.util.PropertyPermission "*", "read";
};
grant {
permission java.io.FilePermission "<<ALL FILES>>","read,write,delete";
permission java.util.PropertyPermission "test.jdk","read";

View File

@ -1,9 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/zipfs.jar" {
permission java.io.FilePermission "<<ALL FILES>>", "read,write";
permission java.lang.RuntimePermission "fileSystemProvider";
permission java.util.PropertyPermission "*", "read";
};
grant {
permission java.io.FilePermission "<<ALL FILES>>","read";
permission java.util.PropertyPermission "test.jdk","read";

View File

@ -1,17 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/sunpkcs11.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2pkcs11";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.*";
permission java.security.SecurityPermission "clearProviderProperties.*";
permission java.security.SecurityPermission "removeProviderProperty.*";
permission java.security.SecurityPermission "getProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.*";
// Needed for reading PKCS11 config file and NSS library check
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
grant codebase "file:${user.dir}${/}loader.jar" {
permission java.security.AllPermission;
};

View File

@ -1,18 +1,3 @@
grant codeBase "file:${java.home}/lib/ext/sunpkcs11.jar" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";
permission java.lang.RuntimePermission "loadLibrary.j2pkcs11";
permission java.util.PropertyPermission "*", "read";
permission java.security.SecurityPermission "putProviderProperty.*";
permission java.security.SecurityPermission "clearProviderProperties.*";
permission java.security.SecurityPermission "removeProviderProperty.*";
permission java.security.SecurityPermission "getProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.*";
// Needed for reading PKCS11 config file and NSS library check
permission java.io.FilePermission "<<ALL FILES>>", "read";
};
grant {
permission java.util.PropertyPermission "*", "read, write";
permission java.lang.RuntimePermission "loadLibrary.*";
@ -23,6 +8,5 @@ grant {
permission java.io.FilePermission "<<ALL FILES>>", "read";
permission java.security.SecurityPermission "setProperty.auth.login.defaultCallbackHandler";
permission java.security.SecurityPermission "authProvider.SunPKCS11-NSS"
;
permission java.security.SecurityPermission "authProvider.SunPKCS11-NSS";
};