Skip to content

Commit 2d6e214

Browse files
authored
CodeQL Suppressions for Unactionable Issues (#3332)
* Suppress RSA padding algorithm warning. * Add suppression for audience claim validation
1 parent 87a48ae commit 2d6e214

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AzureAttestationBasedEnclaveProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ private bool VerifyTokenSignature(string attestationToken, string tokenIssuerUrl
401401
RequireExpirationTime = true,
402402
ValidateLifetime = true,
403403
ValidateIssuer = true,
404-
ValidateAudience = false,
404+
ValidateAudience = false, // CodeQL [SM04387] Required for an external standard: Microsoft Azure Attestation does not support the audience claim.
405405
RequireSignedTokens = true,
406406
ValidIssuers = GenerateListOfIssuers(tokenIssuerUrl),
407407
IssuerSigningKeys = issuerSigningKeys

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.Windows.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ private byte[] RSAEncrypt(byte[] plainText, X509Certificate2 certificate)
474474
Debug.Assert(certificate.HasPrivateKey, "Attempting to encrypt with cert without privatekey");
475475

476476
RSA rsa = certificate.GetRSAPublicKey();
477+
478+
// CodeQL [SM03796] Required for an external standard: Always Encrypted only supports encrypting column encryption keys with RSA_OAEP(SHA1) (https://learn.microsoft.com/en-us/sql/t-sql/statements/create-column-encryption-key-transact-sql?view=sql-server-ver16)
477479
return rsa.Encrypt(plainText, RSAEncryptionPadding.OaepSHA1);
478480
}
479481

@@ -490,6 +492,8 @@ private byte[] RSADecrypt(byte[] cipherText, X509Certificate2 certificate)
490492
Debug.Assert(certificate.HasPrivateKey, "Attempting to decrypt with cert without privatekey");
491493

492494
RSA rsa = certificate.GetRSAPrivateKey();
495+
496+
// CodeQL [SM03796] Required for an external standard: Always Encrypted only supports encrypting column encryption keys with RSA_OAEP(SHA1) (https://learn.microsoft.com/en-us/sql/t-sql/statements/create-column-encryption-key-transact-sql?view=sql-server-ver16)
493497
return rsa.Decrypt(cipherText, RSAEncryptionPadding.OaepSHA1);
494498
}
495499

0 commit comments

Comments
 (0)