From fd0ac438c00e180fb5ae82836f3e928aec36f3a4 Mon Sep 17 00:00:00 2001 From: Kostas Tsiounis Date: Fri, 15 Dec 2023 10:51:44 -0500 Subject: [PATCH] Account for different NSS error code in s390x --- .../sun/security/pkcs11/ec/ReadCertificates.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/jdk/sun/security/pkcs11/ec/ReadCertificates.java b/test/jdk/sun/security/pkcs11/ec/ReadCertificates.java index 4b4a6a20a4a..e82470f35a1 100644 --- a/test/jdk/sun/security/pkcs11/ec/ReadCertificates.java +++ b/test/jdk/sun/security/pkcs11/ec/ReadCertificates.java @@ -21,6 +21,12 @@ * questions. */ +/* + * =========================================================================== + * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved + * =========================================================================== + */ + /* * @test * @bug 6405536 6414980 8051972 @@ -41,6 +47,7 @@ import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.Provider; +import java.security.ProviderException; import java.security.PublicKey; import java.security.SecureRandom; import java.security.SignatureException; @@ -182,6 +189,15 @@ public void main(Provider p) throws Exception { } } catch (SignatureException | InvalidKeyException e) { System.out.println("OK: " + e); + } catch (ProviderException pe) { + if (pe.getMessage().contains("cancel failed") + && "s390x".equals(System.getProperty("os.arch")) + ) { + System.out.println("NSS error code is different on s390x."); + pe.printStackTrace(); + } else { + throw pe; + } } }