Skip to content

Commit 1b0310f

Browse files
authored
Merge pull request #313 from pshipton/p11-0.43
(0.43) Account for different NSS error code in s390x
2 parents 10c7d69 + 8cec1fb commit 1b0310f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/jdk/sun/security/pkcs11/ec/ReadCertificates.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
* questions.
2222
*/
2323

24+
/*
25+
* ===========================================================================
26+
* (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
27+
* ===========================================================================
28+
*/
29+
2430
/*
2531
* @test
2632
* @bug 6405536 6414980 8051972
@@ -41,6 +47,7 @@
4147
import java.security.NoSuchAlgorithmException;
4248
import java.security.NoSuchProviderException;
4349
import java.security.Provider;
50+
import java.security.ProviderException;
4451
import java.security.PublicKey;
4552
import java.security.SecureRandom;
4653
import java.security.SignatureException;
@@ -182,6 +189,15 @@ public void main(Provider p) throws Exception {
182189
}
183190
} catch (SignatureException | InvalidKeyException e) {
184191
System.out.println("OK: " + e);
192+
} catch (ProviderException pe) {
193+
if (pe.getMessage().contains("cancel failed")
194+
&& "s390x".equals(System.getProperty("os.arch"))
195+
) {
196+
System.out.println("NSS error code is different on s390x.");
197+
pe.printStackTrace();
198+
} else {
199+
throw pe;
200+
}
185201
}
186202
}
187203

0 commit comments

Comments
 (0)