diff options
author | Andrew John Hughes <gandalf@gcc.gnu.org> | 2012-03-23 15:19:26 +0000 |
---|---|---|
committer | Andrew John Hughes <gandalf@gcc.gnu.org> | 2012-03-23 15:19:26 +0000 |
commit | 0563022a206294757effa44686727bffc4f7c2bd (patch) | |
tree | febe3d4d4c0c994db223fee8e819bde6582494c9 /libjava/classpath/gnu/java/security | |
parent | 21669dfe20db0246ece395db5558a081a5c7088f (diff) | |
download | gcc-0563022a206294757effa44686727bffc4f7c2bd.zip gcc-0563022a206294757effa44686727bffc4f7c2bd.tar.gz gcc-0563022a206294757effa44686727bffc4f7c2bd.tar.bz2 |
Merge GNU Classpath 0.99 into libjava.
From-SVN: r185741
Diffstat (limited to 'libjava/classpath/gnu/java/security')
18 files changed, 63 insertions, 39 deletions
diff --git a/libjava/classpath/gnu/java/security/Properties.java b/libjava/classpath/gnu/java/security/Properties.java index 2213bde..1a4bf227 100644 --- a/libjava/classpath/gnu/java/security/Properties.java +++ b/libjava/classpath/gnu/java/security/Properties.java @@ -1,5 +1,5 @@ /* Properties.java -- run-time configuration properties. - Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -54,7 +54,8 @@ import java.util.logging.Logger; */ public final class Properties { - private static final Logger log = Logger.getLogger(Properties.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(Properties.class.getName()) : null; public static final String VERSION = "gnu.crypto.version"; diff --git a/libjava/classpath/gnu/java/security/der/DERWriter.java b/libjava/classpath/gnu/java/security/der/DERWriter.java index 0c26336..cea3fa3 100644 --- a/libjava/classpath/gnu/java/security/der/DERWriter.java +++ b/libjava/classpath/gnu/java/security/der/DERWriter.java @@ -1,5 +1,5 @@ /* DERWriter.java -- write Java types in DER format. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -281,9 +281,9 @@ public class DERWriter implements DER private static byte[] toUtf8(String string) { - ByteArrayOutputStream buf = - new ByteArrayOutputStream((int)(string.length() * 1.5)); - for (int i = 0; i < string.length(); i++) + int len = string.length(); + ByteArrayOutputStream buf = new ByteArrayOutputStream(len + (len >> 1)); + for (int i = 0; i < len; i++) { char c = string.charAt(i); if (c < 0x0080) diff --git a/libjava/classpath/gnu/java/security/hash/Whirlpool.java b/libjava/classpath/gnu/java/security/hash/Whirlpool.java index 5741040..29eed59 100644 --- a/libjava/classpath/gnu/java/security/hash/Whirlpool.java +++ b/libjava/classpath/gnu/java/security/hash/Whirlpool.java @@ -1,5 +1,5 @@ /* Whirlpool.java -- - Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -67,7 +67,9 @@ import java.util.logging.Logger; public final class Whirlpool extends BaseHash { - private static final Logger log = Logger.getLogger(Whirlpool.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(Whirlpool.class.getName()) : null; + private static final int BLOCK_SIZE = 64; // inner block size in bytes /** The digest of the 0-bit long message. */ diff --git a/libjava/classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java b/libjava/classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java index 19ec088..ec74201 100644 --- a/libjava/classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java +++ b/libjava/classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java @@ -1,5 +1,5 @@ /* EncodedKeyFactory.java -- JCE Encoded key factory Adapter - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -78,7 +78,8 @@ import javax.crypto.spec.DHPublicKeySpec; public class EncodedKeyFactory extends KeyFactorySpi { - private static final Logger log = Logger.getLogger(EncodedKeyFactory.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(EncodedKeyFactory.class.getName()) : null; private static Object invokeConstructor(String className, Object[] params) throws InvalidKeySpecException diff --git a/libjava/classpath/gnu/java/security/jce/sig/SignatureAdapter.java b/libjava/classpath/gnu/java/security/jce/sig/SignatureAdapter.java index 0ed1e2f..efe3681 100644 --- a/libjava/classpath/gnu/java/security/jce/sig/SignatureAdapter.java +++ b/libjava/classpath/gnu/java/security/jce/sig/SignatureAdapter.java @@ -1,5 +1,5 @@ /* SignatureAdapter.java -- - Copyright 2001, 2002, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -75,7 +75,8 @@ class SignatureAdapter extends SignatureSpi implements Cloneable { - private static final Logger log = Logger.getLogger(SignatureAdapter.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(SignatureAdapter.class.getName()) : null; /** Our underlying signature instance. */ private ISignature adaptee; diff --git a/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairGenerator.java b/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairGenerator.java index 6bda4e8..70df734 100644 --- a/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairGenerator.java +++ b/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairGenerator.java @@ -1,5 +1,5 @@ /* DSSKeyPairGenerator.java -- - Copyright 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -66,7 +66,8 @@ import java.util.logging.Logger; public class DSSKeyPairGenerator implements IKeyPairGenerator { - private static final Logger log = Logger.getLogger(DSSKeyPairGenerator.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(DSSKeyPairGenerator.class.getName()) : null; /** The BigInteger constant 2. */ private static final BigInteger TWO = BigInteger.valueOf(2L); diff --git a/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java b/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java index a59ca3c..1806ecf 100644 --- a/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java +++ b/libjava/classpath/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java @@ -1,5 +1,5 @@ /* DSSKeyPairPKCS8Codec.java -- PKCS#8 Encoding/Decoding handler - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -67,7 +67,9 @@ import java.util.logging.Logger; public class DSSKeyPairPKCS8Codec implements IKeyPairCodec { - private static final Logger log = Logger.getLogger(DSSKeyPairPKCS8Codec.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(DSSKeyPairPKCS8Codec.class.getName()) : null; + private static final OID DSA_ALG_OID = new OID(Registry.DSA_OID_STRING); // implicit 0-arguments constructor diff --git a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairGenerator.java b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairGenerator.java index bec60d3..99c31394 100644 --- a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairGenerator.java +++ b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairGenerator.java @@ -1,5 +1,5 @@ /* RSAKeyPairGenerator.java -- - Copyright 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -70,7 +70,8 @@ import java.util.logging.Logger; public class RSAKeyPairGenerator implements IKeyPairGenerator { - private static final Logger log = Logger.getLogger(RSAKeyPairGenerator.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(RSAKeyPairGenerator.class.getName()) : null; /** The BigInteger constant 1. */ private static final BigInteger ONE = BigInteger.ONE; diff --git a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java index 2785f02..b07ed66 100644 --- a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java +++ b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java @@ -1,5 +1,5 @@ /* RSAKeyPairPKCS8Codec.java -- PKCS#8 Encoding/Decoding handler - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -64,7 +64,9 @@ import java.util.logging.Logger; public class RSAKeyPairPKCS8Codec implements IKeyPairCodec { - private static final Logger log = Logger.getLogger(RSAKeyPairPKCS8Codec.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(RSAKeyPairPKCS8Codec.class.getName()) : null; + private static final OID RSA_ALG_OID = new OID(Registry.RSA_OID_STRING); // implicit 0-arguments constructor diff --git a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java index 9ad6ae0..36fd75c 100644 --- a/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java +++ b/libjava/classpath/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java @@ -1,5 +1,5 @@ /* RSAKeyPairX509Codec.java -- X.509 Encoding/Decoding handler - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -65,7 +65,9 @@ import java.util.logging.Logger; public class RSAKeyPairX509Codec implements IKeyPairCodec { - private static final Logger log = Logger.getLogger(RSAKeyPairX509Codec.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(RSAKeyPairX509Codec.class.getName()) : null; + private static final OID RSA_ALG_OID = new OID(Registry.RSA_OID_STRING); // implicit 0-arguments constructor diff --git a/libjava/classpath/gnu/java/security/pkcs/PKCS7SignedData.java b/libjava/classpath/gnu/java/security/pkcs/PKCS7SignedData.java index adb00a3..e479d2e 100644 --- a/libjava/classpath/gnu/java/security/pkcs/PKCS7SignedData.java +++ b/libjava/classpath/gnu/java/security/pkcs/PKCS7SignedData.java @@ -1,5 +1,5 @@ /* PKCS7SignedData.java -- reader/writer for PKCS#7 signedData objects - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -78,7 +78,8 @@ import java.util.logging.Logger; */ public class PKCS7SignedData { - private static final Logger log = Logger.getLogger(PKCS7SignedData.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(PKCS7SignedData.class.getName()) : null; public static final OID PKCS7_SIGNED_DATA = new OID("1.2.840.113549.1.7.2"); diff --git a/libjava/classpath/gnu/java/security/pkcs/SignerInfo.java b/libjava/classpath/gnu/java/security/pkcs/SignerInfo.java index 645ed67..07ce4d7 100644 --- a/libjava/classpath/gnu/java/security/pkcs/SignerInfo.java +++ b/libjava/classpath/gnu/java/security/pkcs/SignerInfo.java @@ -1,5 +1,5 @@ /* SignerInfo.java -- a SignerInfo object, from PKCS #7 - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -59,7 +59,8 @@ import javax.security.auth.x500.X500Principal; public class SignerInfo { - private static final Logger log = Logger.getLogger(SignerInfo.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(SignerInfo.class.getName()) : null; private final BigInteger version; private final BigInteger serialNumber; @@ -111,7 +112,8 @@ public class SignerInfo throw new BEREncodingException("malformed Version"); version = (BigInteger) val.getValue(); - log.fine(" Version: " + version); + if (Configuration.DEBUG) + log.fine(" Version: " + version); val = ber.read(); if (!val.isConstructed()) diff --git a/libjava/classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java b/libjava/classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java index d4ce4ae..e0d3187 100644 --- a/libjava/classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java +++ b/libjava/classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java @@ -1,5 +1,5 @@ /* PKIXCertPathValidatorImpl.java -- PKIX certificate path validator. - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -97,7 +97,8 @@ import java.util.logging.Logger; public class PKIXCertPathValidatorImpl extends CertPathValidatorSpi { - private static final Logger log = Logger.getLogger(PKIXCertPathValidatorImpl.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(PKIXCertPathValidatorImpl.class.getName()) : null; public static final String ANY_POLICY = "2.5.29.32.0"; diff --git a/libjava/classpath/gnu/java/security/sig/rsa/EMSA_PSS.java b/libjava/classpath/gnu/java/security/sig/rsa/EMSA_PSS.java index 917d963..7a8e591 100644 --- a/libjava/classpath/gnu/java/security/sig/rsa/EMSA_PSS.java +++ b/libjava/classpath/gnu/java/security/sig/rsa/EMSA_PSS.java @@ -1,5 +1,5 @@ /* EMSA_PSS.java -- - Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -73,7 +73,8 @@ import java.util.logging.Logger; public class EMSA_PSS implements Cloneable { - private static final Logger log = Logger.getLogger(EMSA_PSS.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(EMSA_PSS.class.getName()) : null; /** The underlying hash function to use with this instance. */ private IMessageDigest hash; diff --git a/libjava/classpath/gnu/java/security/sig/rsa/RSAPSSSignature.java b/libjava/classpath/gnu/java/security/sig/rsa/RSAPSSSignature.java index d8f8327..7b042f7 100644 --- a/libjava/classpath/gnu/java/security/sig/rsa/RSAPSSSignature.java +++ b/libjava/classpath/gnu/java/security/sig/rsa/RSAPSSSignature.java @@ -1,5 +1,5 @@ /* RSAPSSSignature.java -- - Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc. This file is a part of GNU Classpath. @@ -75,7 +75,8 @@ import java.util.logging.Logger; public class RSAPSSSignature extends BaseSignature { - private static final Logger log = Logger.getLogger(RSAPSSSignature.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(RSAPSSSignature.class.getName()) : null; /** The underlying EMSA-PSS instance for this object. */ private EMSA_PSS pss; diff --git a/libjava/classpath/gnu/java/security/x509/X509CRL.java b/libjava/classpath/gnu/java/security/x509/X509CRL.java index 7c471c9..518edaa 100644 --- a/libjava/classpath/gnu/java/security/x509/X509CRL.java +++ b/libjava/classpath/gnu/java/security/x509/X509CRL.java @@ -1,5 +1,5 @@ /* X509CRL.java -- X.509 certificate revocation list. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -77,7 +77,9 @@ import javax.security.auth.x500.X500Principal; public class X509CRL extends java.security.cert.X509CRL implements GnuPKIExtension { - private static final Logger log = Logger.getLogger(X509CRL.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(X509CRL.class.getName()) : null; + 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"); diff --git a/libjava/classpath/gnu/java/security/x509/X509CRLEntry.java b/libjava/classpath/gnu/java/security/x509/X509CRLEntry.java index 26b4036..64adf7f 100644 --- a/libjava/classpath/gnu/java/security/x509/X509CRLEntry.java +++ b/libjava/classpath/gnu/java/security/x509/X509CRLEntry.java @@ -1,5 +1,5 @@ /* X509CRLEntry.java -- an entry in a X.509 CRL. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -65,7 +65,9 @@ import java.util.logging.Logger; class X509CRLEntry extends java.security.cert.X509CRLEntry implements GnuPKIExtension { - private static final Logger log = Logger.getLogger(X509CRLEntry.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(X509CRLEntry.class.getName()) : null; + /** The DER encoded form of this CRL entry. */ private byte[] encoded; diff --git a/libjava/classpath/gnu/java/security/x509/ext/Extension.java b/libjava/classpath/gnu/java/security/x509/ext/Extension.java index 2b7e96d..b740c8a 100644 --- a/libjava/classpath/gnu/java/security/x509/ext/Extension.java +++ b/libjava/classpath/gnu/java/security/x509/ext/Extension.java @@ -1,5 +1,5 @@ /* Extension.java -- an X.509 certificate or CRL extension. - Copyright (C) 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -53,7 +53,8 @@ import java.util.logging.Logger; public class Extension { - private static final Logger log = Logger.getLogger(Extension.class.getName()); + private static final Logger log = Configuration.DEBUG ? + Logger.getLogger(Extension.class.getName()) : null; /** * This extension's object identifier. */ |