From cc70a502050587351b9b60a79d63877c92bc10cc Mon Sep 17 00:00:00 2001
From: Goetz Lindenmaier <goetz@openjdk.org>
Date: Mon, 11 Nov 2024 09:04:20 +0000
Subject: [PATCH] 8333317: Test
 sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java failed with: Invalid
 ECDH ServerKeyExchange signature

Backport-of: d7c85b194dcb2c312afe18e62a87b1708d4f14bb
---
 test/jdk/sun/security/pkcs11/PKCS11Test.java           |  2 +-
 .../security/pkcs11/Signature/TestDSAKeyLength.java    | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java
index ca4a74e1825..046e5558486 100644
--- a/test/jdk/sun/security/pkcs11/PKCS11Test.java
+++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java
@@ -77,7 +77,7 @@ public abstract class PKCS11Test {
 
     // Version of the NSS artifact. This coincides with the version of
     // the NSS version
-    private static final String NSS_BUNDLE_VERSION = "3.96";
+    private static final String NSS_BUNDLE_VERSION = "3.101";
     private static final String NSSLIB = "jpg.tests.jdk.nsslib";
 
     static double nss_version = -1;
diff --git a/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java b/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java
index a2d7f67fa32..b2ab96c90c6 100644
--- a/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java
+++ b/test/jdk/sun/security/pkcs11/Signature/TestDSAKeyLength.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, 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
@@ -48,8 +48,12 @@ public class TestDSAKeyLength extends PKCS11Test {
 
     @Override
     protected boolean skipTest(Provider provider) {
-        if (isNSS(provider) && (getNSSVersion() == 0.0 || getNSSVersion() >= 3.14)) {
-            System.out.println("Skip testing NSS " + getNSSVersion());
+        double version = getNSSVersion();
+        String[] versionStrs = Double.toString(version).split("\\.");
+        int major = Integer.parseInt(versionStrs[0]);
+        int minor = Integer.parseInt(versionStrs[1]);
+        if (isNSS(provider) && (version == 0.0 || (major >= 3 && minor >= 14))) {
+            System.out.println("Skip testing NSS " + version);
             return true;
         }
 
-- 
GitLab