Skip to content

Commit

Permalink
Account for different NSS error code in s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
KostasTsiounis committed Jan 23, 2024
1 parent 589cc87 commit fd0ac43
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/jdk/sun/security/pkcs11/ec/ReadCertificates.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
* ===========================================================================
*/

/*
* @test
* @bug 6405536 6414980 8051972
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit fd0ac43

Please sign in to comment.