diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2012-07-11 14:54:32 -0400 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-07-18 10:41:46 -0500 |
commit | 6cd64781a7cda192bc2b0a555974037fd16cc2c5 (patch) | |
tree | 1145e67bb8b736e47c11dd3485d635e53b1931eb /base/util/src | |
parent | 70e45db3cfcf01b3b36fe619b03cf604e6666c91 (diff) | |
download | pki-6cd64781a7cda192bc2b0a555974037fd16cc2c5.tar.gz pki-6cd64781a7cda192bc2b0a555974037fd16cc2c5.tar.xz pki-6cd64781a7cda192bc2b0a555974037fd16cc2c5.zip |
Misc Fixes Remaining part of the code.
Diffstat (limited to 'base/util/src')
15 files changed, 50 insertions, 85 deletions
diff --git a/base/util/src/netscape/security/pkcs/PKCS10Attribute.java b/base/util/src/netscape/security/pkcs/PKCS10Attribute.java index 3a2c7b437..c84df2a37 100644 --- a/base/util/src/netscape/security/pkcs/PKCS10Attribute.java +++ b/base/util/src/netscape/security/pkcs/PKCS10Attribute.java @@ -61,9 +61,6 @@ import netscape.security.x509.OIDMap; * @version 1.13 */ public class PKCS10Attribute implements DerEncoder, Serializable { - /** - * - */ private static final long serialVersionUID = 2002480042340316170L; protected ObjectIdentifier attributeId = null; protected CertAttrSet attributeValue = null; diff --git a/base/util/src/netscape/security/util/ByteArrayLexOrder.java b/base/util/src/netscape/security/util/ByteArrayLexOrder.java index 48954850e..2780e527a 100644 --- a/base/util/src/netscape/security/util/ByteArrayLexOrder.java +++ b/base/util/src/netscape/security/util/ByteArrayLexOrder.java @@ -25,7 +25,9 @@ import java.util.Comparator; * @version 1.4 97/12/10 * @author D. N. Hoover */ -public class ByteArrayLexOrder implements Comparator<byte[]> { +public class ByteArrayLexOrder implements Comparator<byte[]>, java.io.Serializable { + + private static final long serialVersionUID = 1897537410212918669L; /** * Perform lexicographical comparison of two byte arrays, diff --git a/base/util/src/netscape/security/util/ByteArrayTagOrder.java b/base/util/src/netscape/security/util/ByteArrayTagOrder.java index 40a627627..267a12eb7 100644 --- a/base/util/src/netscape/security/util/ByteArrayTagOrder.java +++ b/base/util/src/netscape/security/util/ByteArrayTagOrder.java @@ -19,7 +19,9 @@ package netscape.security.util; import java.util.Comparator; -public class ByteArrayTagOrder implements Comparator<byte[]> { +public class ByteArrayTagOrder implements Comparator<byte[]>, java.io.Serializable { + + private static final long serialVersionUID = -2027007556858126443L; /** * Compare two byte arrays, by the order of their tags, diff --git a/base/util/src/netscape/security/x509/AlgIdDSA.java b/base/util/src/netscape/security/x509/AlgIdDSA.java index 1f00b0355..ed2a73de0 100644 --- a/base/util/src/netscape/security/x509/AlgIdDSA.java +++ b/base/util/src/netscape/security/x509/AlgIdDSA.java @@ -186,33 +186,29 @@ public final class AlgIdDSA extends AlgorithmId implements DSAParams { } @Override - public boolean equals(Object other) { - if (other == null) { + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) return false; - } - if (other instanceof AlgIdDSA) { - AlgIdDSA rhs = (AlgIdDSA) other; - if (this == rhs) { - return true; - } - if (!(bigIntEquals(this.p, rhs.p) && bigIntEquals(this.q, rhs.q) && bigIntEquals(this.g, rhs.g))) { + if (getClass() != obj.getClass()) + return false; + AlgIdDSA other = (AlgIdDSA) obj; + if (g == null) { + if (other.g != null) return false; - } - return super.equals(rhs); - } - return false; - } - - public boolean bigIntEquals(BigInteger x, BigInteger y) { - if (x == null) { - if (y != null) { + } else if (!g.equals(other.g)) + return false; + if (p == null) { + if (other.p != null) return false; - } - } else { - if (!x.equals(y)) { + } else if (!p.equals(other.p)) + return false; + if (q == null) { + if (other.q != null) return false; - } - } + } else if (!q.equals(other.q)) + return false; return true; } diff --git a/base/util/src/netscape/security/x509/CertificateAlgorithmId.java b/base/util/src/netscape/security/x509/CertificateAlgorithmId.java index b1b14f42b..8e669b8f9 100644 --- a/base/util/src/netscape/security/x509/CertificateAlgorithmId.java +++ b/base/util/src/netscape/security/x509/CertificateAlgorithmId.java @@ -97,13 +97,11 @@ public class CertificateAlgorithmId implements CertAttrSet, Serializable { ", OID = " + (algId.getOID()).toString() + "\n"); } - private synchronized void writeObject(ObjectOutputStream stream) - throws IOException { + private void writeObject(ObjectOutputStream stream) throws IOException { encode(stream); } - private synchronized void readObject(ObjectInputStream stream) - throws IOException { + private void readObject(ObjectInputStream stream) throws IOException { decode(stream); } diff --git a/base/util/src/netscape/security/x509/CertificateExtensions.java b/base/util/src/netscape/security/x509/CertificateExtensions.java index 93be196ab..5fdac2824 100644 --- a/base/util/src/netscape/security/x509/CertificateExtensions.java +++ b/base/util/src/netscape/security/x509/CertificateExtensions.java @@ -170,13 +170,11 @@ public class CertificateExtensions extends Vector<Extension> } } - private synchronized void writeObject(ObjectOutputStream stream) - throws CertificateException, IOException { + private void writeObject(ObjectOutputStream stream) throws CertificateException, IOException { encode(stream); } - private synchronized void readObject(ObjectInputStream stream) - throws CertificateException, IOException { + private void readObject(ObjectInputStream stream) throws CertificateException, IOException { decodeEx(stream); } diff --git a/base/util/src/netscape/security/x509/CertificateSubjectName.java b/base/util/src/netscape/security/x509/CertificateSubjectName.java index 0f4ed7d61..f8dfe41f8 100644 --- a/base/util/src/netscape/security/x509/CertificateSubjectName.java +++ b/base/util/src/netscape/security/x509/CertificateSubjectName.java @@ -96,13 +96,11 @@ public class CertificateSubjectName implements CertAttrSet, Serializable { return (dnName.toString()); } - private synchronized void writeObject(ObjectOutputStream stream) - throws IOException { + private void writeObject(ObjectOutputStream stream) throws IOException { encode(stream); } - private synchronized void readObject(ObjectInputStream stream) - throws IOException { + private void readObject(ObjectInputStream stream) throws IOException { decodeEx(stream); } diff --git a/base/util/src/netscape/security/x509/CertificateValidity.java b/base/util/src/netscape/security/x509/CertificateValidity.java index 511f1b1eb..ae24979c5 100644 --- a/base/util/src/netscape/security/x509/CertificateValidity.java +++ b/base/util/src/netscape/security/x509/CertificateValidity.java @@ -42,9 +42,7 @@ import netscape.security.util.DerValue; * @see CertAttrSet */ public class CertificateValidity implements CertAttrSet, Serializable { - /** - * - */ + private static final long serialVersionUID = 8277703278213804194L; /** * Identifier for this attribute, to be used with the @@ -156,13 +154,11 @@ public class CertificateValidity implements CertAttrSet, Serializable { construct(derVal); } - private synchronized void writeObject(ObjectOutputStream stream) - throws IOException { + private void writeObject(ObjectOutputStream stream) throws IOException { encode(stream); } - private synchronized void readObject(ObjectInputStream stream) - throws IOException { + private void readObject(ObjectInputStream stream) throws IOException { decode(stream); } diff --git a/base/util/src/netscape/security/x509/CertificateX509Key.java b/base/util/src/netscape/security/x509/CertificateX509Key.java index a77a1e7dd..0b6f250d9 100644 --- a/base/util/src/netscape/security/x509/CertificateX509Key.java +++ b/base/util/src/netscape/security/x509/CertificateX509Key.java @@ -108,13 +108,11 @@ public class CertificateX509Key implements CertAttrSet, Serializable { key = X509Key.parse(val); } - private synchronized void writeObject(ObjectOutputStream stream) - throws IOException { + private void writeObject(ObjectOutputStream stream) throws IOException { encode(stream); } - private synchronized void readObject(ObjectInputStream stream) - throws IOException { + private void readObject(ObjectInputStream stream) throws IOException { decode(stream); } @@ -142,7 +140,7 @@ public class CertificateX509Key implements CertAttrSet, Serializable { this.key = (X509Key) obj; } else { throw new IOException("Attribute name not recognized by " + - "CertAttrSet: CertificateX509Key."); + "CertAttrSet: CertificateX509Key."); } } @@ -154,7 +152,7 @@ public class CertificateX509Key implements CertAttrSet, Serializable { return (key); } else { throw new IOException("Attribute name not recognized by " + - "CertAttrSet: CertificateX509Key."); + "CertAttrSet: CertificateX509Key."); } } @@ -166,7 +164,7 @@ public class CertificateX509Key implements CertAttrSet, Serializable { key = null; } else { throw new IOException("Attribute name not recognized by " + - "CertAttrSet: CertificateX509Key."); + "CertAttrSet: CertificateX509Key."); } } diff --git a/base/util/src/netscape/security/x509/Extension.java b/base/util/src/netscape/security/x509/Extension.java index 8d575606a..c7b0aa887 100644 --- a/base/util/src/netscape/security/x509/Extension.java +++ b/base/util/src/netscape/security/x509/Extension.java @@ -51,9 +51,6 @@ import netscape.security.util.ObjectIdentifier; * @version 1.9 */ public class Extension implements Serializable { - /** - * - */ private static final long serialVersionUID = -643549610716024753L; protected ObjectIdentifier extensionId = null; protected boolean critical = false; diff --git a/base/util/src/netscape/security/x509/RevokedCertImpl.java b/base/util/src/netscape/security/x509/RevokedCertImpl.java index df3bc37a8..eac11f8e3 100755 --- a/base/util/src/netscape/security/x509/RevokedCertImpl.java +++ b/base/util/src/netscape/security/x509/RevokedCertImpl.java @@ -432,8 +432,7 @@ public class RevokedCertImpl extends RevokedCertificate implements Serializable * they're parsed when they get read back. (Actually they serialize as some * type data from the serialization subsystem, then the cert data.) */ - private synchronized void writeObject(ObjectOutputStream stream) - throws CRLException, X509ExtensionException, IOException { + private void writeObject(ObjectOutputStream stream) throws CRLException, X509ExtensionException, IOException { DerOutputStream dos = new DerOutputStream(); encode(dos); dos.derEncode(stream); @@ -443,8 +442,7 @@ public class RevokedCertImpl extends RevokedCertificate implements Serializable * Serialization read ... X.509 certificates serialize as themselves, and * they're parsed when they get read back. */ - private synchronized void readObject(ObjectInputStream stream) - throws CRLException, X509ExtensionException, IOException { + private void readObject(ObjectInputStream stream) throws CRLException, X509ExtensionException, IOException { decode(stream); } diff --git a/base/util/src/netscape/security/x509/X509Cert.java b/base/util/src/netscape/security/x509/X509Cert.java index ea1e26deb..021cae207 100644 --- a/base/util/src/netscape/security/x509/X509Cert.java +++ b/base/util/src/netscape/security/x509/X509Cert.java @@ -831,9 +831,7 @@ public class X509Cert implements Certificate, Serializable { * (Actually they serialize as some type data from the * serialization subsystem, then the cert data.) */ - private synchronized void - writeObject(java.io.ObjectOutputStream stream) - throws IOException { + private void writeObject(java.io.ObjectOutputStream stream) throws IOException { encode(stream); } @@ -841,9 +839,7 @@ public class X509Cert implements Certificate, Serializable { * Serialization read ... X.509 certificates serialize as * themselves, and they're parsed when they get read back. */ - private synchronized void - readObject(ObjectInputStream stream) - throws IOException { + private void readObject(ObjectInputStream stream) throws IOException { decode(stream); } } diff --git a/base/util/src/netscape/security/x509/X509CertImpl.java b/base/util/src/netscape/security/x509/X509CertImpl.java index b6d97da38..2d24b6659 100755 --- a/base/util/src/netscape/security/x509/X509CertImpl.java +++ b/base/util/src/netscape/security/x509/X509CertImpl.java @@ -1149,8 +1149,7 @@ public class X509CertImpl extends X509Certificate * (Actually they serialize as some type data from the * serialization subsystem, then the cert data.) */ - private synchronized void writeObject(ObjectOutputStream stream) - throws CertificateException, IOException { + private void writeObject(ObjectOutputStream stream) throws CertificateException, IOException { encode(stream); } @@ -1158,8 +1157,7 @@ public class X509CertImpl extends X509Certificate * Serialization read ... X.509 certificates serialize as * themselves, and they're parsed when they get read back. */ - private synchronized void readObject(ObjectInputStream stream) - throws CertificateException, IOException { + private void readObject(ObjectInputStream stream) throws CertificateException, IOException { decode(stream); } diff --git a/base/util/src/netscape/security/x509/X509CertInfo.java b/base/util/src/netscape/security/x509/X509CertInfo.java index 6ad4d243f..2ad17ebc0 100644 --- a/base/util/src/netscape/security/x509/X509CertInfo.java +++ b/base/util/src/netscape/security/x509/X509CertInfo.java @@ -796,8 +796,7 @@ public class X509CertInfo implements CertAttrSet, Serializable { * (Actually they serialize as some type data from the * serialization subsystem, then the cert data.) */ - private synchronized void writeObject(ObjectOutputStream stream) - throws CertificateException, IOException { + private void writeObject(ObjectOutputStream stream) throws CertificateException, IOException { encode(stream); } @@ -805,8 +804,7 @@ public class X509CertInfo implements CertAttrSet, Serializable { * Serialization read ... X.509 certificates serialize as * themselves, and they're parsed when they get read back. */ - private synchronized void readObject(ObjectInputStream stream) - throws CertificateException, IOException { + private void readObject(ObjectInputStream stream) throws CertificateException, IOException { decode(stream); } diff --git a/base/util/src/netscape/security/x509/X509Key.java b/base/util/src/netscape/security/x509/X509Key.java index 5c8ac3a88..7af1036ea 100644 --- a/base/util/src/netscape/security/x509/X509Key.java +++ b/base/util/src/netscape/security/x509/X509Key.java @@ -354,9 +354,7 @@ public class X509Key implements PublicKey { * Serialization write ... X.509 keys serialize as * themselves, and they're parsed when they get read back. */ - private synchronized void - writeObject(java.io.ObjectOutputStream stream) - throws IOException { + private void writeObject(java.io.ObjectOutputStream stream) throws IOException { stream.write(getEncoded()); } @@ -364,17 +362,12 @@ public class X509Key implements PublicKey { * Serialization read ... X.509 keys serialize as * themselves, and they're parsed when they get read back. */ - private synchronized void - readObject(ObjectInputStream stream) - throws IOException { - + private void readObject(ObjectInputStream stream) throws IOException { try { decode(stream); - } catch (InvalidKeyException e) { e.printStackTrace(); - throw new IOException("deserialized key is invalid: " + - e.getMessage()); + throw new IOException("deserialized key is invalid: " + e.getMessage()); } } |