JDK-6819110 : Lazily load Sun digest provider for jar verification
  • Type: Enhancement
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-03-18
  • Updated: 2010-04-02
  • Resolved: 2009-04-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u14Fixed 7 b55Fixed
Related Reports
Relates :  
Relates :  
Description
To verify a jar file entry, sun.security.util.ManifestEntryVerifer instance will be created. ManifestEntryVerifier's static initializer calls sun.security.jce.Providers.getSunProvider() that loads and initializes several security classes which are not nnecessarily needed at startup.

So call Providers.getSunProvider() when

Comments
SUGGESTED FIX public class ManifestEntryVerifier { private static final Debug debug = Debug.getInstance("jar"); - private static final Provider digestProvider = Providers.getSunProvider(); - /** the created digest objects */ HashMap<String, MessageDigest> createdDigests; /** the digests in use for a given entry*/ ArrayList<MessageDigest> digests; @@ -125,11 +123,11 @@ if (digest == null) { try { digest = MessageDigest.getInstance - (algorithm, digestProvider); + (algorithm, Providers.getSunProvider()); createdDigests.put(algorithm, digest); } catch (NoSuchAlgorithmException nsae) { // ignore } }
18-03-2009

EVALUATION Fix to call Providers.getSunProvider() when it's used.
18-03-2009