Skip to content

Commit ecab128

Browse files
authored
Add comments to suppress codeql alerts (#13406)
* Add comments to suppress codeql alerts Added CodeQL comments to suppress alerts for various hash algorithm usages in cryptography package files for compatibility and backwards compatibility purposes. No functional changes were made.
1 parent 0f0480d commit ecab128

File tree

3 files changed

+26
-26
lines changed
  • Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography

3 files changed

+26
-26
lines changed

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/hazmat/_oid.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,27 @@ class SignatureAlgorithmOID:
124124

125125
_SIG_OIDS_TO_HASH: dict[ObjectIdentifier, hashes.HashAlgorithm | None] = {
126126
SignatureAlgorithmOID.RSA_WITH_MD5: hashes.MD5(), # CodeQL [SM02167] This is for compatibility.
127-
SignatureAlgorithmOID.RSA_WITH_SHA1: hashes.SHA1(),
128-
SignatureAlgorithmOID._RSA_WITH_SHA1: hashes.SHA1(),
129-
SignatureAlgorithmOID.RSA_WITH_SHA224: hashes.SHA224(),
127+
SignatureAlgorithmOID.RSA_WITH_SHA1: hashes.SHA1(), # CodeQL [SM02167] This is for compatibility.
128+
SignatureAlgorithmOID._RSA_WITH_SHA1: hashes.SHA1(), # CodeQL [SM02167] This is for compatibility.
129+
SignatureAlgorithmOID.RSA_WITH_SHA224: hashes.SHA224(), # CodeQL [SM02167] This is for compatibility.
130130
SignatureAlgorithmOID.RSA_WITH_SHA256: hashes.SHA256(),
131131
SignatureAlgorithmOID.RSA_WITH_SHA384: hashes.SHA384(),
132132
SignatureAlgorithmOID.RSA_WITH_SHA512: hashes.SHA512(),
133-
SignatureAlgorithmOID.RSA_WITH_SHA3_224: hashes.SHA3_224(),
134-
SignatureAlgorithmOID.RSA_WITH_SHA3_256: hashes.SHA3_256(),
135-
SignatureAlgorithmOID.RSA_WITH_SHA3_384: hashes.SHA3_384(),
136-
SignatureAlgorithmOID.RSA_WITH_SHA3_512: hashes.SHA3_512(),
137-
SignatureAlgorithmOID.ECDSA_WITH_SHA1: hashes.SHA1(),
133+
SignatureAlgorithmOID.RSA_WITH_SHA3_224: hashes.SHA3_224(), # CodeQL [SM02167] This is for compatibility.
134+
SignatureAlgorithmOID.RSA_WITH_SHA3_256: hashes.SHA3_256(), # CodeQL [SM02167] This is for compatibility.
135+
SignatureAlgorithmOID.RSA_WITH_SHA3_384: hashes.SHA3_384(), # CodeQL [SM02167] This is for compatibility.
136+
SignatureAlgorithmOID.RSA_WITH_SHA3_512: hashes.SHA3_512(), # CodeQL [SM02167] This is for compatibility.
137+
SignatureAlgorithmOID.ECDSA_WITH_SHA1: hashes.SHA1(), # CodeQL [SM02167] This is for compatibility.
138138
SignatureAlgorithmOID.ECDSA_WITH_SHA224: hashes.SHA224(), # CodeQL [SM02167] This is for compatibility.
139139
SignatureAlgorithmOID.ECDSA_WITH_SHA256: hashes.SHA256(),
140-
SignatureAlgorithmOID.ECDSA_WITH_SHA384: hashes.SHA384(),
140+
SignatureAlgorithmOID.ECDSA_WITH_SHA384: hashes.SHA384(), # CodeQL [SM02167] This is for compatibility.
141141
SignatureAlgorithmOID.ECDSA_WITH_SHA512: hashes.SHA512(),
142-
SignatureAlgorithmOID.ECDSA_WITH_SHA3_224: hashes.SHA3_224(),
142+
SignatureAlgorithmOID.ECDSA_WITH_SHA3_224: hashes.SHA3_224(), # CodeQL [SM02167] This is for compatibility.
143143
SignatureAlgorithmOID.ECDSA_WITH_SHA3_256: hashes.SHA3_256(), # CodeQL [SM02167] This is for compatibility.
144-
SignatureAlgorithmOID.ECDSA_WITH_SHA3_384: hashes.SHA3_384(),
144+
SignatureAlgorithmOID.ECDSA_WITH_SHA3_384: hashes.SHA3_384(), # CodeQL [SM02167] This is for compatibility.
145145
SignatureAlgorithmOID.ECDSA_WITH_SHA3_512: hashes.SHA3_512(), # CodeQL [SM02167] This is for compatibility.
146-
SignatureAlgorithmOID.DSA_WITH_SHA1: hashes.SHA1(),
147-
SignatureAlgorithmOID.DSA_WITH_SHA224: hashes.SHA224(),
146+
SignatureAlgorithmOID.DSA_WITH_SHA1: hashes.SHA1(), # CodeQL [SM02167] This is for compatibility.
147+
SignatureAlgorithmOID.DSA_WITH_SHA224: hashes.SHA224(), # CodeQL [SM02167] This is for compatibility.
148148
SignatureAlgorithmOID.DSA_WITH_SHA256: hashes.SHA256(),
149149
SignatureAlgorithmOID.ED25519: None,
150150
SignatureAlgorithmOID.ED448: None,

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/hazmat/backends/openssl/backend.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,18 @@ class Backend:
9797
# Sometimes SHA1 is still permissible. That logic is contained
9898
# within the various *_supported methods.
9999
_fips_hashes = (
100-
hashes.SHA224,
100+
hashes.SHA224, # CodeQL [SM02167] This is for backwards compatibility.
101101
hashes.SHA256,
102102
hashes.SHA384,
103103
hashes.SHA512,
104-
hashes.SHA512_224,
105-
hashes.SHA512_256,
104+
hashes.SHA512_224, # CodeQL [SM02167] This is for backwards compatibility.
105+
hashes.SHA512_256, # CodeQL [SM02167] This is for backwards compatibility.
106106
hashes.SHA3_224, # CodeQL [SM02167] This is for backwards compatibility.
107-
hashes.SHA3_256,
108-
hashes.SHA3_384,
109-
hashes.SHA3_512,
107+
hashes.SHA3_256, # CodeQL [SM02167] This is for backwards compatibility.
108+
hashes.SHA3_384, # CodeQL [SM02167] This is for backwards compatibility.
109+
hashes.SHA3_512, # CodeQL [SM02167] This is for backwards compatibility.
110110
hashes.SHAKE128, # CodeQL [SM02167] This is for backwards compatibility.
111-
hashes.SHAKE256,
111+
hashes.SHAKE256, # CodeQL [SM02167] This is for backwards compatibility.
112112
)
113113
_fips_ecdh_curves = (
114114
ec.SECP224R1,
@@ -197,7 +197,7 @@ def signature_hash_supported(
197197
) -> bool:
198198
# Dedicated check for hashing algorithm use in message digest for
199199
# signatures, e.g. RSA PKCS#1 v1.5 SHA1 (sha1WithRSAEncryption).
200-
if self._fips_enabled and isinstance(algorithm, hashes.SHA1):
200+
if self._fips_enabled and isinstance(algorithm, hashes.SHA1): # CodeQL [SM02167] This is for backwards compatibility.
201201
return False
202202
return self.hash_supported(algorithm)
203203

@@ -370,16 +370,16 @@ def _read_mem_bio(self, bio) -> bytes:
370370
return bio_data
371371

372372
def _oaep_hash_supported(self, algorithm: hashes.HashAlgorithm) -> bool:
373-
if self._fips_enabled and isinstance(algorithm, hashes.SHA1):
373+
if self._fips_enabled and isinstance(algorithm, hashes.SHA1): # CodeQL [SM02167] This is for backwards compatibility.
374374
return False
375375

376376
return isinstance(
377377
algorithm,
378378
(
379-
hashes.SHA1,
380-
hashes.SHA224,
379+
hashes.SHA1, # CodeQL [SM02167] This is for backwards compatibility.
380+
hashes.SHA224, # CodeQL [SM02167] This is for backwards compatibility.
381381
hashes.SHA256,
382-
hashes.SHA384,
382+
hashes.SHA384, # CodeQL [SM02167] This is for backwards compatibility.
383383
hashes.SHA512,
384384
),
385385
)

Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/cryptography/x509/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
hashes.SHA256,
4747
hashes.SHA384,
4848
hashes.SHA512,
49-
hashes.SHA3_224,
49+
hashes.SHA3_224, # CodeQL [SM02167] This is for comtatibility.
5050
hashes.SHA3_256, # CodeQL [SM02167] This is for comtatibility.
5151
hashes.SHA3_384, # CodeQL [SM02167] This is for comtatibility.
5252
hashes.SHA3_512, # CodeQL [SM02167] This is for comtatibility.

0 commit comments

Comments
 (0)