mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Moved Cpp into sub directory 'cryptography' instead of crypto. Added python models, inventory, and example alerts.
This commit is contained in:
committed by
Josh Brown
parent
7560db66fa
commit
50db4fd63e
@@ -1,5 +0,0 @@
|
||||
import experimental.crypto.CryptoArtifact
|
||||
import experimental.crypto.CryptoAlgorithmNames
|
||||
|
||||
import experimental.crypto.modules.OpenSSL as OpenSSL
|
||||
|
||||
5
cpp/ql/lib/experimental/cryptography/Concepts.qll
Normal file
5
cpp/ql/lib/experimental/cryptography/Concepts.qll
Normal file
@@ -0,0 +1,5 @@
|
||||
import experimental.cryptography.CryptoArtifact
|
||||
import experimental.cryptography.CryptoAlgorithmNames
|
||||
|
||||
import experimental.cryptography.modules.OpenSSL as OpenSSL
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
private import experimental.crypto.CryptoAlgorithmNames
|
||||
private import experimental.cryptography.CryptoAlgorithmNames
|
||||
import semmle.code.cpp.ir.dataflow.TaintTracking
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import cpp
|
||||
import experimental.crypto.CryptoAlgorithmNames
|
||||
import experimental.crypto.CryptoArtifact
|
||||
import experimental.crypto.utils.OpenSSL.CryptoFunction
|
||||
import experimental.crypto.utils.OpenSSL.AlgorithmSink
|
||||
import experimental.crypto.utils.OpenSSL.PassthroughFunction
|
||||
import experimental.crypto.utils.OpenSSL.CryptoAlgorithm
|
||||
import experimental.crypto.CryptoArtifact
|
||||
import experimental.cryptography.CryptoAlgorithmNames
|
||||
import experimental.cryptography.CryptoArtifact
|
||||
import experimental.cryptography.utils.OpenSSL.CryptoFunction
|
||||
import experimental.cryptography.utils.OpenSSL.AlgorithmSink
|
||||
import experimental.cryptography.utils.OpenSSL.PassthroughFunction
|
||||
import experimental.cryptography.utils.OpenSSL.CryptoAlgorithm
|
||||
import experimental.cryptography.CryptoArtifact
|
||||
// import semmle.code.cpp.ir.dataflow.TaintTracking
|
||||
import semmle.code.cpp.ir.dataflow.DataFlow
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
//TODO: enforce a hierarchy of AlgorithmSinkArgument, e.g., so I can get all Asymmetric SinkArguments that includes all the strictly RSA etc.
|
||||
import cpp
|
||||
import experimental.crypto.utils.OpenSSL.LibraryFunction
|
||||
import experimental.crypto.CryptoAlgorithmNames
|
||||
import experimental.cryptography.utils.OpenSSL.LibraryFunction
|
||||
import experimental.cryptography.CryptoAlgorithmNames
|
||||
|
||||
predicate isAlgorithmSink(AlgorithmSinkArgument arg, string algType){
|
||||
arg.algType() = algType
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
import experimental.crypto.CryptoAlgorithmNames
|
||||
import experimental.cryptography.CryptoAlgorithmNames
|
||||
|
||||
predicate isValidAlgorithmLiteral(Literal e){
|
||||
exists(getPossibleNidFromLiteral(e)) or e instanceof StringLiteral
|
||||
@@ -1,6 +1,6 @@
|
||||
import cpp
|
||||
import experimental.crypto.utils.OpenSSL.LibraryFunction
|
||||
import experimental.crypto.CryptoAlgorithmNames
|
||||
import experimental.cryptography.utils.OpenSSL.LibraryFunction
|
||||
import experimental.cryptography.CryptoAlgorithmNames
|
||||
|
||||
predicate inferredOpenSSLCryptoFunctionCall(Call c , string normalized, string algType){
|
||||
inferredOpenSSLCryptoFunction(c.getTarget(), normalized, algType)
|
||||
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.CryptoAlgorithmNames
|
||||
import experimental.crypto.utils.OpenSSL.CryptoFunction
|
||||
import experimental.cryptography.CryptoAlgorithmNames
|
||||
import experimental.cryptography.utils.OpenSSL.CryptoFunction
|
||||
|
||||
|
||||
private string basicNormalizeFunctionName(Function f, string algType) {
|
||||
@@ -1,5 +1,5 @@
|
||||
import cpp
|
||||
import experimental.crypto.utils.OpenSSL.LibraryFunction
|
||||
import experimental.cryptography.utils.OpenSSL.LibraryFunction
|
||||
import semmle.code.cpp.ir.dataflow.DataFlow
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import cpp
|
||||
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AsymmetricKeyGeneration op, AsymmetricAlgorithm alg
|
||||
where
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import cpp
|
||||
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AsymmetricKeyGeneration op, AsymmetricAlgorithm alg, Expr configSrc, int size
|
||||
where
|
||||
@@ -9,7 +9,7 @@
|
||||
* external/cwe/cwe-327
|
||||
*/
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from BlockModeAlgorithm alg, string name, string msg, Expr confSink
|
||||
where
|
||||
@@ -9,7 +9,7 @@
|
||||
* external/cwe/cwe-327
|
||||
*/
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from EllipticCurveAlgorithm alg, string name, string msg, Expr confSink
|
||||
where
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
|
||||
from SymmetricEncryptionAlgorithm alg, Expr confSink, string msg
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import cpp
|
||||
import semmle.code.cpp.dataflow.DataFlow as ASTDataFlow
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from HashAlgorithm alg, Expr confSink, string msg
|
||||
where
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AsymmetricAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from CryptographicAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AsymmetricEncryptionAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getEncryptionName()
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
// TODO: currently not modeled for any API
|
||||
from AsymmetricPadding alg
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AuthenticatedEncryptionAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getAuthticatedEncryptionName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from BlockModeAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getBlockModeName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
// TODO: currently not modeled for any API
|
||||
from BlockModeAlgorithm alg
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
// TODO: currently not modeled for any API
|
||||
from BlockModeAlgorithm alg
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from EllipticCurveAlgorithm alg, string size
|
||||
where
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from EllipticCurveAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getCurveName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from HashAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from KeyExchangeAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getName()
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AsymmetricKeyGeneration op, CryptographicAlgorithm alg, Expr configSrc
|
||||
where
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
// TODO: currently not modeled for any API
|
||||
from SigningAlgorithm alg
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from SymmetricEncryptionAlgorithm alg
|
||||
select alg, "Use of algorithm " + alg.getEncryptionName()
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
// TODO: currently not modeled for any API
|
||||
from SymmetricPadding alg
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
import cpp
|
||||
import experimental.crypto.Concepts
|
||||
import experimental.cryptography.Concepts
|
||||
|
||||
from AsymmetricKeyGeneration op, CryptographicAlgorithm alg
|
||||
where
|
||||
Reference in New Issue
Block a user