8005939: sun/security/x509/{X509CRLImplX509CertImpl}/Verify.java fail in confusing way when some providers not present
Reviewed-by: mullan, weijun
This commit is contained in:
parent
68eb431db8
commit
5d2a6972af
jdk/test/sun/security/x509
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user