Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- JDK 11
- JDK 17
- JDK 21
- JDK Latest
- JDK 25
include:
- jdkconf: JDK 8
jdkver: "8"
Expand All @@ -30,7 +30,7 @@ jobs:
jdkver: "17"
- jdkconf: JDK 21
jdkver: "21"
- jdkconf: JDK Latest
- jdkconf: JDK 25
jdkver: "25"
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -58,13 +58,16 @@ jobs:
- JDK 11
- JDK 17
- JDK 21
- JDK 25
include:
- jdkconf: JDK 11
jdkver: "11"
- jdkconf: JDK 17
jdkver: "17"
- jdkconf: JDK 21
jdkver: "21"
- jdkconf: JDK 25
jdkver: "25"
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand Down Expand Up @@ -95,6 +98,7 @@ jobs:
- JDK 11
- JDK 17
- JDK 21
- JDK 25
include:
- jdkconf: JDK 8
jdkver: "8"
Expand All @@ -104,6 +108,8 @@ jobs:
jdkver: "17"
- jdkconf: JDK 21
jdkver: "21"
- jdkconf: JDK 25
jdkver: "25"
steps:
- uses: actions/checkout@v3
- name: Set up Cygwin
Expand Down Expand Up @@ -141,6 +147,7 @@ jobs:
- JDK 11
- JDK 17
- JDK 21
- JDK 25
include:
- jdkconf: JDK 8
jdkver: "8"
Expand All @@ -150,6 +157,8 @@ jobs:
jdkver: "17"
- jdkconf: JDK 21
jdkver: "21"
- jdkconf: JDK 25
jdkver: "25"
steps:
- uses: actions/checkout@v3
- name: Set up JDK
Expand Down
48 changes: 48 additions & 0 deletions test/reproducers/OPENJDK-4545/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* @test
@bug 6664545
@summary nssadapter should not use a single PKCS #11 session for multi-thread operations
@requires jdk.version.major > 20 & var.msys2.enabled == "false"

@run shell Main.sh
*/
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public final class Main {
private static final int PARALLELISM = 10;
private static final String ALGORITHM = "AES";
private static final SecretKeySpec KEY_SPEC = new SecretKeySpec(
"12345678901234567890123456789012".getBytes(), ALGORITHM);

private static void importSecretKey() {
try {
Cipher c = Cipher.getInstance(ALGORITHM);
c.init(Cipher.ENCRYPT_MODE, KEY_SPEC);
} catch (Throwable t) {
t.printStackTrace();
System.exit(1);
}
}

private static void exportSecretKey() {
try {
KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM);
kg.generateKey().getEncoded();
} catch (Throwable t) {
t.printStackTrace();
System.exit(1);
}
}

public static void main(String[] args) {
try (ExecutorService pool = Executors.newFixedThreadPool(PARALLELISM)) {
for (int t = 0; t < PARALLELISM * 100; t++) {
pool.submit(Main::importSecretKey);
pool.submit(Main::exportSecretKey);
}
}
}
}
14 changes: 14 additions & 0 deletions test/reproducers/OPENJDK-4545/Main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set -exu
echo $PWD
ls

FS="/"
JAVAC=${TESTJAVA}${FS}bin${FS}javac
JAVA=${TESTJAVA}${FS}bin${FS}java

$JAVAC -d . $TESTSRC/Main.java
for x in `seq 10` ; do
$JAVA Main
done


Loading