Skip to content

Commit a0bb44c

Browse files
committed
remove redundant #if
for some reason this made the compiler suddenly realize that the plain text variables are unused.
1 parent b59da7c commit a0bb44c

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/Renci.SshNet/Security/Cryptography/Ciphers/AesGcmCipher.BclImpl.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ private sealed class BclImpl : Impl
1616

1717
public BclImpl(byte[] key, byte[] nonce)
1818
{
19-
#if NET
2019
_aesGcm = new AesGcm(key, TagSizeInBytes);
21-
#else
22-
_aesGcm = new AesGcm(key);
23-
#endif
2420
_nonce = nonce;
2521
}
2622

@@ -37,21 +33,15 @@ public override void Encrypt(byte[] input, int plainTextOffset, int plainTextLen
3733

3834
public override void Decrypt(byte[] input, int cipherTextOffset, int cipherTextLength, int associatedDataOffset, int associatedDataLength, byte[] output, int plainTextOffset)
3935
{
40-
var plainTextLength = cipherTextLength;
4136
var cipherText = new ReadOnlySpan<byte>(input, cipherTextOffset, cipherTextLength);
4237
var tag = new ReadOnlySpan<byte>(input, cipherTextOffset + cipherTextLength, TagSizeInBytes);
43-
var plainText = new Span<byte>(output, plainTextOffset, plainTextLength);
4438
var associatedData = new ReadOnlySpan<byte>(input, associatedDataOffset, associatedDataLength);
4539

4640
try
4741
{
4842
_aesGcm.Decrypt(_nonce, cipherText, tag, output, associatedData);
4943
}
50-
#if NET
5144
catch (AuthenticationTagMismatchException ex)
52-
#else
53-
catch (CryptographicException ex)
54-
#endif
5545
{
5646
throw new SshConnectionException("MAC error", DisconnectReason.MacError, ex);
5747
}

0 commit comments

Comments
 (0)