[cp-patches] [jessie-nio] re-factor accessors; expand tests

Casey Marshall csm at gnu.org
Tue Mar 28 06:38:56 UTC 2006


This changes most instances of `getThing' accessors with `thing.'  
E.g., instead of `int getLength(),' it is `int length().' Also, I've  
expanded some of the tests so they print all PASSes, as well as the  
FAILs.

2006-03-27  Casey Marshall  <csm at gnu.org>

	* jessie-tests/run-tests.sh: log test name to `check.log'.
	* jessie-tests/gnu/javax/net/ssl/provider/testAlert.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testCertificate.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testCertificateRequest.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testCipherSuiteList.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testClientHello.java,
	* jessie-tests/gnu/javax/net/ssl/provider/ 
testCompressionMethodList.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testHelloRequest.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testRecord.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testServerDHParams.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testServerHello.java,
	* jessie-tests/gnu/javax/net/ssl/provider/testServerRSAParams.java:
	Ensure that tests mention PASSes; use new accessors.
	* gnu/javax/net/ssl/provider/Alert.java,
	* gnu/javax/net/ssl/provider/Certificate.java,
	* gnu/javax/net/ssl/provider/CertificateRequest.java,
	* gnu/javax/net/ssl/provider/CipherSuite.java,
	* gnu/javax/net/ssl/provider/CipherSuiteList.java,
	* gnu/javax/net/ssl/provider/ClientCertificateTypeList.java,
	* gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java,
	* gnu/javax/net/ssl/provider/ClientHello.java,
	* gnu/javax/net/ssl/provider/ClientKeyExchange.java,
	* gnu/javax/net/ssl/provider/CompressionMethodList.java,
	* gnu/javax/net/ssl/provider/Constructed.java,
	* gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java,
	* gnu/javax/net/ssl/provider/Finished.java,
	* gnu/javax/net/ssl/provider/GenericBlockCipher.java,
	* gnu/javax/net/ssl/provider/GenericStreamCipher.java,
	* gnu/javax/net/ssl/provider/Handshake.java,
	* gnu/javax/net/ssl/provider/HelloRequest.java,
	* gnu/javax/net/ssl/provider/InputSecurityParameters.java,
	* gnu/javax/net/ssl/provider/OutputSecurityParameters.java,
	* gnu/javax/net/ssl/provider/ProtocolVersion.java,
	* gnu/javax/net/ssl/provider/Random.java,
	* gnu/javax/net/ssl/provider/Record.java,
	* gnu/javax/net/ssl/provider/ServerDHParams.java,
	* gnu/javax/net/ssl/provider/ServerHello.java,
	* gnu/javax/net/ssl/provider/ServerHelloDone.java,
	* gnu/javax/net/ssl/provider/ServerKeyExchange.java,
	* gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java,
	* gnu/javax/net/ssl/provider/ServerRSAParams.java,
	* gnu/javax/net/ssl/provider/Signature.java,
	* gnu/javax/net/ssl/provider/X500PrincipalList.java: replace
	`getThing' accessor methods with `thing.'

-------------- next part --------------
? jessie-tests/check.err
? jessie-tests/check.log
? jessie-tests/check.out
? jessie-tests/test-classes
? jessie-tests/gnu/javax/net/ssl/provider/testServerKeyExchange.java
? jessie-tests/gnu/javax/net/ssl/provider/xx00
? gnu/javax/net/ssl/SSLRecordHandler.java
? gnu/javax/net/ssl/provider/SSLEngineImpl.java
? gnu/javax/net/ssl/provider/SSLHandshake.java
? gnu/javax/net/ssl/provider/cvs.stat
Index: jessie-tests/run-tests.sh
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/Attic/run-tests.sh,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 run-tests.sh
--- jessie-tests/run-tests.sh	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/run-tests.sh	28 Mar 2006 06:19:03 -0000
@@ -28,6 +28,7 @@
 for test in $tests
 do
   echo $test
+  echo ---- $test ---- >> check.log
   echo ---- $test ---- >> check.err
   if `(${JAVA} ${JAVA_OPTIONS} -cp ${CLASSPATH}:test-classes $test 2>> check.err || echo FAIL: $test) | tee -a check.log | grep -q ^FAIL > /dev/null`
       then
Index: jessie-tests/gnu/javax/net/ssl/provider/testAlert.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testAlert.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testAlert.java
--- jessie-tests/gnu/javax/net/ssl/provider/testAlert.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testAlert.java	28 Mar 2006 06:19:03 -0000
@@ -8,41 +8,48 @@
 {
   public static void main (String[] argv)
   {
-    Alert a1 = new Alert (ByteBuffer.allocate (2));
     try
       {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
+    Alert a1 = new Alert (ByteBuffer.allocate (2));
+   
         a1.setLevel (Alert.Level.WARNING);
         System.out.println ("PASS: setLevel()");
         a1.setDescription (Alert.Description.UNEXPECTED_MESSAGE);
         System.out.println ("PASS: setDescription()");
-      }
-    catch (Throwable t)
-      {
-        System.out.println ("FAIL: " + t);
-        t.printStackTrace ();
-        System.exit (1);
-      }
 
     Alert a2 = new Alert (ByteBuffer.allocate (2));
-    try
-      {
+
         a2.setLevel (Alert.Level.WARNING);
         System.out.println ("PASS: setLevel()");
         a2.setDescription (Alert.Description.UNEXPECTED_MESSAGE);
         System.out.println ("PASS: setDescription()");
-      }
-    catch (Throwable t)
-      {
-        System.out.println ("FAIL: " + t);
-        t.printStackTrace ();
-        System.exit (1);
-      }
 
     if (a1.equals (a2))
       System.out.println ("PASS: equals()");
     else
       System.out.println ("FAIL: equals()");
 
+    if (a1.level () == Alert.Level.WARNING)
+      System.out.println ("PASS: level");
+    else
+      System.out.println ("FAIL: level");
+
+    if (a1.description () == Alert.Description.UNEXPECTED_MESSAGE)
+      System.out.println ("PASS: description");
+    else
+      System.out.println ("FAIL: description");
+
     System.err.println (a1);
   }
 }
Index: jessie-tests/gnu/javax/net/ssl/provider/testCertificate.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testCertificate.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testCertificate.java
--- jessie-tests/gnu/javax/net/ssl/provider/testCertificate.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testCertificate.java	28 Mar 2006 06:19:03 -0000
@@ -7,6 +7,7 @@
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 import java.util.Collections;
+import java.util.List;
 
 class testCertificate
 {
@@ -28,6 +29,19 @@
 
   public static void main (String[] argv) throws Throwable
   {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
     final int alloc_len = 4096;
     CertificateFactory factory = CertificateFactory.getInstance ("X.509");
     X509Certificate cert = (X509Certificate)
@@ -38,9 +52,19 @@
     handshake.setType (Handshake.Type.CERTIFICATE);
     handshake.setLength (alloc_len - 4);
 
-    Certificate _cert = (Certificate) handshake.getBody ();
+    Certificate _cert = (Certificate) handshake.body ();
     _cert.setCertificates (Collections.singletonList (cert));
-    System.err.println (_cert.getCertificates ());
+    System.err.println (_cert.certificates ());
     System.err.println (_cert);
+    handshake.setLength (_cert.length ());
+
+    Handshake handshake2 = new Handshake (buffer);
+    Certificate _cert2 = (Certificate) handshake2.body ();
+    List certs = _cert2.certificates ();
+
+    if (cert.equals (certs.get (0)))
+      System.out.println ("PASS: equals()");
+    else
+      System.out.println ("FAIL: equals()");
   }
 }
Index: jessie-tests/gnu/javax/net/ssl/provider/testCertificateRequest.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testCertificateRequest.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testCertificateRequest.java
--- jessie-tests/gnu/javax/net/ssl/provider/testCertificateRequest.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testCertificateRequest.java	28 Mar 2006 06:19:03 -0000
@@ -9,6 +9,19 @@
 {
   public static void main (String[] argv) throws Throwable
   {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
     ByteBuffer buffer = ByteBuffer.allocate (4096);
     System.err.println ("create X500Principal...");
     X500Principal name = new X500Principal ("C=US,ST=MA,L=Boston,O=FSF,OU=Certificate Authority,CN=savannah.gnu.org");
@@ -16,7 +29,7 @@
     CertificateRequest req = new CertificateRequest (buffer);
 
     System.err.println ("getting types...");
-    ClientCertificateTypeList types = req.getTypes ();
+    ClientCertificateTypeList types = req.types ();
     types.setSize (4);
     System.err.println ("adding types...");
     types.put (0, CertificateRequest.ClientCertificateType.DSS_FIXED_DH);
@@ -25,12 +38,24 @@
     types.put (3, CertificateRequest.ClientCertificateType.RSA_SIGN);
 
     System.err.println ("getting names...");
-    X500PrincipalList names = req.getAuthorities ();
+    X500PrincipalList names = req.authorities ();
     byte[] bytes = name.getEncoded ();
     names.setSize (1, bytes.length);
     System.err.println ("putting name...");
     names.put (0, bytes);
 
     System.err.println (req);
+
+    CertificateRequest req2 = new CertificateRequest (buffer);
+    ClientCertificateTypeList types2 = req2.types ();
+    X500PrincipalList names2 = req2.authorities ();
+    if (types2.equals (types))
+      System.out.println ("PASS: equals(types)");
+    else
+      System.out.println ("FAIL: equals(types)");
+    if (names2.equals (names))
+      System.out.println ("PASS: equals(names)");
+    else
+      System.out.println ("FAIL: equals(names)");
   }
 }
