Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
13f56c0d
Commit
13f56c0d
authored
Feb 07, 2015
by
csharptest
Committed by
rogerk
Feb 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amended: Add SecurityCritical attributes to serialization
parent
6ab2678e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
CustomSerialization.cs
src/ProtocolBuffers/CustomSerialization.cs
+9
-0
No files found.
src/ProtocolBuffers/CustomSerialization.cs
View file @
13f56c0d
...
...
@@ -36,6 +36,7 @@
/*
* This entire source file is not supported on some platform
*/
using
System.Security.Permissions
;
#if !NOSERIALIZABLE
using
System
;
using
System.Runtime.Serialization
;
...
...
@@ -52,6 +53,7 @@ namespace Google.ProtocolBuffers
partial
class
AbstractMessageLite
<
TMessage
,
TBuilder
>
:
ISerializable
{
[
SecurityCritical
]
[
SecurityPermission
(
SecurityAction
.
LinkDemand
,
Flags
=
SecurityPermissionFlag
.
SerializationFormatter
)]
void
ISerializable
.
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
info
.
SetType
(
typeof
(
SerializationSurrogate
));
...
...
@@ -72,6 +74,8 @@ namespace Google.ProtocolBuffers
_initialized
=
info
.
GetBoolean
(
"initialized"
);
}
[
SecurityCritical
]
[
SecurityPermission
(
SecurityAction
.
LinkDemand
,
Flags
=
SecurityPermissionFlag
.
SerializationFormatter
)]
object
IObjectReference
.
GetRealObject
(
StreamingContext
context
)
{
ExtensionRegistry
registry
=
context
.
Context
as
ExtensionRegistry
;
...
...
@@ -95,6 +99,7 @@ namespace Google.ProtocolBuffers
}
[
SecurityCritical
]
[
SecurityPermission
(
SecurityAction
.
LinkDemand
,
Flags
=
SecurityPermissionFlag
.
SerializationFormatter
)]
void
ISerializable
.
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
info
.
AddValue
(
"message"
,
_message
);
...
...
@@ -106,6 +111,7 @@ namespace Google.ProtocolBuffers
partial
class
AbstractBuilderLite
<
TMessage
,
TBuilder
>
:
ISerializable
{
[
SecurityCritical
]
[
SecurityPermission
(
SecurityAction
.
LinkDemand
,
Flags
=
SecurityPermissionFlag
.
SerializationFormatter
)]
void
ISerializable
.
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
info
.
SetType
(
typeof
(
SerializationSurrogate
));
...
...
@@ -123,6 +129,8 @@ namespace Google.ProtocolBuffers
_message
=
(
byte
[])
info
.
GetValue
(
"message"
,
typeof
(
byte
[]));
}
[
SecurityCritical
]
[
SecurityPermission
(
SecurityAction
.
LinkDemand
,
Flags
=
SecurityPermissionFlag
.
SerializationFormatter
)]
object
IObjectReference
.
GetRealObject
(
StreamingContext
context
)
{
ExtensionRegistry
registry
=
context
.
Context
as
ExtensionRegistry
;
...
...
@@ -139,6 +147,7 @@ namespace Google.ProtocolBuffers
}
[
SecurityCritical
]
[
SecurityPermission
(
SecurityAction
.
LinkDemand
,
Flags
=
SecurityPermissionFlag
.
SerializationFormatter
)]
void
ISerializable
.
GetObjectData
(
SerializationInfo
info
,
StreamingContext
context
)
{
info
.
AddValue
(
"message"
,
_message
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment