From a74ed694cb038d883146d873474083b2bc5ebb5b Mon Sep 17 00:00:00 2001 From: key kim Date: Fri, 7 Aug 2020 09:30:07 +0900 Subject: [PATCH] Remove unused left assignment in CapiHelper related issue is #30457 --- .../System/Security/Cryptography/CapiHelper.DSA.Shared.cs | 6 +++--- .../src/System/Security/Cryptography/CapiHelper.Shared.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs index 069813579789a..4e6b8e0577889 100644 --- a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs +++ b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs @@ -178,7 +178,7 @@ internal static DSAParameters ToDSAParameters(this byte[] cspBlob, bool includeP // BYTE[lenP] Y // BYTE[lenX] X (if private) - int magic = br.ReadInt32(); // Expected to be DSS_PUB_MAGIC_VER3 or DSS_PRIV_MAGIC_VER3 + br.ReadInt32(); // Expected to be DSS_PUB_MAGIC_VER3 or DSS_PRIV_MAGIC_VER3 int lenP = (br.ReadInt32() + 7) / 8; int lenQ = (br.ReadInt32() + 7) / 8; int lenJ = (br.ReadInt32() + 7) / 8; @@ -220,7 +220,7 @@ internal static DSAParameters ToDSAParameters(this byte[] cspBlob, bool includeP // DWORD counter (DSSSEED) // BYTE[20] seed (DSSSEED) - int magic = br.ReadInt32(); // Expected to be DSS_MAGIC or DSS_PRIVATE_MAGIC + br.ReadInt32(); // Expected to be DSS_MAGIC or DSS_PRIVATE_MAGIC int len = (br.ReadInt32() + 7) / 8; dsaParameters.P = br.ReadReversed(len); dsaParameters.Q = br.ReadReversed(DSS_Q_LEN); @@ -279,7 +279,7 @@ private static void ReadKeyBlobHeader(BinaryReader br, out byte bVersion) // WORD reserved // ALG_ID aiKeyAlg - byte bType = br.ReadByte(); // BLOBHEADER.bType: Expected to be 0x6 (PUBLICKEYBLOB) or 0x7 (PRIVATEKEYBLOB), though there's no check for backward compat reasons. + br.ReadByte(); // BLOBHEADER.bType: Expected to be 0x6 (PUBLICKEYBLOB) or 0x7 (PRIVATEKEYBLOB), though there's no check for backward compat reasons. bVersion = br.ReadByte(); // BLOBHEADER.bVersion: Expected to be 0x2 or 0x3, though there's no check for backward compat reasons. br.BaseStream.Position += sizeof(ushort); // BLOBHEADER.wReserved int algId = br.ReadInt32(); // BLOBHEADER.aiKeyAlg diff --git a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.Shared.cs b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.Shared.cs index 700d6e48a53f8..a75758092ef17 100644 --- a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.Shared.cs +++ b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.Shared.cs @@ -162,14 +162,14 @@ internal static RSAParameters ToRSAParameters(this byte[] cspBlob, bool includeP { BinaryReader br = new BinaryReader(new MemoryStream(cspBlob)); - byte bType = br.ReadByte(); // BLOBHEADER.bType: Expected to be 0x6 (PUBLICKEYBLOB) or 0x7 (PRIVATEKEYBLOB), though there's no check for backward compat reasons. - byte bVersion = br.ReadByte(); // BLOBHEADER.bVersion: Expected to be 0x2, though there's no check for backward compat reasons. + br.ReadByte(); // BLOBHEADER.bType: Expected to be 0x6 (PUBLICKEYBLOB) or 0x7 (PRIVATEKEYBLOB), though there's no check for backward compat reasons. + br.ReadByte(); // BLOBHEADER.bVersion: Expected to be 0x2, though there's no check for backward compat reasons. br.ReadUInt16(); // BLOBHEADER.wReserved int algId = br.ReadInt32(); // BLOBHEADER.aiKeyAlg if (algId != CALG_RSA_KEYX && algId != CALG_RSA_SIGN) throw new PlatformNotSupportedException(); // The FCall this code was ported from supports other algid's but we're only porting what we use. - int magic = br.ReadInt32(); // RSAPubKey.magic: Expected to be 0x31415352 ('RSA1') or 0x32415352 ('RSA2') + br.ReadInt32(); // RSAPubKey.magic: Expected to be 0x31415352 ('RSA1') or 0x32415352 ('RSA2') int bitLen = br.ReadInt32(); // RSAPubKey.bitLen int modulusLength = bitLen / 8;