mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: Address feedback and fix test failures
This commit is contained in:
committed by
Chris Smowton
parent
58d2d5d14e
commit
020aa4d94c
@@ -168,7 +168,7 @@ string getInsecureAlgorithmRegex() {
|
||||
string getASecureAlgorithmName() {
|
||||
result =
|
||||
[
|
||||
"RSA", "SHA256", "SHA512", "CCM", "GCM", "AES([^a-zA-Z](?!ECB|CBC/PKCS[57]Padding)).*",
|
||||
"RSA", "SHA256", "SHA512", "CCM", "GCM", "AES(?)",
|
||||
"Blowfish", "ECIES"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ predicate literalInsteadOfConstant(
|
||||
exists(string context |
|
||||
canUseFieldInsteadOfLiteral(constField, magicLiteral, context) and
|
||||
message =
|
||||
"Literal value '" + magicLiteral.getValue() + "' used " + " in a call to " + context +
|
||||
"Literal value '" + magicLiteral.getLiteral() + "' used " + " in a call to " + context +
|
||||
"; consider using the defined constant $@." and
|
||||
linkText = constField.getName() and
|
||||
(
|
||||
|
||||
@@ -4,5 +4,5 @@ nodes
|
||||
| Test.java:42:33:42:37 | "RC2" | semmle.label | "RC2" |
|
||||
subpaths
|
||||
#select
|
||||
| Test.java:19:20:19:50 | getInstance(...) | Test.java:19:45:19:49 | "DES" | Test.java:19:45:19:49 | "DES" | Cryptographic algorithm $@ is weak and should not be used. | Test.java:19:45:19:49 | "DES" | "DES" |
|
||||
| Test.java:42:14:42:38 | getInstance(...) | Test.java:42:33:42:37 | "RC2" | Test.java:42:33:42:37 | "RC2" | Cryptographic algorithm $@ is weak and should not be used. | Test.java:42:33:42:37 | "RC2" | "RC2" |
|
||||
| Test.java:19:20:19:50 | getInstance(...) | Test.java:19:45:19:49 | "DES" | Test.java:19:45:19:49 | "DES" | Cryptographic algorithm $@ is weak and should not be used. | Test.java:19:45:19:49 | "DES" | DES |
|
||||
| Test.java:42:14:42:38 | getInstance(...) | Test.java:42:33:42:37 | "RC2" | Test.java:42:33:42:37 | "RC2" | Cryptographic algorithm $@ is weak and should not be used. | Test.java:42:33:42:37 | "RC2" | RC2 |
|
||||
|
||||
@@ -3,4 +3,4 @@ nodes
|
||||
| Test.java:34:48:34:52 | "foo" | semmle.label | "foo" |
|
||||
subpaths
|
||||
#select
|
||||
| Test.java:34:21:34:53 | new SecretKeySpec(...) | Test.java:34:48:34:52 | "foo" | Test.java:34:48:34:52 | "foo" | Cryptographic algorithm $@ may not be secure, consider using a different algorithm. | Test.java:34:48:34:52 | "foo" | "foo" |
|
||||
| Test.java:34:21:34:53 | new SecretKeySpec(...) | Test.java:34:48:34:52 | "foo" | Test.java:34:48:34:52 | "foo" | Cryptographic algorithm $@ may not be secure, consider using a different algorithm. | Test.java:34:48:34:52 | "foo" | foo |
|
||||
|
||||
Reference in New Issue
Block a user