63 |
{ |
{ |
64 |
private static final String ALG_ALIAS = "Alg.Alias."; |
private static final String ALG_ALIAS = "Alg.Alias."; |
65 |
|
|
66 |
private static final Vector providers_lazy = new Vector(); |
private static final Vector providersList = new Vector(); |
67 |
private static boolean providers_lazy_set = false; |
private static boolean providersInited = false; |
68 |
private static Properties secprops = new Properties(); |
private static Properties secprops = new Properties(); |
69 |
|
|
70 |
/** |
/** |
75 |
*/ |
*/ |
76 |
private static Vector providers() |
private static Vector providers() |
77 |
{ |
{ |
78 |
synchronized (providers_lazy) |
synchronized (providersList) |
79 |
{ |
{ |
80 |
if (!providers_lazy_set) |
if (!providersInited) |
81 |
{ |
{ |
82 |
String base = System.getProperty("gnu.classpath.home.url"); |
providersInited = true; |
83 |
String vendor = System.getProperty("gnu.classpath.vm.shortname"); |
String base = System.getProperty("gnu.classpath.home.url"); |
84 |
|
String vendor = System.getProperty("gnu.classpath.vm.shortname"); |
85 |
// Try VM specific security file |
|
86 |
boolean loaded = loadProviders(base, vendor); |
// Try VM specific security file |
87 |
|
boolean loaded = loadProviders(base, vendor); |
88 |
// Append classpath standard provider if possible |
|
89 |
if (!loadProviders(base, "classpath") && !loaded && providers_lazy.size() == 0) |
// Append classpath standard provider if possible |
90 |
{ |
if (!loadProviders(base, "classpath") |
91 |
// No providers found and both security files failed to load properly. |
&& !loaded && providersList.size() == 0) |
92 |
System.err.println |
{ |
93 |
("WARNING: could not properly read security provider files:"); |
// No providers found |
94 |
System.err.println |
// and both security files failed to load properly. |
95 |
(" " + base + "/security/" + vendor + ".security"); |
System.err.println |
96 |
System.err.println |
("WARNING: " |
97 |
(" " + base + "/security/" + "classpath" + ".security"); |
+ "could not properly read security provider files:"); |
98 |
System.err.println |
System.err.println |
99 |
(" Falling back to standard GNU security provider"); |
(" " |
100 |
providers_lazy.addElement(new gnu.java.security.provider.Gnu()); |
+ base + "/security/" + vendor + ".security"); |
101 |
} |
System.err.println |
102 |
} |
(" " |
103 |
|
+ base + "/security/" + "classpath" + ".security"); |
104 |
|
System.err.println |
105 |
|
(" Falling back to standard GNU security provider"); |
106 |
|
providersList.addElement(new gnu.java.security.provider.Gnu()); |
107 |
|
} |
108 |
|
} |
109 |
} |
} |
110 |
return providers_lazy; |
return providersList; |
111 |
} |
} |
112 |
|
|
113 |
|
|