File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
test/query-tests/Security/CWE/CWE-327 Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,10 @@ class InsecureFunctionCall extends FunctionCall {
79
79
explain = "function call"
80
80
or
81
81
exists ( MacroInvocation mi |
82
- mi .getAnExpandedElement ( ) = this .getAnArgument ( ) and
82
+ (
83
+ mi .getAnExpandedElement ( ) = this or
84
+ mi .getAnExpandedElement ( ) = this .getAnArgument ( )
85
+ ) and
83
86
mi .getMacro ( ) = getAnInsecureEncryptionMacro ( ) and
84
87
blame = mi and
85
88
explain = "macro invocation"
@@ -97,7 +100,10 @@ class InsecureFunctionCall extends FunctionCall {
97
100
getTarget ( ) = getAdditionalEvidenceFunction ( )
98
101
or
99
102
exists ( MacroInvocation mi |
100
- mi .getAnExpandedElement ( ) = this .getAnArgument ( ) and
103
+ (
104
+ mi .getAnExpandedElement ( ) = this or
105
+ mi .getAnExpandedElement ( ) = this .getAnArgument ( )
106
+ ) and
101
107
mi .getMacro ( ) = getAdditionalEvidenceMacro ( )
102
108
)
103
109
or
Original file line number Diff line number Diff line change 24
24
| test.cpp:92:2:92:17 | call to encryptTripleDES | This function call specifies a broken or weak cryptographic algorithm. |
25
25
| test.cpp:101:2:101:15 | call to do_des_encrypt | This function call specifies a broken or weak cryptographic algorithm. |
26
26
| test.cpp:102:2:102:12 | call to DES_Set_Key | This function call specifies a broken or weak cryptographic algorithm. |
27
+ | test.cpp:121:2:121:24 | INIT_ENCRYPT_WITH_DES() | This macro invocation specifies a broken or weak cryptographic algorithm. |
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ void my_implementation8();
118
118
119
119
void test_macros2 ()
120
120
{
121
- INIT_ENCRYPT_WITH_DES (); // BAD [NOT DETECTED]
121
+ INIT_ENCRYPT_WITH_DES (); // BAD
122
122
INIT_ENCRYPT_WITH_AES (); // GOOD (good algorithm)
123
123
124
124
// ...
You can’t perform that action at this time.
0 commit comments