Commit 39182753 authored by Jon Skeet's avatar Jon Skeet

Add SecurityCritical attributes to serialization, and add the AllowPartiallyTrustedCallers

attribute.

This fixes issue 91.
parent 92d6214e
......@@ -37,9 +37,9 @@
* This entire source file is not supported on some platform
*/
#if !NOSERIALIZABLE
using System;
using System.Runtime.Serialization;
using System.Security;
namespace Google.ProtocolBuffers
{
......@@ -51,6 +51,7 @@ namespace Google.ProtocolBuffers
[Serializable]
partial class AbstractMessageLite<TMessage, TBuilder> : ISerializable
{
[SecurityCritical]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.SetType(typeof(SerializationSurrogate));
......@@ -93,6 +94,7 @@ namespace Google.ProtocolBuffers
return message;
}
[SecurityCritical]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("message", _message);
......@@ -103,6 +105,7 @@ namespace Google.ProtocolBuffers
[Serializable]
partial class AbstractBuilderLite<TMessage, TBuilder> : ISerializable
{
[SecurityCritical]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.SetType(typeof(SerializationSurrogate));
......@@ -135,6 +138,7 @@ namespace Google.ProtocolBuffers
return builder;
}
[SecurityCritical]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("message", _message);
......
......@@ -37,6 +37,7 @@ using System.Runtime.CompilerServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
using System.Security;
[assembly: AssemblyTitle("ProtocolBuffers")]
[assembly: AssemblyDescription("")]
......@@ -64,4 +65,5 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyFileVersion("2.4.1.521")]
#endif
[assembly: CLSCompliant(true)]
\ No newline at end of file
[assembly: CLSCompliant(true)]
[assembly: AllowPartiallyTrustedCallers]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment