Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix | Suppress CodeQL warning for usage of deprecated Ssl2. #2428

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,14 @@ private static string ToFriendlyName(this SslProtocols protocol)
{
name = "TLS 1.0";
}
#pragma warning disable CS0618 // Type or member is obsolete: SSL is depricated
// SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
#pragma warning disable CS0618, CA5397
else if ((protocol & SslProtocols.Ssl3) == SslProtocols.Ssl3)
{
name = "SSL 3.0";
}
else if ((protocol & SslProtocols.Ssl2) == SslProtocols.Ssl2)
#pragma warning restore CS0618 // Type or member is obsolete: SSL is depricated
#pragma warning restore CS0618, CA5397
{
name = "SSL 2.0";
}
Expand All @@ -790,9 +791,10 @@ private static string ToFriendlyName(this SslProtocols protocol)
public static string GetProtocolWarning(this SslProtocols protocol)
{
string message = string.Empty;
#pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
// SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
#pragma warning disable CS0618, CA5397
if ((protocol & (SslProtocols.Ssl2 | SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11)) != SslProtocols.None)
#pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
#pragma warning restore CS0618, CA5397
{
message = StringsHelper.Format(Strings.SEC_ProtocolWarning, protocol.ToFriendlyName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,14 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
}
else if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL3_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL3_SERVER))
{
#pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
// SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
#pragma warning disable CS0618, CA5397
protocolVersion = (int)SslProtocols.Ssl3;
}
else if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL2_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL2_SERVER))
{
protocolVersion = (int)SslProtocols.Ssl2;
#pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
#pragma warning restore CS0618, CA5397
}
else //if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_NONE))
{
Expand Down
Loading