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
1919Function getAnInsecureEncryptionFunction ( ) {
2020 (
2121 isInsecureEncryption ( result .getName ( ) ) or
22- isInsecureEncryption ( result .getAParameter ( ) .getName ( ) )
22+ isInsecureEncryption ( result .getAParameter ( ) .getName ( ) ) or
23+ isInsecureEncryption ( result .getDeclaringType ( ) .getName ( ) )
2324 ) and
2425 exists ( result .getACallToThisFunction ( ) )
2526}
Original file line number Diff line number Diff line change 66| test2.cpp:175:28:175:34 | USE_DES | This enum constant access specifies a broken or weak cryptographic algorithm. |
77| test2.cpp:182:38:182:45 | ALGO_DES | This macro invocation specifies a broken or weak cryptographic algorithm. |
88| 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. |
911| test.cpp:38:2:38:31 | ENCRYPT_WITH_DES(data,amount) | This macro invocation specifies a broken or weak cryptographic algorithm. |
1012| test.cpp:39:2:39:31 | ENCRYPT_WITH_RC2(data,amount) | This macro invocation specifies a broken or weak cryptographic algorithm. |
1113| 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
231231
232232void do_classes (const char *data)
233233{
234- desEncrypt::encrypt (data); // BAD [NOT DETECTED]
234+ desEncrypt::encrypt (data); // BAD
235235 aes256Encrypt::encrypt (data); // GOOD
236236
237237 desCipher dc;
238238 aesCipher ac;
239- dc.encrypt (data); // BAD [NOT DETECTED]
239+ dc.encrypt (data); // BAD
240240 ac.encrypt (data); // GOOD
241241}
242242
You can’t perform that action at this time.
0 commit comments