Changeset 1391 for branches/GNU/src/gcc/libjava/java/security/Security.java
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (22 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
libjava/java/security/Security.java (modified) (13 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/libjava/java/security/Security.java
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r1390 r1391 1 1 /* Security.java --- Java base security class implmentation 2 Copyright (C) 1999, 2001 Free Software Foundation, Inc.2 Copyright (C) 1999, 2001 Free Software Foundation, Inc. 3 3 4 4 This file is part of GNU Classpath. … … 38 38 package java.security; 39 39 import java.io.File; 40 import java.io. FileInputStream;40 import java.io.InputStream; 41 41 import java.io.IOException; 42 42 import java.io.FileNotFoundException; 43 43 44 import java.security.Provider; 44 45 import java.util.Vector; … … 56 57 { 57 58 private static Vector providers = new Vector(); 58 private static Properties secprops ;59 private static Properties secprops; 59 60 60 61 static 61 62 { 62 loadProviders(System.getProperty("java.vm.name")); 63 loadProviders("classpath"); 63 String base = System.getProperty("gnu.classpath.home.url"); 64 String vendor = System.getProperty("gnu.classpath.vm.shortname"); 65 66 // Try VM specific security file 67 boolean loaded = loadProviders(base, vendor); 68 69 // Append classpath standard provider if possible 70 if (!loadProviders(base, "classpath") && !loaded && providers.size() == 0) 71 { 72 // No providers found and both security files failed to load properly. 73 System.err.println 74 ("WARNING: could not properly read security provider files:"); 75 System.err.println 76 (" " + base + "/security/" + vendor + ".security"); 77 System.err.println 78 (" " + base + "/security/" + "classpath" + ".security"); 79 System.err.println 80 (" Falling back to standard GNU security provider"); 81 providers.addElement(new gnu.java.security.provider.Gnu()); 82 } 64 83 } 65 84 … … 69 88 } 70 89 71 private static void loadProviders(String vendor) 72 { 73 if (vendor == null) 74 return; 75 76 String separator = System.getProperty("file.separator"); 77 String secfilestr = (System.getProperty("java.home") + 78 separator + "lib" + 79 separator + "security" + 80 separator + vendor + ".security"); 81 90 /** 91 * Tries to load the vender specific security providers from the given 92 * base URL. Returns true if the resource could be read and completely 93 * parsed successfully, false otherwise. 94 */ 95 private static boolean loadProviders(String baseUrl, String vendor) 96 { 97 if (baseUrl == null || vendor == null) 98 return false; 99 100 boolean result = true; 101 String secfilestr = baseUrl + "/security/" + vendor + ".security"; 82 102 try 83 103 { 84 FileInputStream fin = new FileInputStream(secfilestr); 85 secprops = new Properties(); 104 InputStream fin = new URL(secfilestr).openStream(); 86 105 secprops.load(fin); 87 106 … … 89 108 String name; 90 109 91 while ((name = secprops.getProperty("security.provider." + i ++)) !=110 while ((name = secprops.getProperty("security.provider." + i)) != 92 111 null) 93 112 { … -
Property cvs2svn:cvs-rev
changed from
