RecordProtocol.cs: Fix possible endless loop (#77663). Remove hack or an old, fixed...
authorSebastien Pouliot <sebastien@ximian.com>
Thu, 2 Mar 2006 18:19:36 +0000 (18:19 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Thu, 2 Mar 2006 18:19:36 +0000 (18:19 -0000)
svn path=/trunk/mcs/; revision=57510

mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs

index bad9bd17c4fbe27dec5a6b98943850a10ca4c51e..44e48abc43b41d95be90adadabba2882e3f6c12d 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-02  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * RecordProtocol.cs: Fix possible endless loop (#77663). Remove hack
+       for an old, fixed, MCS bug (#67711).
+
 2005-10-06  Sebastien Pouliot  <sebastien@ximian.com>
 
        * ClientRecordProtocol.cs: Update HandshakeMessages after each 
index b934962c783c5ab5620be5ff00a96c1fb7c83e57..3bd18cf9496ad19d30566c94b6fb0a214f529b8e 100644 (file)
@@ -358,19 +358,14 @@ namespace Mono.Security.Protocol.Tls
                                                }
                                                break;
 
-       // FIXME / MCS bug - http://bugzilla.ximian.com/show_bug.cgi?id=67711
-       //                              case (ContentType)0x80:
-       //                                      this.context.HandshakeMessages.Write (result);
-       //                                      break;
+                                       case (ContentType)0x80:
+                                               this.context.HandshakeMessages.Write (buffer);
+                                               break;
 
                                        default:
-                                               if (contentType != (ContentType)0x80)
-                                               {
-                                                       throw new TlsException(
-                                                               AlertDescription.UnexpectedMessage,
-                                                               "Unknown record received from server.");
-                                               }
-                                               this.context.HandshakeMessages.Write (buffer);
+                                               throw new TlsException(
+                                                       AlertDescription.UnexpectedMessage,
+                                                       "Unknown record received from server.");
                                                break;
                                }
 
@@ -715,13 +710,13 @@ namespace Mono.Security.Protocol.Tls
                                short   fragmentLength = 0;
                                byte[]  fragment;
 
-                               if ((count - position) > Context.MAX_FRAGMENT_SIZE)
+                               if ((count + offset - position) > Context.MAX_FRAGMENT_SIZE)
                                {
                                        fragmentLength = Context.MAX_FRAGMENT_SIZE;
                                }
                                else
                                {
-                                       fragmentLength = (short)(count - position);
+                                       fragmentLength = (short)(count + offset - position);
                                }
 
                                // Fill the fragment data