diff --git a/test/sun/security/x509/X509CRLImpl/Verify.java b/test/sun/security/x509/X509CRLImpl/Verify.java index f55f1bffb5ee24ee9995cefc667ddd8b2a65e8b3..0c1b30d74f12905495a4471f56e0b12d8b9ccdfb 100644 --- a/test/sun/security/x509/X509CRLImpl/Verify.java +++ b/test/sun/security/x509/X509CRLImpl/Verify.java @@ -95,7 +95,7 @@ public class Verify { * Should fail with NoSuchAlgorithmException. */ try { - verifyCRL(crlIssuerCertPubKey, "SunPCSC"); + verifyCRL(crlIssuerCertPubKey, "SunJCE"); throw new RuntimeException("Didn't catch the exception properly"); } catch (NoSuchAlgorithmException e) { System.out.println("Caught the correct exception."); @@ -148,6 +148,10 @@ public class Verify { throws CRLException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { Provider provider = Security.getProvider(providerName); + if (provider == null) { + throw new RuntimeException("Provider " + providerName + + " not found."); + } crl.verify(key, provider); } } diff --git a/test/sun/security/x509/X509CertImpl/Verify.java b/test/sun/security/x509/X509CertImpl/Verify.java index 09c1e0e1b970859a0463113485f891d515567325..89dcbb9f1b9a265077794bec20aa277afaa93a71 100644 --- a/test/sun/security/x509/X509CertImpl/Verify.java +++ b/test/sun/security/x509/X509CertImpl/Verify.java @@ -86,7 +86,7 @@ public class Verify { * Should fail with NoSuchAlgorithmException. */ try { - verifyCert(selfSignedCertPubKey, "SunPCSC"); + verifyCert(selfSignedCertPubKey, "SunJCE"); throw new RuntimeException("Didn't catch the exception properly"); } catch (NoSuchAlgorithmException e) { System.out.println("Caught the correct exception."); @@ -134,6 +134,10 @@ public class Verify { throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { Provider provider = Security.getProvider(providerName); + if (provider == null) { + throw new RuntimeException("Provider " + providerName + + " not found."); + } cert.verify(key, provider); } }