Skip to content

Commit

Permalink
Merge pull request #311 from KostasTsiounis/p11_failure
Browse files Browse the repository at this point in the history
Account for different NSS error code in s390x
  • Loading branch information
keithc-ca authored Jan 24, 2024
2 parents 589cc87 + fd0ac43 commit e7ef92a
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 e7ef92a

Please sign in to comment.