United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6819110 Lazily load Sun digest provider for jar verification
JDK-6819110 : Lazily load Sun digest provider for jar verification

Details
Type:
Enhancement
Submit Date:
2009-03-18
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-04-11
Component:
security-libs
OS:
generic
Sub-Component:
java.security
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

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
                     }
                 }
                                     
2009-03-18
EVALUATION

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



Hardware and Software, Engineered to Work Together