File tree Expand file tree Collapse file tree
src/semmle/code/java/security
test/library-tests/Encryption Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ string getAnInsecureAlgorithmName() {
9999 result = "RC5" or
100100 result = "ARCFOUR" or // a variant of RC4
101101 result = "ECB" or // encryption mode ECB like AES/ECB/NoPadding is vulnerable to replay and other attacks
102- result = "AES/CBC/PKCS5Padding " // CBC mode of operation with PKCS#5 (or PKCS#7) padding is vulnerable to padding oracle attacks
102+ result = "AES/CBC/PKCS[5|7]Padding " // CBC mode of operation with PKCS#5 (or PKCS#7) padding is vulnerable to padding oracle attacks
103103}
104104
105105/**
@@ -141,7 +141,7 @@ string getASecureAlgorithmName() {
141141 result = "SHA512" or
142142 result = "CCM" or
143143 result = "GCM" or
144- result = "AES" or
144+ result = "AES([^a-zA-Z](?!ECB|CBC/PKCS[5|7]Padding)).* " or
145145 result = "Blowfish" or
146146 result = "ECIES"
147147}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ class Test {
1414 "AES/ECB/NoPadding" ,
1515 "AES/CBC/PKCS5Padding" );
1616
17-
1817 List <String > goodStrings = Arrays .asList (
1918 "AES" ,
2019 "AES_function" ,
Original file line number Diff line number Diff line change 1- | Test.java:35 :4:35 :17 | super(...) | Test.java:35 :10:35 :15 | "some" |
2- | Test.java:39 :3:39 :38 | getInstance(...) | Test.java:39 :29:39 :37 | "another" |
1+ | Test.java:37 :4:37 :17 | super(...) | Test.java:37 :10:37 :15 | "some" |
2+ | Test.java:41 :3:41 :38 | getInstance(...) | Test.java:41 :29:41 :37 | "another" |
Original file line number Diff line number Diff line change 1- | Test.java:16 :4:16 :8 | "AES" |
2- | Test.java:17 :4:17 :17 | "AES_function" |
1+ | Test.java:18 :4:18 :8 | "AES" |
2+ | Test.java:19 :4:19 :17 | "AES_function" |
You can’t perform that action at this time.
0 commit comments