From 4be25ba8bd047f95db4a53eb7e62e193242e129c Mon Sep 17 00:00:00 2001 From: Mordechai Zuber Date: Thu, 13 Oct 2016 15:02:58 +0300 Subject: [PATCH] Add missing `SecurityCritical` attribute Fixes #1471 --- Octokit/Exceptions/ApiException.cs | 2 ++ Octokit/Exceptions/RateLimitExceededException.cs | 2 ++ Octokit/Exceptions/RepositoryExistsException.cs | 2 ++ Octokit/Exceptions/RepositoryFormatException.cs | 2 ++ Octokit/Exceptions/RepositoryWebHookConfigException.cs | 2 ++ Octokit/Exceptions/TwoFactorAuthorizationException.cs | 2 ++ Octokit/Exceptions/TwoFactorChallengeFailedException.cs | 3 ++- Octokit/Http/RateLimit.cs | 2 ++ 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Octokit/Exceptions/ApiException.cs b/Octokit/Exceptions/ApiException.cs index adee41be72..d68d8591b9 100644 --- a/Octokit/Exceptions/ApiException.cs +++ b/Octokit/Exceptions/ApiException.cs @@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.Net; using System.Runtime.Serialization; +using System.Security; using Octokit.Internal; namespace Octokit @@ -158,6 +159,7 @@ protected ApiException(SerializationInfo info, StreamingContext context) ApiError = (ApiError) info.GetValue("ApiError", typeof(ApiError)); } + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Exceptions/RateLimitExceededException.cs b/Octokit/Exceptions/RateLimitExceededException.cs index 435517da06..2f6fc61d68 100644 --- a/Octokit/Exceptions/RateLimitExceededException.cs +++ b/Octokit/Exceptions/RateLimitExceededException.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime.Serialization; +using System.Security; namespace Octokit { @@ -94,6 +95,7 @@ protected RateLimitExceededException(SerializationInfo info, StreamingContext co ?? new RateLimit(new Dictionary()); } + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Exceptions/RepositoryExistsException.cs b/Octokit/Exceptions/RepositoryExistsException.cs index c772926a78..51f0247a37 100644 --- a/Octokit/Exceptions/RepositoryExistsException.cs +++ b/Octokit/Exceptions/RepositoryExistsException.cs @@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.Serialization; +using System.Security; namespace Octokit { @@ -117,6 +118,7 @@ protected RepositoryExistsException(SerializationInfo info, StreamingContext con ExistingRepositoryWebUrl = (Uri) info.GetValue("ExistingRepositoryWebUrl", typeof(Uri)); } + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Exceptions/RepositoryFormatException.cs b/Octokit/Exceptions/RepositoryFormatException.cs index 506fcb950f..bfc0d8ae55 100644 --- a/Octokit/Exceptions/RepositoryFormatException.cs +++ b/Octokit/Exceptions/RepositoryFormatException.cs @@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.Serialization; +using System.Security; namespace Octokit { @@ -51,6 +52,7 @@ protected RepositoryFormatException(SerializationInfo info, StreamingContext con message = info.GetString("Message"); } + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Exceptions/RepositoryWebHookConfigException.cs b/Octokit/Exceptions/RepositoryWebHookConfigException.cs index fe2f7ef74a..8102220e82 100644 --- a/Octokit/Exceptions/RepositoryWebHookConfigException.cs +++ b/Octokit/Exceptions/RepositoryWebHookConfigException.cs @@ -4,6 +4,7 @@ using System.Globalization; using System.Linq; using System.Runtime.Serialization; +using System.Security; namespace Octokit { @@ -48,6 +49,7 @@ protected RepositoryWebHookConfigException(SerializationInfo info, StreamingCont message = info.GetString("Message"); } + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Exceptions/TwoFactorAuthorizationException.cs b/Octokit/Exceptions/TwoFactorAuthorizationException.cs index db6d1a6f9f..6e71102cb1 100644 --- a/Octokit/Exceptions/TwoFactorAuthorizationException.cs +++ b/Octokit/Exceptions/TwoFactorAuthorizationException.cs @@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Net; using System.Runtime.Serialization; +using System.Security; namespace Octokit { @@ -80,6 +81,7 @@ protected TwoFactorAuthorizationException(SerializationInfo info, StreamingConte TwoFactorType = (TwoFactorType) info.GetInt32("TwoFactorType"); } + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Exceptions/TwoFactorChallengeFailedException.cs b/Octokit/Exceptions/TwoFactorChallengeFailedException.cs index d501fe18ce..1266dc1ce0 100644 --- a/Octokit/Exceptions/TwoFactorChallengeFailedException.cs +++ b/Octokit/Exceptions/TwoFactorChallengeFailedException.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.Serialization; +using System.Security; namespace Octokit { @@ -64,7 +65,7 @@ protected TwoFactorChallengeFailedException(SerializationInfo info, StreamingCon if (info == null) return; AuthorizationCode = info.GetString("AuthorizationCode"); } - + [SecurityCritical] public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/Octokit/Http/RateLimit.cs b/Octokit/Http/RateLimit.cs index 6da91f79bb..6667ff099a 100644 --- a/Octokit/Http/RateLimit.cs +++ b/Octokit/Http/RateLimit.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.Serialization; +using System.Security; using Octokit.Helpers; using Octokit.Internal; @@ -82,6 +83,7 @@ protected RateLimit(SerializationInfo info, StreamingContext context) ResetAsUtcEpochSeconds = info.GetInt64("ResetAsUtcEpochSeconds"); } + [SecurityCritical] public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { Ensure.ArgumentNotNull(info, "info");