mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
Java: Update uses.
This commit is contained in:
@@ -21,7 +21,7 @@ private class ShortStringLiteral extends StringLiteral {
|
||||
|
||||
class BrokenAlgoLiteral extends ShortStringLiteral {
|
||||
BrokenAlgoLiteral() {
|
||||
getValue().regexpMatch(algorithmBlacklistRegex()) and
|
||||
getValue().regexpMatch(getInsecureAlgorithmRegex()) and
|
||||
// Exclude German and French sentences.
|
||||
not getValue().regexpMatch(".*\\p{IsLowercase} des \\p{IsLetter}.*")
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ class InsecureAlgoLiteral extends ShortStringLiteral {
|
||||
// Algorithm identifiers should be at least two characters.
|
||||
getValue().length() > 1 and
|
||||
exists(string s | s = getLiteral() |
|
||||
not s.regexpMatch(algorithmWhitelistRegex()) and
|
||||
not s.regexpMatch(getSecureAlgorithmRegex()) and
|
||||
// Exclude results covered by another query.
|
||||
not s.regexpMatch(algorithmBlacklistRegex())
|
||||
not s.regexpMatch(getInsecureAlgorithmRegex())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ string getAnInsecureHashAlgorithmName() {
|
||||
private string rankedAlgorithmBlacklist(int i) {
|
||||
// In this case we know these are being used for encryption, so we want to match
|
||||
// weak hash algorithms too.
|
||||
result = rank[i](string s | s = algorithmBlacklist() or s = hashAlgorithmBlacklist())
|
||||
result = rank[i](string s | s = getAnInsecureAlgorithmName() or s = getAnInsecureHashAlgorithmName())
|
||||
}
|
||||
|
||||
private string algorithmBlacklistString(int i) {
|
||||
@@ -144,7 +144,7 @@ string getASecureAlgorithmName() {
|
||||
result = "ECIES"
|
||||
}
|
||||
|
||||
private string rankedAlgorithmWhitelist(int i) { result = rank[i](algorithmWhitelist()) }
|
||||
private string rankedAlgorithmWhitelist(int i) { result = rank[i](getASecureAlgorithmName()) }
|
||||
|
||||
private string algorithmWhitelistString(int i) {
|
||||
i = 1 and result = rankedAlgorithmWhitelist(i)
|
||||
|
||||
Reference in New Issue
Block a user