Author: krasnov
Date: 2008-02-12 06:51:43 -0500 (Tue, 12 Feb 2008)
New Revision: 95492

Modified:
   branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/ChangeLog
   branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/Page.jvm.cs
Log:
merge -r95489:95490

Modified: branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/ChangeLog        
2008-02-12 11:51:00 UTC (rev 95491)
+++ branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/ChangeLog        
2008-02-12 11:51:43 UTC (rev 95492)
@@ -1,5 +1,10 @@
 2008-02-12  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
+       * Page.jvm.cs: StateSerializer.readExternal and writeExternal fixed
+       to support viewstate encryption
+
+2008-02-12  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
        * ObjectStateFormatter.cs: revert of 91820
 
 2008-02-08  Marek Habersack  <[EMAIL PROTECTED]>

Modified: branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/Page.jvm.cs
===================================================================
--- branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/Page.jvm.cs      
2008-02-12 11:51:00 UTC (rev 95491)
+++ branches/mainsoft/gh2.2/mcs/class/System.Web/System.Web.UI/Page.jvm.cs      
2008-02-12 11:51:43 UTC (rev 95492)
@@ -473,14 +473,26 @@
 
                        public void readExternal (java.io.ObjectInput __p1)
                        {
-                               ObjectStateFormatter osf = new 
ObjectStateFormatter (CurrentPage);
-                               _state = osf.Deserialize (new ObjectInputStream 
(__p1));
+                               Page page = CurrentPage;
+                               ObjectStateFormatter osf = new 
ObjectStateFormatter (page);
+                               ObjectInputStream inputStream = new 
ObjectInputStream (__p1);
+
+                               if (page.NeedViewStateEncryption || 
page.EnableViewStateMac)
+                                       _state = osf.Deserialize ((string) 
inputStream.readObject ());
+                               else
+                                       _state = osf.Deserialize (inputStream);
                        }
 
                        public void writeExternal (java.io.ObjectOutput __p1)
                        {
-                               ObjectStateFormatter osf = new 
ObjectStateFormatter (CurrentPage);
-                               osf.Serialize (new ObjectOutputStream (__p1), 
_state);
+                               Page page = CurrentPage;
+                               ObjectStateFormatter osf = new 
ObjectStateFormatter (page);
+                               ObjectOutputStream outputStream = new 
ObjectOutputStream (__p1);
+
+                               if (page.NeedViewStateEncryption || 
page.EnableViewStateMac)
+                                       outputStream.writeObject (osf.Serialize 
(_state));
+                               else
+                                       osf.Serialize (outputStream, _state);
                        }
 
                        private Page CurrentPage

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to