Skip to content

Commit 6b26747

Browse files
bdrodesnicolaswill
authored andcommitted
Crypto: Update crypto stubs location under 'crypto' and associate codeowners on any test/stubs/crypto. Minor fix to HashAlgorithmValueConsumer (remove library detector logic).
1 parent a9bdcc7 commit 6b26747

File tree

7 files changed

+5
-9
lines changed

7 files changed

+5
-9
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# Experimental CodeQL cryptography
1919
**/experimental/**/quantum/ @github/ps-codeql
2020
/shared/quantum/ @github/ps-codeql
21+
**/test/stubs/crypto/ @github/ps-codeql
2122

2223
# CodeQL tools and associated docs
2324
/docs/codeql/codeql-cli/ @github/codeql-cli-reviewers

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/HashAlgorithmValueConsumer.qll

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ private import experimental.quantum.Language
33
private import semmle.code.cpp.dataflow.new.DataFlow
44
private import experimental.quantum.OpenSSL.AlgorithmValueConsumers.OpenSSLAlgorithmValueConsumerBase
55
private import experimental.quantum.OpenSSL.AlgorithmInstances.OpenSSLAlgorithmInstances
6-
private import experimental.quantum.OpenSSL.LibraryDetector
76

87
abstract class HashAlgorithmValueConsumer extends OpenSSLAlgorithmValueConsumer { }
98

109
/**
1110
* EVP_Q_Digest directly consumes algorithm constant values
1211
*/
13-
class EVP_Q_Digest_Algorithm_Consumer extends OpenSSLAlgorithmValueConsumer {
14-
EVP_Q_Digest_Algorithm_Consumer() {
15-
isPossibleOpenSSLFunction(this.(Call).getTarget()) and
16-
this.(Call).getTarget().getName() = "EVP_Q_digest"
17-
}
12+
class EVP_Q_Digest_Algorithm_Consumer extends HashAlgorithmValueConsumer {
13+
EVP_Q_Digest_Algorithm_Consumer() { this.(Call).getTarget().getName() = "EVP_Q_digest" }
1814

1915
override Crypto::ConsumerInputDataFlowNode getInputNode() {
2016
result.asExpr() = this.(Call).getArgument(1)
@@ -35,13 +31,12 @@ class EVP_Q_Digest_Algorithm_Consumer extends OpenSSLAlgorithmValueConsumer {
3531
* The EVP digest algorithm getters
3632
* https://docs.openssl.org/3.0/man3/EVP_DigestInit/#synopsis
3733
*/
38-
class EVPDigestAlgorithmValueConsumer extends OpenSSLAlgorithmValueConsumer {
34+
class EVPDigestAlgorithmValueConsumer extends HashAlgorithmValueConsumer {
3935
DataFlow::Node valueArgNode;
4036
DataFlow::Node resultNode;
4137

4238
EVPDigestAlgorithmValueConsumer() {
4339
resultNode.asExpr() = this and
44-
isPossibleOpenSSLFunction(this.(Call).getTarget()) and
4540
(
4641
this.(Call).getTarget().getName() in [
4742
"EVP_get_digestbyname", "EVP_get_digestbynid", "EVP_get_digestbyobj"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
semmle-extractor-options: -I ../../../../stubs
1+
semmle-extractor-options: -I ../../../../stubs/crypto

0 commit comments

Comments
 (0)