8244281: test/jdk/com/sun/crypto/provider/KeyProtector/IterationCount.java fails with --illegal-access=deny

Weijun Wang weijun.wang at oracle.com
Sat May 2 14:49:01 UTC 2020


The change looks fine to me.

Thanks,
Max

> On May 2, 2020, at 10:30 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> 
> I need a reviewer for a small update to test/jdk/com/sun/crypto/provider/KeyProtector/IterationCount.java. The test accesses a private field in com.sun.crypto.provider from a VM launched by the test. The launched VM needs to be run with --add-open to open the package, otherwise the test will fail when illegal reflective access is denied by default.
> 
> -Alan.
> 
> diff -r 104385e30663 test/jdk/com/sun/crypto/provider/KeyProtector/IterationCount.java
> --- a/test/jdk/com/sun/crypto/provider/KeyProtector/IterationCount.java Sat May 02 09:00:04 2020 +0530
> +++ b/test/jdk/com/sun/crypto/provider/KeyProtector/IterationCount.java Sat May 02 15:26:58 2020 +0100
> @@ -88,6 +88,7 @@
> 
>      private static void executeCommand(List<String> cmd, String expectedCount)
>              throws Throwable {
> + cmd.add("--add-opens=java.base/com.sun.crypto.provider=ALL-UNNAMED");
>          cmd.add(IterationCount.class.getName());
>          cmd.add(clientStr);
>          cmd.add(expectedCount);




More information about the security-dev mailing list