Skip to content

Commit 91bba91

Browse files
committed
fixes
1 parent bf88d05 commit 91bba91

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,12 +620,21 @@ dotnet_diagnostic.MA0112.severity = warning
620620
# MA0165: Make interpolated string
621621
dotnet_diagnostic.MA0165.severity = none
622622

623+
# MA0173 - Use LazyInitializer.EnsureInitialize
624+
dotnet_diagnostic.MA0173.severity = none
625+
623626
# MA0182: Avoid unused internal types
624627
dotnet_diagnostic.MA0182.severity = none
625628

626629
# MA0184: Do not use interpolated string without parameters
627630
dotnet_diagnostic.MA0184.severity = none
628631

632+
# MA0190 - Use partial property instead of partial method for GeneratedRegex
633+
dotnet_diagnostic.MA0190.severity = none
634+
635+
# MA0192 - Use HasFlag instead of bitwise checks
636+
dotnet_diagnostic.MA0192.severity = none
637+
629638
#### MSTest rules ####
630639

631640
# MSTEST0015: Test method should not be ignored

src/Renci.SshNet/Netconf/NetConfSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ protected override void OnDataReceived(ArraySegment<byte> data)
129129
{
130130
_ = _data.Append(chunk);
131131

132-
if (!chunk.Contains(Prompt))
132+
if (!chunk.Contains(Prompt, StringComparison.Ordinal))
133133
{
134134
return;
135135
}
@@ -194,7 +194,7 @@ protected override void OnDataReceived(ArraySegment<byte> data)
194194
{
195195
_ = _data.Append(chunk);
196196

197-
if (!chunk.Contains(Prompt))
197+
if (!chunk.Contains(Prompt, StringComparison.Ordinal))
198198
{
199199
return;
200200
}

src/Renci.SshNet/PrivateKeyFile.SSHCOM.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public Key Parse()
7070
throw new SshException("Invalid passphrase.");
7171
}
7272

73-
if (keyType.Contains("rsa"))
73+
if (keyType.Contains("rsa", StringComparison.Ordinal))
7474
{
7575
var exponent = ReadBigIntWithBits(keyReader);
7676
var d = ReadBigIntWithBits(keyReader);

test/Renci.SshNet.Tests/Classes/Security/CertificateHostAlgorithmTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public void CertificateBadCASignature_VerifySignatureReturnsFalse()
287287
"PD7/nXcyxnY3zALlPQTxb19EVx5lz58BS96gg=";
288288

289289
char[] chars = goodCertString.ToCharArray();
290-
chars[^10] = 'a';
290+
chars[chars.Length - 1] = 'a';
291291
string badCertString = new string(chars);
292292

293293
Assert.IsTrue(VerifySignature(goodCertString));

0 commit comments

Comments
 (0)