File tree Expand file tree Collapse file tree 4 files changed +6
-7
lines changed
src/semmle/code/java/security
test/library-tests/Encryption Expand file tree Collapse file tree 4 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ string getAnInsecureAlgorithmName() {
99
99
result = "RC5" or
100
100
result = "ARCFOUR" or // a variant of RC4
101
101
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
103
103
}
104
104
105
105
/**
@@ -141,7 +141,7 @@ string getASecureAlgorithmName() {
141
141
result = "SHA512" or
142
142
result = "CCM" or
143
143
result = "GCM" or
144
- result = "AES" or
144
+ result = "AES([^a-zA-Z](?!ECB|CBC/PKCS[5|7]Padding)).* " or
145
145
result = "Blowfish" or
146
146
result = "ECIES"
147
147
}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ class Test {
14
14
"AES/ECB/NoPadding" ,
15
15
"AES/CBC/PKCS5Padding" );
16
16
17
-
18
17
List <String > goodStrings = Arrays .asList (
19
18
"AES" ,
20
19
"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