diff --git a/jdk/src/java.base/share/conf/security/java.policy b/jdk/src/java.base/share/conf/security/java.policy index b9485d80e97..aef0017be48 100644 --- a/jdk/src/java.base/share/conf/security/java.policy +++ b/jdk/src/java.base/share/conf/security/java.policy @@ -46,6 +46,7 @@ grant codeBase "jrt:/jdk.crypto.ec" { grant codeBase "jrt:/jdk.crypto.pkcs11" { permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*"; + permission java.lang.RuntimePermission "accessClassInPackage.sun.misc"; permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch"; permission java.lang.RuntimePermission "loadLibrary.j2pkcs11"; // needs "security.pkcs11.allowSingleThreadedModules" diff --git a/jdk/test/java/security/Provider/DefaultPKCS11.java b/jdk/test/java/security/Provider/DefaultPKCS11.java index 46b82dd35bd..a7f4c871c53 100644 --- a/jdk/test/java/security/Provider/DefaultPKCS11.java +++ b/jdk/test/java/security/Provider/DefaultPKCS11.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, 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 @@ -23,9 +23,10 @@ /** * @test - * @bug 6260888 + * @bug 6260888 8087157 * @summary check SunPKCS11-Solaris is available on S10+ systems * @author Andreas Sterbenz + * @run main/othervm DefaultPKCS11 */ import java.util.*; @@ -35,6 +36,8 @@ import java.security.*; public class DefaultPKCS11 { public static void main(String[] args) throws Exception { + System.setSecurityManager(new SecurityManager()); + String osName = System.getProperty("os.name", "(null)"); String osVersion = System.getProperty("os.version", "(null)"); System.out.println("Running on " + osName + " " + osVersion);