aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2014-09-09 15:09:33 -0700
committerJon Skeet <skeet@pobox.com>2014-09-09 15:09:33 -0700
commit391827537689e3674cab9b1157dc4aed53f64464 (patch)
tree72adc7b486fd6874800e19dadcd7b03a960157f4
parent92d6214e0f76cc92f35f3a44aa89e0b0e60df5e8 (diff)
downloadprotobuf-391827537689e3674cab9b1157dc4aed53f64464.tar.gz
protobuf-391827537689e3674cab9b1157dc4aed53f64464.tar.bz2
protobuf-391827537689e3674cab9b1157dc4aed53f64464.zip
Add SecurityCritical attributes to serialization, and add the AllowPartiallyTrustedCallers
attribute. This fixes issue 91.
-rw-r--r--src/ProtocolBuffers/CustomSerialization.cs6
-rw-r--r--src/ProtocolBuffers/Properties/AssemblyInfo.cs4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ProtocolBuffers/CustomSerialization.cs b/src/ProtocolBuffers/CustomSerialization.cs
index d3904113..6d26f86b 100644
--- a/src/ProtocolBuffers/CustomSerialization.cs
+++ b/src/ProtocolBuffers/CustomSerialization.cs
@@ -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);
diff --git a/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/src/ProtocolBuffers/Properties/AssemblyInfo.cs
index 17b57b9e..23a61419 100644
--- a/src/ProtocolBuffers/Properties/AssemblyInfo.cs
+++ b/src/ProtocolBuffers/Properties/AssemblyInfo.cs
@@ -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