Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8005939

sun/security/x509/{X509CRLImplX509CertImpl}/Verify.java fail in confusing way when some providers not present

XMLWordPrintable

    • b75
    • Verified


      When these two tests are run on some of the smaller profiles (that don't have all the security providers installed) then they fail with a confusing exception, eg:

      java.lang.RuntimeException: Didn't catch the exception properly
      at Verify.main(Verify.java:99)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:474)
      at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:706)
      at java.lang.Thread.run(Thread.java:722)

      It would be desirable if this test were updated to fail with a useful message when the provider under test is not found, eg:

      --- a/test/sun/security/x509/X509CRLImpl/Verify.java
      +++ b/test/sun/security/x509/X509CRLImpl/Verify.java
      @@ -148,6 +148,8 @@
                   throws CRLException, NoSuchAlgorithmException, InvalidKeyException,
                   SignatureException {
               Provider provider = Security.getProvider(providerName);
      + if (provider == null)
      + throw new RuntimeException("Provider " + providerName + " not found");
               crl.verify(key, provider);
           }
       }

      Alternatively the verification could be skipped for providers that aren't installed.

            juh Jason Uh (Inactive)
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: