File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
test/query-tests/Security/CWE/CWE-327 Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ import semmle.code.cpp.security.Encryption
19
19
Function getAnInsecureEncryptionFunction ( ) {
20
20
(
21
21
isInsecureEncryption ( result .getName ( ) ) or
22
- isInsecureEncryption ( result .getAParameter ( ) .getName ( ) )
22
+ isInsecureEncryption ( result .getAParameter ( ) .getName ( ) ) or
23
+ isInsecureEncryption ( result .getDeclaringType ( ) .getName ( ) )
23
24
) and
24
25
exists ( result .getACallToThisFunction ( ) )
25
26
}
Original file line number Diff line number Diff line change 6
6
| test2.cpp:175:28:175:34 | USE_DES | This enum constant access specifies a broken or weak cryptographic algorithm. |
7
7
| test2.cpp:182:38:182:45 | ALGO_DES | This macro invocation specifies a broken or weak cryptographic algorithm. |
8
8
| test2.cpp:185:38:185:44 | USE_DES | This enum constant access specifies a broken or weak cryptographic algorithm. |
9
+ | test2.cpp:234:2:234:20 | call to encrypt | This function call specifies a broken or weak cryptographic algorithm. |
10
+ | test2.cpp:239:5:239:11 | call to encrypt | This function call specifies a broken or weak cryptographic algorithm. |
9
11
| test.cpp:38:2:38:31 | ENCRYPT_WITH_DES(data,amount) | This macro invocation specifies a broken or weak cryptographic algorithm. |
10
12
| test.cpp:39:2:39:31 | ENCRYPT_WITH_RC2(data,amount) | This macro invocation specifies a broken or weak cryptographic algorithm. |
11
13
| test.cpp:51:2:51:32 | DES_DO_ENCRYPTION(data,amount) | This macro invocation specifies a broken or weak cryptographic algorithm. |
Original file line number Diff line number Diff line change @@ -231,12 +231,12 @@ class aesCipher
231
231
232
232
void do_classes (const char *data)
233
233
{
234
- desEncrypt::encrypt (data); // BAD [NOT DETECTED]
234
+ desEncrypt::encrypt (data); // BAD
235
235
aes256Encrypt::encrypt (data); // GOOD
236
236
237
237
desCipher dc;
238
238
aesCipher ac;
239
- dc.encrypt (data); // BAD [NOT DETECTED]
239
+ dc.encrypt (data); // BAD
240
240
ac.encrypt (data); // GOOD
241
241
}
242
242
You can’t perform that action at this time.
0 commit comments