harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r692675 - /harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
Date Sat, 06 Sep 2008 16:15:19 GMT
Author: tellison
Date: Sat Sep  6 09:15:17 2008
New Revision: 692675

URL: http://svn.apache.org/viewvc?rev=692675&view=rev
Log:
Cipher suites are referenced by unsigned byte sequences.
Ensure codes are looked up correctly.

Modified:
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java?rev=692675&r1=692674&r2=692675&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
Sat Sep  6 09:15:17 2008
@@ -364,7 +364,7 @@
      * @return
      */
     public static CipherSuite getByCode(byte b1, byte b2) {
-        if (b1 != 0 || b2 > cuitesByCode.length) {
+        if (b1 != 0 || (b2 & 0xFF) > cuitesByCode.length) {
             // Unknoun
             return new CipherSuite("UNKNOUN_" + b1 + "_" + b2, false, 0, "",
                     "", new byte[] { b1, b2 });
@@ -383,7 +383,7 @@
      */
     public static CipherSuite getByCode(byte b1, byte b2, byte b3) {
         if (b1 == 0 && b2 == 0) {
-            if (b3 <= cuitesByCode.length) {
+            if ((b3 & 0xFF) <= cuitesByCode.length) {
                 return cuitesByCode[b3];
             }
         }



Mime
View raw message