Index: jessie-tests/gnu/javax/net/ssl/provider/testCipherSuiteList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testCipherSuiteList.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testCipherSuiteList.java
--- jessie-tests/gnu/javax/net/ssl/provider/testCipherSuiteList.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testCipherSuiteList.java	28 Mar 2006 06:19:03 -0000
@@ -24,5 +24,12 @@
       }
 
     System.err.println (list);
+
+    CipherSuiteList list2 = new CipherSuiteList (buffer);
+
+    if (list2.equals (list))
+      System.out.println ("PASS: equals()");
+    else
+      System.out.println ("FAIL: equals()");
   }
 }
Index: jessie-tests/gnu/javax/net/ssl/provider/testClientHello.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testClientHello.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testClientHello.java
--- jessie-tests/gnu/javax/net/ssl/provider/testClientHello.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testClientHello.java	28 Mar 2006 06:19:03 -0000
@@ -9,6 +9,19 @@
 {
   public static void main (String[] argv)
   {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
     final int alloc_len = 4096;
     ByteBuffer buffer = ByteBuffer.allocate (alloc_len);
     Handshake handshake = new Handshake (buffer);
@@ -17,16 +30,7 @@
     handshake.setLength (alloc_len - 4);
 
     ClientHello hello = null;
-    try
-      {
-        hello = (ClientHello) handshake.getBody ();
-      }
-    catch (Exception x)
-      {
-        x.printStackTrace (System.err);
-        System.out.println ("FAIL: " + x);
-        System.exit (1);
-      }
+    hello = (ClientHello) handshake.body ();
 
     byte[] sessionId = new byte[32];
     for (int i = 0; i < 32; i++)
@@ -35,14 +39,14 @@
     hello.setProtocolVersion (ProtocolVersion.TLS_1);
     hello.setSessionId (sessionId);
 
-    Random random = hello.getRandom ();
-    random.setGMTUnixTime (123456);
+    Random random = hello.random ();
+    random.setGmtUnixTime (123456);
     byte[] nonce = new byte [28];
     for (int i = 0; i < nonce.length; i++)
       nonce[i] = (byte) i;
     random.setRandomBytes (nonce);
 
-    CipherSuiteList suites = hello.getCipherSuites ();
+    CipherSuiteList suites = hello.cipherSuites ();
     suites.setSize (10);
     suites.put (0, CipherSuite.TLS_NULL_WITH_NULL_NULL);
     suites.put (1, CipherSuite.TLS_RSA_WITH_NULL_MD5);
@@ -55,21 +59,41 @@
     suites.put (8, CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA);
     suites.put (9, CipherSuite.TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA);
 
-    CompressionMethodList comps = hello.getCompressionMethods ();
+    CompressionMethodList comps = hello.compressionMethods ();
     comps.setSize (2);
     comps.put (0, CompressionMethod.NULL);
     comps.put (1, CompressionMethod.ZLIB);
 
     hello.setExtensionsLength (0);
-    handshake.setLength (hello.getLength ());
+    handshake.setLength (hello.length ());
+
+    handshake = new Handshake (buffer);
 
-    hello = (ClientHello) handshake.getBody ();
-    if (!ProtocolVersion.TLS_1.equals (hello.getProtocolVersion ()))
-      System.out.println ("FAIL: getProtocolVersion ()");
-    if (hello.getRandom ().getGMTUnixTime () != 123456)
-      System.out.println ("FAIL: getRandom ().getGMTUnixTime ()");
-    if (!Arrays.equals (nonce, hello.getRandom ().getRandomBytes ()))
-      System.out.println ("FAIL: getRandom ().getRandomBytes ()");
+    hello = (ClientHello) handshake.body ();
+    if (ProtocolVersion.TLS_1.equals (hello.protocolVersion ()))
+      System.out.println ("PASS: protocolVersion ()");
+    else
+      System.out.println ("FAIL: protocolVersion ()");
+
+    if (hello.random ().gmtUnixTime () == 123456)
+      System.out.println ("PASS: random ().gmtUnixTime ()");
+    else
+      System.out.println ("FAIL: random ().gmtUnixTime ()");
+
+    if (Arrays.equals (nonce, hello.random ().randomBytes ()))
+      System.out.println ("PASS: random ().randomBytes ()");
+    else
+      System.out.println ("FAIL: random ().randomBytes ()");
+
+    if (suites.equals (hello.cipherSuites ()))
+      System.out.println ("PASS: cipherSuites()");
+    else
+      System.out.println ("FAIL: cipherSuites()");
+
+    if (comps.equals (hello.compressionMethods ()))
+      System.out.println ("PASS: compressionMethods()");
+    else
+      System.out.println ("FAIL: compressionMethods()");
 
     System.err.println (handshake);
   }
Index: jessie-tests/gnu/javax/net/ssl/provider/testCompressionMethodList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testCompressionMethodList.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testCompressionMethodList.java
--- jessie-tests/gnu/javax/net/ssl/provider/testCompressionMethodList.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testCompressionMethodList.java	28 Mar 2006 06:19:03 -0000
@@ -8,7 +8,20 @@
 
 class testCompressionMethodList
 {
-  public static void main (String[] argv) throws Exception
+  public static void main (String[] argv)
+  {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: uncaught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
   {
     ByteBuffer buffer = ByteBuffer.allocate (3);
     CompressionMethodList list = new CompressionMethodList (buffer);
@@ -16,6 +29,13 @@
     list.setSize (2);
     list.put (0, CompressionMethod.NULL);
     list.put (1, CompressionMethod.ZLIB);
+
     System.err.println (list);
+
+    CompressionMethodList list2 = new CompressionMethodList (buffer);
+    if (list2.equals (list))
+      System.out.println ("PASS: equals()");
+    else
+      System.out.println ("FAIL: equals()");
   }
 }
Index: jessie-tests/gnu/javax/net/ssl/provider/testHelloRequest.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testHelloRequest.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testHelloRequest.java
--- jessie-tests/gnu/javax/net/ssl/provider/testHelloRequest.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testHelloRequest.java	28 Mar 2006 06:19:03 -0000
@@ -6,16 +6,28 @@
 
 class testHelloRequest
 {
-  public static void main (String[] argv) throws Throwable
+  public static void main (String[] argv)
+  {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
   {
     ByteBuffer buffer = ByteBuffer.allocate (4);
     Handshake handshake = new Handshake (buffer);
     handshake.setType (Handshake.Type.HELLO_REQUEST);
     handshake.setLength (0);
-    Handshake.Body body = handshake.getBody ();
+    HelloRequest body = (HelloRequest) handshake.body ();
 
-    if (!(body instanceof HelloRequest))
-      System.out.println ("FAIL: " + body.getClass ());
+    System.out.println ("PASS: body");
 
     System.err.println (handshake);
   }
Index: jessie-tests/gnu/javax/net/ssl/provider/testRecord.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testRecord.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testRecord.java
--- jessie-tests/gnu/javax/net/ssl/provider/testRecord.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testRecord.java	28 Mar 2006 06:19:03 -0000
@@ -9,57 +9,55 @@
 {
   public static void main (final String[] argv)
   {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
     ByteBuffer buf = ByteBuffer.allocate (42 + 5);
     Record record = new Record (buf);
     byte[] fragment = new byte[42];
     new java.util.Random (31337).nextBytes (fragment);
-    try
-      {
+
         record.setVersion (ProtocolVersion.TLS_1);
         System.out.println ("PASS: setVersion");
         record.setContentType (ContentType.APPLICATION_DATA);
         System.out.println ("PASS: setContentType");
         record.setLength (42);
         System.out.println ("PASS: setLength");
-      }
-    catch (Throwable t)
-      {
-        System.out.println ("FAIL: " + t);
-        System.exit (1);
-      }
 
-    try
-      {
-        record.getFragment ().put (fragment);
-        System.out.println ("PASS: getFragment ().put ()");
-      }
-    catch (Throwable t)
-      {
-        System.out.println ("FAIL: " + t);
-        System.exit (1);
-      }
+    record.fragment ().put (fragment);
+    System.out.println ("PASS: fragment ().put ()");
 
-    if (ProtocolVersion.TLS_1.equals (record.getVersion ()))
-      System.out.println ("PASS: getVersion()");
+    if (ProtocolVersion.TLS_1.equals (record.version ()))
+      System.out.println ("PASS: version()");
     else
-      System.out.println ("FAIL: getVersion()");
+      System.out.println ("FAIL: version()");
 
-    if (ContentType.APPLICATION_DATA.equals (record.getContentType ()))
-      System.out.println ("PASS: getContentType()");
+    if (ContentType.APPLICATION_DATA.equals (record.contentType ()))
+      System.out.println ("PASS: contentType()");
     else
-      System.out.println ("FAIL: getContentType()");
+      System.out.println ("FAIL: contentType()");
 
-    if (record.getLength () == 42)
-      System.out.println ("PASS: getLength()");
+    if (record.length () == 42)
+      System.out.println ("PASS: length()");
     else
-      System.out.println ("FAIL: getLength()");
+      System.out.println ("FAIL: length()");
 
     byte[] fragment2 = new byte[42];
-    record.getFragment ().get (fragment2);
+    record.fragment ().get (fragment2);
     if (Arrays.equals (fragment, fragment2))
-      System.out.println ("PASS: getFragment ().get ()");
+      System.out.println ("PASS: fragment ().get ()");
     else
-      System.out.println ("FAIL: getFragment ().get ()");
+      System.out.println ("FAIL: fragment ().get ()");
 
     System.err.println (record);
   }
Index: jessie-tests/gnu/javax/net/ssl/provider/testServerDHParams.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testServerDHParams.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testServerDHParams.java
--- jessie-tests/gnu/javax/net/ssl/provider/testServerDHParams.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testServerDHParams.java	28 Mar 2006 06:19:03 -0000
@@ -9,6 +9,19 @@
 {
   public static void main (String[] argv) throws Throwable
   {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
     BigInteger p = new BigInteger ("1234567890abcdef1234567890abcdef1234567890abcdef", 16);
     BigInteger g = BigInteger.valueOf (2);
     BigInteger y = new BigInteger ("fedcba0987654321fedcba0987654321fedcba0987654321", 16);
@@ -20,12 +33,20 @@
     params.setG (g);
     params.setY (y);
 
-    if (!params.getP ().equals (p))
-      System.out.println ("FAIL: " + p + " != " + params.getP ());
-    if (!params.getG ().equals (g))
-      System.out.println ("FAIL: " + g + " != " + params.getG ());
-    if (!params.getY ().equals (y))
-      System.out.println ("FAIL: " + y + " != " + params.getY ());
+    if (params.p ().equals (p))
+      System.out.println ("PASS: p");
+    else
+      System.out.println ("FAIL: " + p + " != " + params.p ());
+
+    if (params.g ().equals (g))
+      System.out.println ("PASS: g");
+    else
+      System.out.println ("FAIL: " + g + " != " + params.g ());
+
+    if (params.y ().equals (y))
+      System.out.println ("PASS: y");
+    else
+      System.out.println ("FAIL: " + y + " != " + params.y ());
 
     System.err.println (params);
   }
Index: jessie-tests/gnu/javax/net/ssl/provider/testServerHello.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testServerHello.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testServerHello.java
--- jessie-tests/gnu/javax/net/ssl/provider/testServerHello.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testServerHello.java	28 Mar 2006 06:19:03 -0000
@@ -3,10 +3,24 @@
 package gnu.javax.net.ssl.provider;
 
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 
 class testServerHello
 {
-  public static void main (String[] argv) throws Exception
+  public static void main (String[] argv)
+  {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
   {
     final int alloc_len = 4096;
     ByteBuffer buffer = ByteBuffer.allocate (alloc_len);
@@ -15,11 +29,11 @@
     handshake.setType (Handshake.Type.SERVER_HELLO);
     handshake.setLength (alloc_len - 4);
 
-    ServerHello hello = (ServerHello) handshake.getBody ();
+    ServerHello hello = (ServerHello) handshake.body ();
 
     hello.setProtocolVersion (ProtocolVersion.TLS_1);
-    Random random = hello.getRandom ();
-    random.setGMTUnixTime (123456);
+    Random random = hello.random ();
+    random.setGmtUnixTime (123456);
     byte[] nonce = new byte[28];
     for (int i = 0; i < nonce.length; i++)
       nonce[i] = (byte) i;
@@ -32,7 +46,24 @@
     hello.setCompressionMethod (CompressionMethod.ZLIB);
     hello.setExtensionsLength (0);
 
-    handshake.setLength (hello.getLength ());
+    handshake.setLength (hello.length ());
     System.err.println (handshake);
+
+    handshake = new Handshake (buffer);
+    hello = (ServerHello) handshake.body ();
+    if (Arrays.equals (sessionId, hello.sessionId ()))
+      System.out.println ("PASS: sessionId");
+    else
+      System.out.println ("FAIL: sessionId");
+
+    if (hello.cipherSuite () == CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA)
+      System.out.println ("PASS: cipherSuite");
+    else
+      System.out.println ("FAIL: cipherSuite");
+
+    if (hello.compressionMethod () == CompressionMethod.ZLIB)
+      System.out.println ("PASS: compressionMethod");
+    else
+      System.out.println ("FAIL: compressionMethod");
   }
 }
Index: jessie-tests/gnu/javax/net/ssl/provider/testServerRSAParams.java
===================================================================
RCS file: /cvsroot/classpath/classpath/jessie-tests/gnu/javax/net/ssl/provider/Attic/testServerRSAParams.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 testServerRSAParams.java
--- jessie-tests/gnu/javax/net/ssl/provider/testServerRSAParams.java	27 Mar 2006 04:04:02 -0000	1.1.2.1
+++ jessie-tests/gnu/javax/net/ssl/provider/testServerRSAParams.java	28 Mar 2006 06:19:03 -0000
@@ -9,6 +9,19 @@
 {
   public static void main (String[] argv) throws Throwable
   {
+    try
+      {
+        check ();
+      }
+    catch (Exception x)
+      {
+        System.out.println ("FAIL: caught exception " + x);
+        x.printStackTrace ();
+      }
+  }
+
+  static void check () throws Exception
+  {
     BigInteger modulus = new BigInteger ("1234567890abcdef1234567890abcdef1234567890abcdef", 16);
     BigInteger exponent = BigInteger.valueOf (0xff);
     ByteBuffer buffer = ByteBuffer.allocate (1024);
@@ -18,10 +31,17 @@
     params.setModulus (modulus);
     params.setExponent (exponent);
 
-    if (!params.getModulus ().equals (modulus))
-      System.out.println ("FAIL: " + modulus + " != " + params.getModulus ());
-    if (!params.getExponent ().equals (exponent))
-      System.out.println ("FAIL: " + exponent + " != " + params.getExponent ());
+    params = new ServerRSAParams (buffer);
+
+    if (params.modulus ().equals (modulus))
+      System.out.println ("PASS: modulus");
+    else
+      System.out.println ("FAIL: " + modulus + " != " + params.modulus ());
+
+    if (params.exponent ().equals (exponent))
+      System.out.println ("PASS: exponent");
+    else
+      System.out.println ("FAIL: " + exponent + " != " + params.exponent ());
 
     System.err.println (params);
   }
Index: gnu/javax/net/ssl/provider/Alert.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Alert.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Alert.java
--- gnu/javax/net/ssl/provider/Alert.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Alert.java	28 Mar 2006 06:19:03 -0000
@@ -77,7 +77,7 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  public int getLength ()
+  public int length ()
   {
     return 2;
   }
@@ -90,12 +90,12 @@
     return buf;
   }
 
-  Level getLevel()
+  Level level()
   {
     return Level.forInteger (buffer.get (0) & 0xFF);
   }
 
-  Description getDescription()
+  Description description()
   {
     return Description.forInteger (buffer.get (1) & 0xFF);
   }
@@ -136,11 +136,11 @@
     out.println ("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  level:       ");
-    out.print (getLevel ());
+    out.print (level ());
     out.println (";");
     if (prefix != null) out.print (prefix);
     out.print ("  description: ");
-    out.print (getDescription ());
+    out.print (description ());
     out.println (";");
     if (prefix != null) out.print (prefix);
     out.print ("} Alert;");
Index: gnu/javax/net/ssl/provider/Certificate.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Certificate.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Certificate.java
--- gnu/javax/net/ssl/provider/Certificate.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Certificate.java	28 Mar 2006 06:19:03 -0000
@@ -86,13 +86,13 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  public int getLength ()
+  public int length ()
   {
     return (((buffer.get (0) & 0xFF) << 24)
             | buffer.getShort (1)) + 3;
   }
 
-  List getCertificates ()
+  List certificates ()
     throws CertificateException, NoSuchAlgorithmException
   {
     LinkedList list = new LinkedList ();
@@ -147,7 +147,7 @@
     out.println ("struct {");
     try
       {
-        List certs = getCertificates ();
+        List certs = certificates ();
         if (prefix != null)
           out.print (prefix);
         out.print ("  certificateList: [");
Index: gnu/javax/net/ssl/provider/CertificateRequest.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/CertificateRequest.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 CertificateRequest.java
--- gnu/javax/net/ssl/provider/CertificateRequest.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/CertificateRequest.java	28 Mar 2006 06:19:03 -0000
@@ -86,18 +86,18 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  public int getLength ()
+  public int length ()
   {
     int o1 = (buffer.get (0) & 0xFF) + 1;
     return o1 + (buffer.getShort (o1) & 0xFFFF) + 2;
   }
 
-  ClientCertificateTypeList getTypes ()
+  ClientCertificateTypeList types ()
   {
     return new ClientCertificateTypeList (buffer.duplicate ());
   }
 
-  X500PrincipalList getAuthorities ()
+  X500PrincipalList authorities ()
   {
     int offset = (buffer.get (0) & 0xFF) + 1;
     return new X500PrincipalList (((ByteBuffer) buffer.position (offset)).slice ());
@@ -118,10 +118,10 @@
     out.println("struct {");
     if (prefix != null) out.print (prefix);
     out.println ("  types =");
-    out.println (getTypes ().toString (subprefix));
+    out.println (types ().toString (subprefix));
     if (prefix != null) out.print (prefix);
     out.println("  authorities =");
-    out.println (getAuthorities ().toString (subprefix));
+    out.println (authorities ().toString (subprefix));
     if (prefix != null) out.print (prefix);
     out.print ("} CertificateRequest;");
     return str.toString();
Index: gnu/javax/net/ssl/provider/CipherSuite.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/CipherSuite.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 CipherSuite.java
--- gnu/javax/net/ssl/provider/CipherSuite.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/CipherSuite.java	28 Mar 2006 06:19:03 -0000
@@ -902,12 +902,12 @@
   // Intance methods.
   // -------------------------------------------------------------------------
 
-  CipherAlgorithm getCipherAlgorithm ()
+  CipherAlgorithm cipherAlgorithm ()
   {
     return cipherAlgorithm;
   }
 
-  Cipher getCipher () throws NoSuchAlgorithmException, NoSuchPaddingException
+  Cipher cipher () throws NoSuchAlgorithmException, NoSuchPaddingException
   {
     if (cipherAlgorithm == null)
       throw new NoSuchAlgorithmException (toString () + ": unresolved cipher suite");
@@ -918,7 +918,7 @@
     if (cipherAlgorithm == CipherAlgorithm.RC4)
       alg = "RC4";
     else
-      alg = cipherAlgorithm + "/CBC/SSL3Padding";
+      alg = cipherAlgorithm + "/CBC/NoPadding";
     GetSecurityPropertyAction gspa =
       new GetSecurityPropertyAction ("jessie.jce.provider");
     final String provider = (String) AccessController.doPrivileged (gspa);
@@ -940,7 +940,7 @@
     return macAlgorithm;
   }
 
-  Mac getMac () throws NoSuchAlgorithmException
+  Mac mac () throws NoSuchAlgorithmException
   {
     if (macAlgorithm == null)
       throw new NoSuchAlgorithmException (toString () + ": unresolved cipher suite");
@@ -962,12 +962,12 @@
     return Mac.getInstance (macAlgorithm.toString ());
   }
 
-  SignatureAlgorithm getSignatureAlgorithm ()
+  SignatureAlgorithm signatureAlgorithm ()
   {
     return signatureAlgorithm;
   }
 
-  KeyExchangeAlgorithm getKeyExchangeAlgorithm ()
+  KeyExchangeAlgorithm keyExchangeAlgorithm ()
   {
     return keyExchangeAlgorithm;
   }
@@ -977,7 +977,7 @@
     return ephemeralDH;
   }
 
-  public int getLength ()
+  public int length ()
   {
     return 2;
   }
@@ -1101,7 +1101,7 @@
     return this;
   }
 
-  int getKeyLength()
+  int keyLength()
   {
     return keyLength;
   }
@@ -1129,12 +1129,12 @@
 //     return kexName + "_" + sigName;
 //   }
 
-  byte[] getId()
+  byte[] id()
   {
     return id;
   }
 
-  ProtocolVersion getVersion()
+  ProtocolVersion version()
   {
     return version;
   }
@@ -1147,7 +1147,7 @@
       }
     if (o == this)
       return true;
-    byte[] id = ((CipherSuite) o).getId();
+    byte[] id = ((CipherSuite) o).id();
     return (id[0] == this.id[0] &&
             id[1] == this.id[1]);
   }
@@ -1158,7 +1158,7 @@
       {
         return 0xFFFF0000 | (id[0] & 0xFF) << 8 | (id[1] & 0xFF);
       }
-    return (version.getMajor() << 24 | version.getMinor() << 16
+    return (version.major() << 24 | version.minor() << 16
             | (id[0] & 0xFF) << 8 | (id[1] & 0xFF));
   }
 
Index: gnu/javax/net/ssl/provider/CipherSuiteList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/CipherSuiteList.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 CipherSuiteList.java
--- gnu/javax/net/ssl/provider/CipherSuiteList.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/CipherSuiteList.java	28 Mar 2006 06:19:03 -0000
@@ -113,7 +113,7 @@
       throw new IndexOutOfBoundsException ("limit: " + size
                                            + "; requested: " + index);
     buffer.position (2 + (index << 1));
-    buffer.put (suite.getId ());
+    buffer.put (suite.id ());
     modCount++;
   }
 
@@ -173,6 +173,24 @@
     return str.toString ();
   }
 
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof CipherSuiteList))
+      return false;
+    CipherSuiteList that = (CipherSuiteList) o;
+
+    if (size () != that.size ())
+      return false;
+
+    for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+         it1.hasNext () && it2.hasNext (); )
+      {
+        if (!it1.next ().equals (it2.next ()))
+          return false;
+      }
+    return true;
+  }
+
   /**
    * An iterator for the elements in this list. The iterator supports
    * only the <code>set</code> method out of the optional methods,
Index: gnu/javax/net/ssl/provider/ClientCertificateTypeList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/ClientCertificateTypeList.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 ClientCertificateTypeList.java
--- gnu/javax/net/ssl/provider/ClientCertificateTypeList.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/ClientCertificateTypeList.java	28 Mar 2006 06:19:03 -0000
@@ -121,6 +121,24 @@
     return str.toString ();
   }
 
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof ClientCertificateTypeList))
+      return false;
+    ClientCertificateTypeList that = (ClientCertificateTypeList) o;
+
+    if (size () != that.size ())
+      return false;
+
+    for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+         it1.hasNext () && it2.hasNext (); )
+      {
+        if (!it1.next ().equals (it2.next ()))
+          return false;
+      }
+    return true;
+  }
+
   class Iterator implements ListIterator
   {
     private int index;
Index: gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/ClientDiffieHellmanPublic.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 ClientDiffieHellmanPublic.java
--- gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/ClientDiffieHellmanPublic.java	28 Mar 2006 06:19:03 -0000
@@ -63,9 +63,9 @@
     super (buffer);
   }
 
-  BigInteger getPublicValue ()
+  BigInteger publicValue ()
   {
-    int len = getLength ();
+    int len = length ();
     byte[] b = new byte[len];
     buffer.position (2);
     buffer.get (b);
@@ -87,7 +87,7 @@
     buffer.put (buf, offset, length);
   }
 
-  public int getLength ()
+  public int length ()
   {
     return buffer.getShort (0) & 0xFFFF;
   }
@@ -105,7 +105,7 @@
     out.println ("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  dh_Yc = ");
-    out.print (getPublicValue ().toString (16));
+    out.print (publicValue ().toString (16));
     out.println (';');
     if (prefix != null) out.print (prefix);
     out.print ("} ClientDiffieHellmanPublic;");
Index: gnu/javax/net/ssl/provider/ClientHello.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/ClientHello.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 ClientHello.java
--- gnu/javax/net/ssl/provider/ClientHello.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/ClientHello.java	28 Mar 2006 06:19:04 -0000
@@ -99,7 +99,7 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  public int getLength ()
+  public int length ()
   {
     return totalLength;
   }
@@ -109,7 +109,7 @@
    *
    * @return The protocol version field.
    */
-  ProtocolVersion getProtocolVersion()
+  ProtocolVersion protocolVersion()
   {
     return ProtocolVersion.getInstance (buffer.getShort (0));
   }
@@ -119,7 +119,7 @@
    *
    * @return The nonce.
    */
-  Random getRandom()
+  Random random()
   {
     ByteBuffer randomBuf =
       ((ByteBuffer) buffer.duplicate ().position (RANDOM_OFFSET)
@@ -127,7 +127,7 @@
     return new Random (randomBuf);
   }
 
-  byte[] getSessionId()
+  byte[] sessionId()
   {
     int idlen = buffer.get (SESSID_OFFSET) & 0xFF;
     byte[] sessionId = new byte[idlen];
@@ -136,7 +136,7 @@
     return sessionId;
   }
 
-  CipherSuiteList getCipherSuites()
+  CipherSuiteList cipherSuites()
   {
     int offset = getCipherSuitesOffset ();
 
@@ -145,10 +145,10 @@
     // the length field itself.
     ByteBuffer listBuf = ((ByteBuffer) buffer.duplicate ().position (offset)
                           .limit (buffer.capacity ())).slice ();
-    return new CipherSuiteList (listBuf, getProtocolVersion ());
+    return new CipherSuiteList (listBuf, protocolVersion ());
   }
 
-  CompressionMethodList getCompressionMethods()
+  CompressionMethodList compressionMethods()
   {
     int offset = getCompressionMethodsOffset ();
     ByteBuffer listBuf = ((ByteBuffer) buffer.duplicate ().position (offset)
@@ -156,7 +156,7 @@
     return new CompressionMethodList (listBuf);
   }
 
-  ByteBuffer getExtensions()
+  ByteBuffer extensions()
   {
     int offset = getExtensionsOffset ();
     return ((ByteBuffer) buffer.duplicate ().position (offset)
@@ -165,7 +165,7 @@
 
   void setProtocolVersion (final ProtocolVersion version)
   {
-    buffer.putShort (0, (short) version.getRawValue ());
+    buffer.putShort (0, (short) version.rawValue ());
   }
 
   void setSessionId (final byte[] buffer)
@@ -222,23 +222,23 @@
     if (prefix != null)
       out.print (prefix);
     out.print ("  version: ");
-    out.print (getProtocolVersion ());
+    out.print (protocolVersion ());
     out.println (";");
     out.print (subprefix);
     out.println ("random:");
-    out.print (getRandom ().toString (subprefix));
+    out.print (random ().toString (subprefix));
     if (prefix != null)
       out.print (prefix);
     out.print ("  sessionId: ");
-    out.print (Util.toHexString (getSessionId (), ':'));
+    out.print (Util.toHexString (sessionId (), ':'));
     out.println (";");
     out.print (subprefix);
     out.println ("cipher_suites:");
-    out.println (getCipherSuites ().toString (subprefix));
+    out.println (cipherSuites ().toString (subprefix));
     out.print (subprefix);
     out.println ("compression_methods:");
-    out.println (getCompressionMethods ().toString (subprefix));
-    ByteBuffer extbuf = getExtensions ();
+    out.println (compressionMethods ().toString (subprefix));
+    ByteBuffer extbuf = extensions ();
     if (extbuf.limit () > 0)
       {
         out.print (subprefix);
Index: gnu/javax/net/ssl/provider/ClientKeyExchange.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/ClientKeyExchange.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 ClientKeyExchange.java
--- gnu/javax/net/ssl/provider/ClientKeyExchange.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/ClientKeyExchange.java	28 Mar 2006 06:19:04 -0000
@@ -89,19 +89,19 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  ExchangeKeys getExchangeKeys ()
+  ExchangeKeys exchangeKeys ()
   {
-    KeyExchangeAlgorithm alg = suite.getKeyExchangeAlgorithm ();
+    KeyExchangeAlgorithm alg = suite.keyExchangeAlgorithm ();
     if (alg == KeyExchangeAlgorithm.RSA)
-      return new EncryptedPreMasterSecret (buffer, suite.getVersion ());
+      return new EncryptedPreMasterSecret (buffer, suite.version ());
     else if (alg == KeyExchangeAlgorithm.DIFFIE_HELLMAN)
       return new ClientDiffieHellmanPublic (buffer);
     throw new IllegalArgumentException ("unsupported key exchange");
   }
 
-  public int getLength ()
+  public int length ()
   {
-    return getExchangeKeys ().getLength ();
+    return exchangeKeys ().length ();
   }
 
   public String toString ()
@@ -119,7 +119,7 @@
     String subprefix = "  ";
     if (prefix != null)
       subprefix = prefix + subprefix;
-    out.println (getExchangeKeys ().toString (subprefix));
+    out.println (exchangeKeys ().toString (subprefix));
     if (prefix != null)
       out.print (prefix);
     out.println("} ClientKeyExchange;");
Index: gnu/javax/net/ssl/provider/CompressionMethodList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/CompressionMethodList.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 CompressionMethodList.java
--- gnu/javax/net/ssl/provider/CompressionMethodList.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/CompressionMethodList.java	28 Mar 2006 06:19:04 -0000
@@ -170,6 +170,24 @@
     return str.toString ();
   }
 
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof CompressionMethodList))
+      return false;
+    CompressionMethodList that = (CompressionMethodList) o;
+
+    if (size () != that.size ())
+      return false;
+
+    for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+         it1.hasNext () && it2.hasNext (); )
+      {
+        if (!it1.next ().equals (it2.next ()))
+          return false;
+      }
+    return true;
+  }
+
   /**
    * An iterator for the elements in this list. The iterator supports
    * only the <code>set</code> method out of the optional methods,
Index: gnu/javax/net/ssl/provider/Constructed.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Constructed.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Constructed.java
--- gnu/javax/net/ssl/provider/Constructed.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Constructed.java	28 Mar 2006 06:19:04 -0000
@@ -48,7 +48,7 @@
    *
    * @return The length of this structure.
    */
-  int getLength ();
+  int length ();
 
   /**
    * Returns a printable representation of this structure, with the
Index: gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/EncryptedPreMasterSecret.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 EncryptedPreMasterSecret.java
--- gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/EncryptedPreMasterSecret.java	28 Mar 2006 06:19:04 -0000
@@ -62,7 +62,7 @@
     this.version = version;
   }
 
-  byte[] getEncryptedSecret ()
+  byte[] encryptedSecret ()
   {
     byte[] secret;
     if (version == ProtocolVersion.SSL_3)
@@ -95,7 +95,7 @@
       }
   }
 
-  public int getLength ()
+  public int length ()
   {
     if (version == ProtocolVersion.SSL_3)
       {
@@ -120,7 +120,7 @@
     out.println ("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  pre_master_secret = ");
-    out.print (Util.toHexString (getEncryptedSecret (), ':'));
+    out.print (Util.toHexString (encryptedSecret (), ':'));
     out.println (';');
     if (prefix != null) out.print (prefix);
     out.print ("} EncryptedPreMasterSecret;");
Index: gnu/javax/net/ssl/provider/Finished.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Finished.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Finished.java
--- gnu/javax/net/ssl/provider/Finished.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Finished.java	28 Mar 2006 06:19:04 -0000
@@ -66,7 +66,7 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  public int getLength ()
+  public int length ()
   {
     if (version == ProtocolVersion.TLS_1)
       return 12;
@@ -75,7 +75,7 @@
     throw new IllegalArgumentException ("length for this version unknown");
   }
 
-  byte[] getVerifyData()
+  byte[] verifyData()
   {
     if (version == ProtocolVersion.TLS_1)
       {
@@ -87,7 +87,7 @@
     throw new IllegalArgumentException ("not TLSv1");
   }
 
-  byte[] getMD5Hash()
+  byte[] md5Hash()
   {
     if (version == ProtocolVersion.SSL_3)
       {
@@ -99,7 +99,7 @@
     throw new IllegalArgumentException ("not SSLv3");
   }
 
-  byte[] getSHAHash()
+  byte[] shaHash()
   {
     if (version == ProtocolVersion.SSL_3)
       {
@@ -127,7 +127,7 @@
     buffer.put (md5, offset, 16);
   }
 
-  void setSHAHash (final byte[] sha, final int offset)
+  void setShaHash (final byte[] sha, final int offset)
   {
     if (version != ProtocolVersion.SSL_3)
       throw new IllegalArgumentException ("not SSLv3");
@@ -152,17 +152,17 @@
     if (version == ProtocolVersion.TLS_1)
       {
         out.print ("  verifyData = ");
-        out.print (Util.toHexString (getVerifyData (), ':'));
+        out.print (Util.toHexString (verifyData (), ':'));
       }
     else if (version == ProtocolVersion.SSL_3)
       {
         out.print ("  md5 = ");
-        out.print (Util.toHexString (getMD5Hash (), ':'));
+        out.print (Util.toHexString (md5Hash (), ':'));
         out.println (';');
         if (prefix != null)
           out.print (prefix);
         out.print ("  sha = ");
-        out.print (Util.toHexString (getSHAHash (), ':'));
+        out.print (Util.toHexString (shaHash (), ':'));
       }
     out.println (';');
     if (prefix != null)
Index: gnu/javax/net/ssl/provider/GenericBlockCipher.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/GenericBlockCipher.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 GenericBlockCipher.java
--- gnu/javax/net/ssl/provider/GenericBlockCipher.java	27 Mar 2006 18:34:52 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/GenericBlockCipher.java	28 Mar 2006 06:19:04 -0000
@@ -62,7 +62,7 @@
     return buffer.limit () - maclen - padlen - 1;
   }
 
-  public int getLength ()
+  public int length ()
   {
     return length + macLength + paddingLength () + 1;
   }
Index: gnu/javax/net/ssl/provider/GenericStreamCipher.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/GenericStreamCipher.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 GenericStreamCipher.java
--- gnu/javax/net/ssl/provider/GenericStreamCipher.java	27 Mar 2006 18:34:52 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/GenericStreamCipher.java	28 Mar 2006 06:19:04 -0000
@@ -56,7 +56,7 @@
     super (buffer, buffer.limit () - macLength, macLength);
   }
 
-  public int getLength ()
+  public int length ()
   {
     return length + macLength;
   }
Index: gnu/javax/net/ssl/provider/Handshake.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Handshake.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Handshake.java
--- gnu/javax/net/ssl/provider/Handshake.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Handshake.java	28 Mar 2006 06:19:04 -0000
@@ -113,7 +113,7 @@
    *
    * @return The handshake type.
    */
-  Type getType()
+  Type type()
   {
     return Type.forInteger (buffer.get (0) & 0xFF);
   }
@@ -123,7 +123,7 @@
    *
    * @return The message length.
    */
-  public int getLength ()
+  public int length ()
   {
     // Length is a uint24.
     return buffer.getInt (0) & 0xFFFFFF;
@@ -135,10 +135,10 @@
    *
    * @return The handshake body.
    */
-  Body getBody()
+  Body body()
   {
     int type = buffer.get (0) & 0xFF;
-    ByteBuffer bodyBuffer = getBodyBuffer ();
+    ByteBuffer bodyBuffer = bodyBuffer ();
     switch (type)
       {
       case Type.HELLO_REQUEST_VALUE:
@@ -163,13 +163,13 @@
         return new ServerHelloDone ();
 
       case Type.CERTIFICATE_VERIFY_VALUE:
-        return new CertificateVerify (bodyBuffer, suite.getSignatureAlgorithm ());
+        return new CertificateVerify (bodyBuffer, suite.signatureAlgorithm ());
 
       case Type.CLIENT_KEY_EXCHANGE_VALUE:
         return new ClientKeyExchange (bodyBuffer, suite);
 
       case Type.FINISHED_VALUE:
-        return new Finished (bodyBuffer, suite.getVersion ());
+        return new Finished (bodyBuffer, suite.version ());
 
       case Type.CERTIFICATE_URL_VALUE:
       case Type.CERTIFICATE_STATUS_VALUE:
@@ -184,9 +184,9 @@
    *
    * @return The body's byte buffer.
    */
-  ByteBuffer getBodyBuffer ()
+  ByteBuffer bodyBuffer ()
   {
-    int length = getLength ();
+    int length = length ();
     return ((ByteBuffer) buffer.position (4).limit (4 + length)).slice ();
   }
 
@@ -232,9 +232,9 @@
     out.println("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  type: ");
-    out.print (getType ());
+    out.print (type ());
     out.println (";");
-    Body body = getBody ();
+    Body body = body ();
     out.println (body.toString (prefix != null ? (prefix + "  ") : "  "));
     if (prefix != null) out.print (prefix);
     out.print ("} Handshake;");
@@ -246,7 +246,7 @@
 
   static interface Body extends Constructed
   {
-    int getLength ();
+    int length ();
 
     String toString (String prefix);
   }
Index: gnu/javax/net/ssl/provider/HelloRequest.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/HelloRequest.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 HelloRequest.java
--- gnu/javax/net/ssl/provider/HelloRequest.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/HelloRequest.java	28 Mar 2006 06:19:04 -0000
@@ -58,7 +58,7 @@
     return str.toString ();
   }
 
-  public int getLength ()
+  public int length ()
   {
     return 0;
   }
Index: gnu/javax/net/ssl/provider/InputSecurityParameters.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/InputSecurityParameters.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 InputSecurityParameters.java
--- gnu/javax/net/ssl/provider/InputSecurityParameters.java	27 Mar 2006 18:34:52 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/InputSecurityParameters.java	28 Mar 2006 06:19:04 -0000
@@ -77,12 +77,12 @@
     ByteBuffer fragment;
     if (cipher != null)
       {
-        ByteBuffer input = record.getFragment ();
+        ByteBuffer input = record.fragment ();
         fragment = ByteBuffer.allocate (input.limit ());
         cipher.doFinal (input, fragment);
       }
     else
-      fragment = record.getFragment ();
+      fragment = record.fragment ();
 
     int maclen = 0;
     if (mac != null)
@@ -133,8 +133,8 @@
         ProtocolVersion version = record.version ();
         if (version != ProtocolVersion.SSL_3)
           {
-            mac.update ((byte) version.getMajor ());
-            mac.update ((byte) version.getMinor ());
+            mac.update ((byte) version.major ());
+            mac.update ((byte) version.minor ());
           }
         mac.update ((byte) (plaintext.contentLength () >>> 8));
         mac.update ((byte)  plaintext.contentLength ());
Index: gnu/javax/net/ssl/provider/OutputSecurityParameters.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/OutputSecurityParameters.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 OutputSecurityParameters.java
--- gnu/javax/net/ssl/provider/OutputSecurityParameters.java	27 Mar 2006 18:34:52 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/OutputSecurityParameters.java	28 Mar 2006 06:19:04 -0000
@@ -67,6 +67,12 @@
     sequence = 0;
   }
 
+  /**
+   * Encrypt a record, storing the result in the given output buffer.
+   *
+   * @return The number of bytes stored into `output;' that is, the
+   * size of the encrypted fragment, plus the encoding for the record.
+   */
   int encrypt (final Record record, final ByteBuffer output)
     throws DataFormatException, IllegalBlockSizeException, ShortBufferException
   {
@@ -139,12 +145,12 @@
         mac.update ((byte) (sequence >>> 16));
         mac.update ((byte) (sequence >>>  8));
         mac.update ((byte)  sequence);
-        mac.update ((byte) record.getContentType ().getValue ());
+        mac.update ((byte) record.contentType ().getValue ());
         ProtocolVersion version = record.version ();
         if (version != ProtocolVersion.SSL_3)
           {
-            mac.update ((byte) version.getMajor ());
-            mac.update ((byte) version.getMinor ());
+            mac.update ((byte) version.major ());
+            mac.update ((byte) version.minor ());
           }
         mac.update ((byte) (plaintext.contentLength () >>> 8));
         mac.update ((byte)  plaintext.contentLength ());
@@ -154,7 +160,7 @@
 
     Record outrecord = new Record (output);
     outrecord.setContentType (record.contentType ());
-    outrecord.setVersion (record.getVersion ());
+    outrecord.setVersion (record.version ());
     outrecord.setLength (fragmentLength);
 
     if (cipher != null)
Index: gnu/javax/net/ssl/provider/ProtocolVersion.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/ProtocolVersion.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 ProtocolVersion.java
--- gnu/javax/net/ssl/provider/ProtocolVersion.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/ProtocolVersion.java	28 Mar 2006 06:19:04 -0000
@@ -104,7 +104,7 @@
 //     out.write(minor);
 //   }
 
-  public int getLength ()
+  public int length ()
   {
     return 2;
   }
@@ -116,17 +116,17 @@
     };
   }
 
-  int getMajor()
+  int major()
   {
     return major;
   }
 
-  int getMinor()
+  int minor()
   {
     return minor;
   }
 
-  int getRawValue ()
+  int rawValue ()
   {
     return (major << 8) | minor;
   }
Index: gnu/javax/net/ssl/provider/Random.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Random.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Random.java
--- gnu/javax/net/ssl/provider/Random.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Random.java	28 Mar 2006 06:19:04 -0000
@@ -113,17 +113,17 @@
 //     return bout.toByteArray();
 //   }
 
-  public int getLength ()
+  public int length ()
   {
     return RANDOM_LENGTH + 4;
   }
 
-  int getGMTUnixTime ()
+  int gmtUnixTime ()
   {
     return buffer.getInt (0);
   }
 
-  byte[] getRandomBytes()
+  byte[] randomBytes()
   {
     byte[] buf = new byte[28];
     buffer.position (4);
@@ -131,7 +131,7 @@
     return buf;
   }
 
-  void setGMTUnixTime (final int gmtUnixTime)
+  void setGmtUnixTime (final int gmtUnixTime)
   {
     buffer.putInt (0, gmtUnixTime);
   }
@@ -159,12 +159,12 @@
     if (prefix != null)
       out.print (prefix);
     out.print ("  gmt_unix_time: ");
-    out.print (getGMTUnixTime ());
+    out.print (gmtUnixTime ());
     out.println (";");
     if (prefix != null)
       out.print (prefix);
     out.print ("  random_bytes:  ");
-    out.print (Util.toHexString (getRandomBytes (), ':'));
+    out.print (Util.toHexString (randomBytes (), ':'));
     out.println (";");
     if (prefix != null)
       out.print (prefix);
Index: gnu/javax/net/ssl/provider/Record.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/Record.java,v
retrieving revision 1.1.2.2
diff -u -B -b -r1.1.2.2 Record.java
--- gnu/javax/net/ssl/provider/Record.java	27 Mar 2006 18:34:52 -0000	1.1.2.2
+++ gnu/javax/net/ssl/provider/Record.java	28 Mar 2006 06:19:04 -0000
@@ -80,12 +80,6 @@
     return ContentType.forInteger (buffer.get (0) & 0xFF);
   }
 
-  // XXX remove.
-  int getFragment (final ByteBuffer sink)
-  {
-    return fragment (sink);
-  }
-
   /**
    * Get the fragment content, storing it into <code>sink</code>.
    *
@@ -99,12 +93,6 @@
     return length;
   }
 
-  // XXX remove.
-  ByteBuffer getFragment ()
-  {
-    return fragment ();
-  }
-
   /**
    * Returns the fragment field as a ByteBuffer. The returned buffer
    * is shared with this object's underlying buffer, so it will share
@@ -115,16 +103,10 @@
    */
   ByteBuffer fragment ()
   {
-    int length = getLength ();
+    int length = length ();
     return ((ByteBuffer) buffer.limit (5 + length).position (5)).slice ();
   }
 
-  // XXX remove.
-  int getLength ()
-  {
-    return length ();
-  }
-
   /**
    * Gets the fragment length.
    *
@@ -135,11 +117,6 @@
     return buffer.getShort (3) & 0xFFFF;
   }
 
-  ProtocolVersion getVersion ()
-  {
-    return version ();
-  }
-
   /**
    * Gets the protocol version field.
    *
@@ -192,7 +169,7 @@
    */
   void setVersion (final ProtocolVersion version)
   {
-    buffer.put (1, (byte) version.getMajor ()).put (2, (byte) version.getMinor ());
+    buffer.put (1, (byte) version.major ()).put (2, (byte) version.minor ());
   }
 
   public String toString ()
@@ -201,13 +178,13 @@
     PrintWriter out = new PrintWriter (str);
     out.println ("struct {");
     out.print ("  type:    ");
-    out.print (getContentType ());
+    out.print (contentType ());
     out.println (";");
     out.print ("  version: ");
-    out.print (getVersion ());
+    out.print (version ());
     out.println (";");
     out.println ("  fragment {");
-    out.print (Util.hexDump (getFragment (), "    "));
+    out.print (Util.hexDump (fragment (), "    "));
     out.println ("  };");
     out.print ("} Record;");
     return str.toString ();
Index: gnu/javax/net/ssl/provider/ServerDHParams.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/ServerDHParams.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 ServerDHParams.java
--- gnu/javax/net/ssl/provider/ServerDHParams.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/ServerDHParams.java	28 Mar 2006 06:19:04 -0000
@@ -64,12 +64,12 @@
     this.buffer = buffer;
   }
 
-  public KeyExchangeAlgorithm getAlgorithm ()
+  public KeyExchangeAlgorithm algorithm ()
   {
     return KeyExchangeAlgorithm.DIFFIE_HELLMAN;
   }
 
-  public int getLength ()
+  public int length ()
   {
     int offset1 = buffer.getShort (0) & 0xFFFF;
     int offset2 = buffer.getShort (offset1 + 2) & 0xFFFF;
@@ -82,7 +82,7 @@
    *
    * @return p.
    */
-  BigInteger getP ()
+  BigInteger p ()
   {
     int len = buffer.getShort (0) & 0xFFFF;
     byte[] buf = new byte[len];
@@ -96,7 +96,7 @@
    *
    * @return g.
    */
-  BigInteger getG ()
+  BigInteger g ()
   {
     int off = (buffer.getShort (0) & 0xFFFF) + 2;
     int len = buffer.getShort (off) & 0xFFFF;
@@ -111,7 +111,7 @@
    *
    * @return Y.
    */
-  BigInteger getY ()
+  BigInteger y ()
   {
     int offset1 = (buffer.getShort (0) & 0xFFFF) + 2;
     int offset2 = (buffer.getShort (offset1) & 0xFFFF) + offset1 + 2;
@@ -189,13 +189,13 @@
     out.println ("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  dh_p:  ");
-    out.println (getP ().toString (16));
+    out.println (p ().toString (16));
     if (prefix != null) out.print (prefix);
     out.print ("  dh_g:  ");
-    out.println (getG ().toString (16));
+    out.println (g ().toString (16));
     if (prefix != null) out.print (prefix);
     out.print ("  dh_Ys: ");
-    out.println (getY ().toString (16));
+    out.println (y ().toString (16));
     if (prefix != null) out.print (prefix);
     out.print ("} ServerDHParams;");
     return str.toString ();
Index: gnu/javax/net/ssl/provider/ServerHello.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/ServerHello.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 ServerHello.java
--- gnu/javax/net/ssl/provider/ServerHello.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/ServerHello.java	28 Mar 2006 06:19:04 -0000
@@ -146,7 +146,7 @@
 //       }
 //   }
 
-  public int getLength ()
+  public int length ()
   {
     return totalLength;
   }
@@ -160,7 +160,7 @@
    *
    * @return The server's protocol version.
    */
-  ProtocolVersion getProtocolVersion()
+  ProtocolVersion protocolVersion()
   {
     return ProtocolVersion.getInstance (buffer.getShort (0));
   }
@@ -173,7 +173,7 @@
    *
    * @return The server's random value.
    */
-  Random getRandom()
+  Random random()
   {
     ByteBuffer randomBuf =
       ((ByteBuffer) buffer.duplicate ().position (RANDOM_OFFSET)
@@ -187,7 +187,7 @@
    *
    * @return The session ID.
    */
-  byte[] getSessionId()
+  byte[] sessionId()
   {
     int idlen = buffer.get (SESSID_OFFSET) & 0xFF;
     byte[] sessionId = new byte[idlen];
@@ -202,11 +202,11 @@
    *
    * @return The server's chosen cipher suite.
    */
-  CipherSuite getCipherSuite ()
+  CipherSuite cipherSuite ()
   {
     int offset = SESSID_OFFSET + (buffer.get (SESSID_OFFSET) & 0xFF) + 1;
     return (CipherSuite.forValue (buffer.getShort (offset))
-            .resolve (getProtocolVersion ()));
+            .resolve (protocolVersion ()));
   }
 
   /**
@@ -214,13 +214,13 @@
    *
    * @return The chosen compression method.
    */
-  CompressionMethod getCompressionMethod ()
+  CompressionMethod compressionMethod ()
   {
     int offset = SESSID_OFFSET + (buffer.get (SESSID_OFFSET) & 0xFF) + 3;
     return CompressionMethod.getInstance (buffer.get (offset) & 0xFF);
   }
 
-  ByteBuffer getExtensions ()
+  ByteBuffer extensions ()
   {
     int offset = SESSID_OFFSET + (buffer.get (SESSID_OFFSET) & 0xFF) + 4;
     return ((ByteBuffer) buffer.duplicate ().position (offset)
@@ -229,7 +229,7 @@
 
   void setProtocolVersion (final ProtocolVersion version)
   {
-    buffer.putShort (0, (short) version.getRawValue ());
+    buffer.putShort (0, (short) version.rawValue ());
   }
 
   void setSessionId (final byte[] sessionId)
@@ -250,7 +250,7 @@
   {
     int offset = SESSID_OFFSET + (buffer.get (SESSID_OFFSET) & 0xFF) + 1;
     buffer.position (offset);
-    buffer.put (suite.getId ());
+    buffer.put (suite.id ());
   }
 
   void setCompressionMethod (final CompressionMethod comp)
@@ -282,24 +282,24 @@
       subprefix += prefix;
     out.print (subprefix);
     out.print ("version: ");
-    out.print (getProtocolVersion ());
+    out.print (protocolVersion ());
     out.println (";");
     out.print (subprefix);
     out.println ("random:");
-    out.println (getRandom ().toString (subprefix));
+    out.println (random ().toString (subprefix));
     out.print (subprefix);
     out.print ("sessionId:         ");
-    out.print (Util.toHexString(getSessionId (), ':'));
+    out.print (Util.toHexString(sessionId (), ':'));
     out.println (";");
     out.print (subprefix);
     out.print ("cipherSuite:       ");
-    out.print (getCipherSuite ());
+    out.print (cipherSuite ());
     out.println (";");
     out.print (subprefix);
     out.print ("compressionMethod: ");
-    out.print (getCompressionMethod ());
+    out.print (compressionMethod ());
     out.println (";");
-    ByteBuffer extbuf = getExtensions ();
+    ByteBuffer extbuf = extensions ();
     if (extbuf.limit () > 0)
       {
         out.print (subprefix);
Index: gnu/javax/net/ssl/provider/ServerHelloDone.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/ServerHelloDone.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 ServerHelloDone.java
--- gnu/javax/net/ssl/provider/ServerHelloDone.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/ServerHelloDone.java	28 Mar 2006 06:19:04 -0000
@@ -48,7 +48,7 @@
 {
   ServerHelloDone () { }
 
-  public int getLength ()
+  public int length ()
   {
     return 0;
   }
Index: gnu/javax/net/ssl/provider/ServerKeyExchange.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/ServerKeyExchange.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 ServerKeyExchange.java
--- gnu/javax/net/ssl/provider/ServerKeyExchange.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/ServerKeyExchange.java	28 Mar 2006 06:19:04 -0000
@@ -86,15 +86,15 @@
     suite.getClass ();
     this.buffer = buffer;
     this.suite = suite;
-    if (suite.isResolved ())
+    if (!suite.isResolved ())
       throw new IllegalArgumentException ("requires resolved cipher suite");
   }
 
-  public int getLength ()
+  public int length ()
   {
-    if (suite.getKeyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
+    if (suite.keyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
       return 0;
-    return getParams ().getLength () + getSignature ().getLength ();
+    return params ().length () + signature ().length ();
   }
 
   /**
@@ -103,9 +103,9 @@
    *
    * @return The server's key exchange parameters.
    */
-  ServerKeyExchangeParams getParams ()
+  ServerKeyExchangeParams params ()
   {
-    KeyExchangeAlgorithm kex = suite.getKeyExchangeAlgorithm ();
+    KeyExchangeAlgorithm kex = suite.keyExchangeAlgorithm ();
     if (kex.equals (KeyExchangeAlgorithm.RSA))
       return new ServerRSAParams (buffer.duplicate ());
     else if (kex.equals (KeyExchangeAlgorithm.DIFFIE_HELLMAN))
@@ -122,13 +122,13 @@
    *
    * @return The signature.
    */
-  Signature getSignature ()
+  Signature signature ()
   {
-    if (suite.getKeyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
+    if (suite.keyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
       return null;
-    ServerKeyExchangeParams params = getParams ();
-    ByteBuffer sigbuf = ((ByteBuffer) buffer.position (params.getLength ())).slice ();
-    return new Signature (sigbuf, suite.getSignatureAlgorithm ());
+    ServerKeyExchangeParams params = params ();
+    ByteBuffer sigbuf = ((ByteBuffer) buffer.position (params.length ())).slice ();
+    return new Signature (sigbuf, suite.signatureAlgorithm ());
   }
 
   public String toString()
@@ -144,19 +144,19 @@
     out.println("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  algorithm: ");
-    out.print (suite.getKeyExchangeAlgorithm ());
+    out.print (suite.keyExchangeAlgorithm ());
     out.println (";");
-    if (!suite.getKeyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
+    if (!suite.keyExchangeAlgorithm ().equals (KeyExchangeAlgorithm.NONE))
       {
         if (prefix != null) out.print (prefix);
         out.println ("  parameters:");
-        out.println (getParams ().toString (prefix != null ? prefix+"  " : "  "));
+        out.println (params ().toString (prefix != null ? prefix+"  " : "  "));
       }
-    if (!suite.getSignatureAlgorithm ().equals (SignatureAlgorithm.ANONYMOUS))
+    if (!suite.signatureAlgorithm ().equals (SignatureAlgorithm.ANONYMOUS))
       {
         if (prefix != null) out.print (prefix);
         out.println ("  signature:");
-        out.println (getSignature ().toString (prefix != null ? prefix+"  " : "  "));
+        out.println (signature ().toString (prefix != null ? prefix+"  " : "  "));
       }
     if (prefix != null) out.print (prefix);
     out.print ("} ServerKeyExchange;");
Index: gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/ServerKeyExchangeParams.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 ServerKeyExchangeParams.java
--- gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/ServerKeyExchangeParams.java	28 Mar 2006 06:19:04 -0000
@@ -46,5 +46,5 @@
  */
 interface ServerKeyExchangeParams extends Constructed
 {
-  KeyExchangeAlgorithm getAlgorithm ();
+  KeyExchangeAlgorithm algorithm ();
 }
Index: gnu/javax/net/ssl/provider/ServerRSAParams.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/ServerRSAParams.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 ServerRSAParams.java
--- gnu/javax/net/ssl/provider/ServerRSAParams.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/ServerRSAParams.java	28 Mar 2006 06:19:04 -0000
@@ -64,12 +64,12 @@
     this.buffer = buffer;
   }
 
-  public KeyExchangeAlgorithm getAlgorithm ()
+  public KeyExchangeAlgorithm algorithm ()
   {
     return KeyExchangeAlgorithm.RSA;
   }
 
-  public int getLength ()
+  public int length ()
   {
     int offset = buffer.getShort (0) & 0xFFFF;
     return (buffer.getShort (offset + 2) & 0xFFFF) + offset + 4;
@@ -80,7 +80,7 @@
    *
    * @return The modulus.
    */
-  BigInteger getModulus ()
+  BigInteger modulus ()
   {
     int len = buffer.getShort (0) & 0xFFFF;
     byte[] buf = new byte[len];
@@ -94,7 +94,7 @@
    *
    * @return The exponent.
    */
-  BigInteger getExponent ()
+  BigInteger exponent ()
   {
     int off = (buffer.getShort (0) & 0xFFFF) + 2;
     int len = buffer.getShort (off) & 0xFFFF;
@@ -152,10 +152,10 @@
     out.println ("struct {");
     if (prefix != null) out.print (prefix);
     out.print ("  rsa_modulus:  ");
-    out.println (getModulus ().toString (16));
+    out.println (modulus ().toString (16));
     if (prefix != null) out.print (prefix);
     out.print ("  rsa_exponent: ");
-    out.println (getExponent ());
+    out.println (exponent ());
     if (prefix != null) out.print (prefix);
     out.print ("} ServerRSAParams;");
     return str.toString ();
Index: gnu/javax/net/ssl/provider/Signature.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Signature.java,v
retrieving revision 1.1.8.1
diff -u -B -b -r1.1.8.1 Signature.java
--- gnu/javax/net/ssl/provider/Signature.java	7 Mar 2006 06:41:35 -0000	1.1.8.1
+++ gnu/javax/net/ssl/provider/Signature.java	28 Mar 2006 06:19:04 -0000
@@ -100,14 +100,14 @@
   // Instance methods.
   // -------------------------------------------------------------------------
 
-  public int getLength ()
+  public int length ()
   {
     if (alg.equals (SignatureAlgorithm.ANONYMOUS))
       return 0;
     return (buffer.getShort (0) & 0xFFFF) + 2;
   }
 
-  byte[] getSignature ()
+  byte[] signature ()
   {
     if (alg.equals (SignatureAlgorithm.ANONYMOUS))
       return new byte[0];
@@ -149,7 +149,7 @@
         String subprefix = "  ";
         if (prefix != null)
           subprefix = prefix + subprefix;
-        out.print (Util.hexDump (getSignature (), subprefix));
+        out.print (Util.hexDump (signature (), subprefix));
       }
     if (prefix != null)
       out.print (prefix);
Index: gnu/javax/net/ssl/provider/X500PrincipalList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/net/ssl/provider/Attic/X500PrincipalList.java,v
retrieving revision 1.1.2.1
diff -u -B -b -r1.1.2.1 X500PrincipalList.java
--- gnu/javax/net/ssl/provider/X500PrincipalList.java	7 Mar 2006 05:39:54 -0000	1.1.2.1
+++ gnu/javax/net/ssl/provider/X500PrincipalList.java	28 Mar 2006 06:19:04 -0000
@@ -166,6 +166,24 @@
     return str.toString ();
   }
 
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof X500PrincipalList))
+      return false;
+    X500PrincipalList that = (X500PrincipalList) o;
+
+    if (size () != that.size ())
+      return false;
+
+    for (Iterator it1 = new Iterator (), it2 = that.new Iterator ();
+         it1.hasNext () && it2.hasNext (); )
+      {
+        if (!it1.next ().equals (it2.next ()))
+          return false;
+      }
+    return true;
+  }
+
   class Iterator implements ListIterator
   {
     private final int modCount;


More information about the Classpath-patches mailing list