Skip to content

Commit

Permalink
Removing DSA public key from SqlColumnEncryptionProvider to address C…
Browse files Browse the repository at this point in the history
…odeQL flags. (#2347)
  • Loading branch information
Javad authored Feb 10, 2024
1 parent 91df016 commit ca5e3e8
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,7 @@ public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string e
X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: true);

RSA RSAPublicKey = certificate.GetRSAPublicKey();
int keySizeInBytes;
#if NETCOREAPP || NETSTANDARD2_1
DSA DSAPublicKey = certificate.GetDSAPublicKey();
keySizeInBytes = RSAPublicKey is not null ? RSAPublicKey.KeySize / 8 : DSAPublicKey.KeySize / 8;
#else
keySizeInBytes= RSAPublicKey.KeySize / 8;
#endif
int keySizeInBytes= RSAPublicKey.KeySize / 8;

// Validate and decrypt the EncryptedColumnEncryptionKey
// Format is
Expand Down Expand Up @@ -182,13 +176,7 @@ public override byte[] EncryptColumnEncryptionKey(string masterKeyPath, string e
X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: false);

RSA RSAPublicKey = certificate.GetRSAPublicKey();
int keySizeInBytes;
#if NETCOREAPP || NETSTANDARD2_1
DSA DSAPublicKey = certificate.GetDSAPublicKey();
keySizeInBytes = RSAPublicKey is not null ? RSAPublicKey.KeySize / 8 : DSAPublicKey.KeySize / 8;
#else
keySizeInBytes= RSAPublicKey.KeySize / 8;
#endif
int keySizeInBytes= RSAPublicKey.KeySize / 8;

// Construct the encryptedColumnEncryptionKey
// Format is
Expand Down

0 comments on commit ca5e3e8

Please sign in to comment.