Imported GNU Classpath 0.92
2006-08-14 Mark Wielaard <mark@klomp.org> Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. From-SVN: r116139
This commit is contained in:
parent
abab460491
commit
ac1ed908de
1294 changed files with 99479 additions and 35933 deletions
|
@ -1,5 +1,5 @@
|
|||
/* Util.java -- Miscellaneous utility methods.
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -155,7 +155,7 @@ public final class Util
|
|||
}
|
||||
|
||||
/**
|
||||
* See {@link #hexDump(byte[],int,int)}.
|
||||
* See {@link #hexDump(byte[],int,int,String)}.
|
||||
*/
|
||||
public static String hexDump(byte[] buf, String prefix)
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.security.x509;
|
||||
|
||||
import gnu.java.security.Configuration;
|
||||
import gnu.java.security.OID;
|
||||
import gnu.java.security.der.BitString;
|
||||
import gnu.java.security.der.DER;
|
||||
|
@ -64,6 +65,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
|
||||
|
@ -75,20 +77,7 @@ import javax.security.auth.x500.X500Principal;
|
|||
public class X509CRL extends java.security.cert.X509CRL
|
||||
implements GnuPKIExtension
|
||||
{
|
||||
|
||||
// Constants and fields.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static void debug(String msg)
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
System.err.print(">> X509CRL: ");
|
||||
System.err.println(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Logger log = Logger.getLogger(X509CRL.class.getName());
|
||||
private static final OID ID_DSA = new OID("1.2.840.10040.4.1");
|
||||
private static final OID ID_DSA_WITH_SHA1 = new OID("1.2.840.10040.4.3");
|
||||
private static final OID ID_RSA = new OID("1.2.840.113549.1.1.1");
|
||||
|
@ -350,7 +339,8 @@ public class X509CRL extends java.security.cert.X509CRL
|
|||
// CertificateList ::= SEQUENCE {
|
||||
DERReader der = new DERReader(in);
|
||||
DERValue val = der.read();
|
||||
debug("start CertificateList len == " + val.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start CertificateList len == " + val.getLength());
|
||||
if (!val.isConstructed())
|
||||
throw new IOException("malformed CertificateList");
|
||||
encoded = val.getEncoded();
|
||||
|
@ -359,7 +349,8 @@ public class X509CRL extends java.security.cert.X509CRL
|
|||
val = der.read();
|
||||
if (!val.isConstructed())
|
||||
throw new IOException("malformed TBSCertList");
|
||||
debug("start tbsCertList len == " + val.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start tbsCertList len == " + val.getLength());
|
||||
tbsCRLBytes = val.getEncoded();
|
||||
|
||||
// version Version OPTIONAL,
|
||||
|
@ -372,19 +363,23 @@ public class X509CRL extends java.security.cert.X509CRL
|
|||
}
|
||||
else
|
||||
version = 1;
|
||||
debug("read version == " + version);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read version == " + version);
|
||||
|
||||
// signature AlgorithmIdentifier,
|
||||
debug("start AlgorithmIdentifier len == " + val.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start AlgorithmIdentifier len == " + val.getLength());
|
||||
if (!val.isConstructed())
|
||||
throw new IOException("malformed AlgorithmIdentifier");
|
||||
DERValue algIdVal = der.read();
|
||||
algId = (OID) algIdVal.getValue();
|
||||
debug("read object identifier == " + algId);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read object identifier == " + algId);
|
||||
if (val.getLength() > algIdVal.getEncodedLength())
|
||||
{
|
||||
val = der.read();
|
||||
debug("read parameters len == " + val.getEncodedLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read parameters len == " + val.getEncodedLength());
|
||||
algParams = val.getEncoded();
|
||||
if (val.isConstructed())
|
||||
in.skip(val.getLength());
|
||||
|
@ -394,18 +389,21 @@ public class X509CRL extends java.security.cert.X509CRL
|
|||
val = der.read();
|
||||
issuerDN = new X500DistinguishedName(val.getEncoded());
|
||||
der.skip(val.getLength());
|
||||
debug("read issuer == " + issuerDN);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read issuer == " + issuerDN);
|
||||
|
||||
// thisUpdate Time,
|
||||
thisUpdate = (Date) der.read().getValue();
|
||||
debug("read thisUpdate == " + thisUpdate);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read thisUpdate == " + thisUpdate);
|
||||
|
||||
// nextUpdate Time OPTIONAL,
|
||||
val = der.read();
|
||||
if (val.getValue() instanceof Date)
|
||||
{
|
||||
nextUpdate = (Date) val.getValue();
|
||||
debug("read nextUpdate == " + nextUpdate);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read nextUpdate == " + nextUpdate);
|
||||
val = der.read();
|
||||
}
|
||||
|
||||
|
@ -433,7 +431,8 @@ public class X509CRL extends java.security.cert.X509CRL
|
|||
DERValue exts = der.read();
|
||||
if (!exts.isConstructed())
|
||||
throw new IOException("malformed Extensions");
|
||||
debug("start Extensions len == " + exts.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start Extensions len == " + exts.getLength());
|
||||
int len = 0;
|
||||
while (len < exts.getLength())
|
||||
{
|
||||
|
@ -444,32 +443,42 @@ public class X509CRL extends java.security.cert.X509CRL
|
|||
extensions.put(e.getOid(), e);
|
||||
der.skip(ext.getLength());
|
||||
len += ext.getEncodedLength();
|
||||
debug("current count == " + len);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("current count == " + len);
|
||||
}
|
||||
val = der.read();
|
||||
}
|
||||
|
||||
debug("read tag == " + val.getTag());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read tag == " + val.getTag());
|
||||
if (!val.isConstructed())
|
||||
throw new IOException("malformed AlgorithmIdentifier");
|
||||
debug("start AlgorithmIdentifier len == " + val.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start AlgorithmIdentifier len == " + val.getLength());
|
||||
DERValue sigAlgVal = der.read();
|
||||
debug("read tag == " + sigAlgVal.getTag());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read tag == " + sigAlgVal.getTag());
|
||||
if (sigAlgVal.getTag() != DER.OBJECT_IDENTIFIER)
|
||||
throw new IOException("malformed AlgorithmIdentifier");
|
||||
sigAlg = (OID) sigAlgVal.getValue();
|
||||
debug("signature id == " + sigAlg);
|
||||
debug("sigAlgVal length == " + sigAlgVal.getEncodedLength());
|
||||
if (Configuration.DEBUG)
|
||||
{
|
||||
log.fine("signature id == " + sigAlg);
|
||||
log.fine("sigAlgVal length == " + sigAlgVal.getEncodedLength());
|
||||
}
|
||||
if (val.getLength() > sigAlgVal.getEncodedLength())
|
||||
{
|
||||
val = der.read();
|
||||
debug("sig params tag = " + val.getTag() + " len == " + val.getEncodedLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("sig params tag = " + val.getTag() + " len == "
|
||||
+ val.getEncodedLength());
|
||||
sigAlgParams = (byte[]) val.getEncoded();
|
||||
if (val.isConstructed())
|
||||
in.skip(val.getLength());
|
||||
}
|
||||
val = der.read();
|
||||
debug("read tag = " + val.getTag());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read tag = " + val.getTag());
|
||||
rawSig = val.getEncoded();
|
||||
signature = ((BitString) val.getValue()).toByteArray();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.security.x509;
|
||||
|
||||
import gnu.java.security.Configuration;
|
||||
import gnu.java.security.OID;
|
||||
import gnu.java.security.der.DERReader;
|
||||
import gnu.java.security.der.DERValue;
|
||||
|
@ -53,6 +54,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A single entry in a X.509 certificate revocation list.
|
||||
|
@ -63,20 +65,7 @@ import java.util.Set;
|
|||
class X509CRLEntry extends java.security.cert.X509CRLEntry
|
||||
implements GnuPKIExtension
|
||||
{
|
||||
|
||||
// Constants and fields.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static void debug(String msg)
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
System.err.print(">> X509CRLEntry: ");
|
||||
System.err.println(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Logger log = Logger.getLogger(X509CRLEntry.class.getName());
|
||||
/** The DER encoded form of this CRL entry. */
|
||||
private byte[] encoded;
|
||||
|
||||
|
@ -230,26 +219,29 @@ class X509CRLEntry extends java.security.cert.X509CRLEntry
|
|||
{
|
||||
// RevokedCertificate ::= SEQUENCE {
|
||||
DERValue entry = der.read();
|
||||
debug("start CRL entry len == " + entry.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start CRL entry len == " + entry.getLength());
|
||||
if (!entry.isConstructed())
|
||||
throw new IOException("malformed revokedCertificate");
|
||||
encoded = entry.getEncoded();
|
||||
int len = 0;
|
||||
|
||||
debug("encoded entry:\n" + Util.hexDump(encoded, ">>>> "));
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("encoded entry:\n" + Util.hexDump(encoded, ">>>> "));
|
||||
|
||||
// userCertificate CertificateSerialNumber,
|
||||
DERValue val = der.read();
|
||||
serialNo = (BigInteger) val.getValue();
|
||||
len += val.getEncodedLength();
|
||||
debug("userCertificate == " + serialNo + " current count == " + len);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("userCertificate == " + serialNo + " current count == " + len);
|
||||
|
||||
// revocationDate Time,
|
||||
val = der.read();
|
||||
revocationDate = (Date) val.getValue();
|
||||
len += val.getEncodedLength();
|
||||
debug("revocationDate == " + revocationDate + " current count == " + len);
|
||||
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("revocationDate == " + revocationDate + " current count == "
|
||||
+ len);
|
||||
// crlEntryExtensions Extensions OPTIONAL
|
||||
// -- if present MUST be v2
|
||||
if (len < entry.getLength())
|
||||
|
@ -259,19 +251,22 @@ class X509CRLEntry extends java.security.cert.X509CRLEntry
|
|||
DERValue exts = der.read();
|
||||
if (!exts.isConstructed())
|
||||
throw new IOException("malformed Extensions");
|
||||
debug("start Extensions len == " + exts.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start Extensions len == " + exts.getLength());
|
||||
len = 0;
|
||||
while (len < exts.getLength())
|
||||
{
|
||||
val = der.read();
|
||||
if (!val.isConstructed())
|
||||
throw new IOException("malformed Extension");
|
||||
debug("start Extension len == " + val.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("start Extension len == " + val.getLength());
|
||||
Extension e = new Extension(val.getEncoded());
|
||||
extensions.put(e.getOid(), e);
|
||||
der.skip(val.getLength());
|
||||
len += val.getEncodedLength();
|
||||
debug("current count == " + len);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("current count == " + len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -552,7 +552,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
|
|||
// Certificate ::= SEQUENCE {
|
||||
DERValue cert = der.read();
|
||||
logger.log (Component.X509, "start Certificate len == {0}",
|
||||
new Integer (cert.getLength()));
|
||||
Integer.valueOf(cert.getLength()));
|
||||
|
||||
this.encoded = cert.getEncoded();
|
||||
if (!cert.isConstructed())
|
||||
|
@ -568,7 +568,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
|
|||
}
|
||||
tbsCertBytes = tbsCert.getEncoded();
|
||||
logger.log (Component.X509, "start TBSCertificate len == {0}",
|
||||
new Integer (tbsCert.getLength()));
|
||||
Integer.valueOf(tbsCert.getLength()));
|
||||
|
||||
// Version ::= INTEGER [0] { v1(0), v2(1), v3(2) }
|
||||
DERValue val = der.read();
|
||||
|
@ -582,7 +582,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
|
|||
version = 1;
|
||||
}
|
||||
logger.log (Component.X509, "read version == {0}",
|
||||
new Integer (version));
|
||||
Integer.valueOf(version));
|
||||
|
||||
// SerialNumber ::= INTEGER
|
||||
serialNo = (BigInteger) val.getValue();
|
||||
|
@ -596,7 +596,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
|
|||
}
|
||||
int certAlgLen = val.getLength();
|
||||
logger.log (Component.X509, "start AlgorithmIdentifier len == {0}",
|
||||
new Integer (certAlgLen));
|
||||
Integer.valueOf(certAlgLen));
|
||||
val = der.read();
|
||||
|
||||
// algorithm OBJECT IDENTIFIER,
|
||||
|
@ -677,20 +677,20 @@ public class X509Certificate extends java.security.cert.X509Certificate
|
|||
{
|
||||
val = der.read();
|
||||
logger.log (Component.X509, "start Extensions len == {0}",
|
||||
new Integer (val.getLength()));
|
||||
Integer.valueOf(val.getLength()));
|
||||
int len = 0;
|
||||
while (len < val.getLength())
|
||||
{
|
||||
DERValue ext = der.read();
|
||||
logger.log (Component.X509, "start extension len == {0}",
|
||||
new Integer (ext.getLength()));
|
||||
Integer.valueOf(ext.getLength()));
|
||||
Extension e = new Extension(ext.getEncoded());
|
||||
extensions.put(e.getOid(), e);
|
||||
der.skip(ext.getLength());
|
||||
len += ext.getEncodedLength();
|
||||
logger.log (Component.X509, "read extension {0} == {1}",
|
||||
new Object[] { e.getOid (), e });
|
||||
logger.log (Component.X509, "count == {0}", new Integer (len));
|
||||
logger.log (Component.X509, "count == {0}", Integer.valueOf(len));
|
||||
}
|
||||
|
||||
val = der.read ();
|
||||
|
@ -703,7 +703,7 @@ public class X509Certificate extends java.security.cert.X509Certificate
|
|||
}
|
||||
int sigAlgLen = val.getLength();
|
||||
logger.log (Component.X509, "start AlgorithmIdentifier len == {0}",
|
||||
new Integer (sigAlgLen));
|
||||
Integer.valueOf(sigAlgLen));
|
||||
val = der.read();
|
||||
sigAlgId = (OID) val.getValue();
|
||||
logger.log (Component.X509, "read algorithm id == {0}", sigAlgId);
|
||||
|
|
|
@ -38,6 +38,7 @@ exception statement from your version. */
|
|||
|
||||
package gnu.java.security.x509.ext;
|
||||
|
||||
import gnu.java.security.Configuration;
|
||||
import gnu.java.security.OID;
|
||||
import gnu.java.security.der.DER;
|
||||
import gnu.java.security.der.DERReader;
|
||||
|
@ -48,20 +49,11 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class Extension
|
||||
{
|
||||
|
||||
// Fields.
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static void debug(String msg)
|
||||
{
|
||||
System.err.print(">> Extension: ");
|
||||
System.err.println(msg);
|
||||
}
|
||||
|
||||
private static final Logger log = Logger.getLogger(Extension.class.getName());
|
||||
/**
|
||||
* This extension's object identifier.
|
||||
*/
|
||||
|
@ -97,7 +89,8 @@ public class Extension
|
|||
|
||||
// Extension ::= SEQUENCE {
|
||||
DERValue val = der.read();
|
||||
if (DEBUG) debug("read val tag == " + val.getTag() + " len == " + val.getLength());
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read val tag == " + val.getTag() + " len == " + val.getLength());
|
||||
if (!val.isConstructed())
|
||||
throw new IOException("malformed Extension");
|
||||
|
||||
|
@ -106,7 +99,8 @@ public class Extension
|
|||
if (val.getTag() != DER.OBJECT_IDENTIFIER)
|
||||
throw new IOException("expecting OBJECT IDENTIFIER");
|
||||
oid = (OID) val.getValue();
|
||||
if (DEBUG) debug("read oid == " + oid);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read oid == " + oid);
|
||||
|
||||
// critical BOOLEAN DEFAULT FALSE,
|
||||
val = der.read();
|
||||
|
@ -117,7 +111,8 @@ public class Extension
|
|||
}
|
||||
else
|
||||
critical = false;
|
||||
if (DEBUG) debug("is critical == " + critical);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("is critical == " + critical);
|
||||
|
||||
// extnValue OCTET STRING }
|
||||
if (val.getTag() != DER.OCTET_STRING)
|
||||
|
@ -181,7 +176,8 @@ public class Extension
|
|||
value = new Value(encval);
|
||||
isSupported = false;
|
||||
}
|
||||
if (DEBUG) debug("read value == " + value);
|
||||
if (Configuration.DEBUG)
|
||||
log.fine("read value == " + value);
|
||||
}
|
||||
|
||||
public Extension (final OID oid, final Value value, final boolean critical)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* GeneralNames.java -- the GeneralNames object
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -42,7 +42,6 @@ import gnu.java.security.OID;
|
|||
import gnu.java.security.der.DER;
|
||||
import gnu.java.security.der.DERReader;
|
||||
import gnu.java.security.der.DERValue;
|
||||
import gnu.java.security.x509.X500DistinguishedName;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
|
@ -91,7 +90,7 @@ public class GeneralNames
|
|||
int tagClass = name.getTagClass();
|
||||
if (tagClass != DER.CONTEXT)
|
||||
throw new IOException("malformed GeneralName: Tag class is " + tagClass);
|
||||
namePair.add(new Integer(name.getTag()));
|
||||
namePair.add(Integer.valueOf(name.getTag()));
|
||||
DERValue val = null;
|
||||
switch (name.getTag())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue