Give reason why crypto algorithm is insecure

This commit is contained in:
Owen Mansel-Chan
2024-11-29 11:18:36 +00:00
parent bcb7901758
commit e6409e159f
8 changed files with 63 additions and 31 deletions

View File

@@ -1,6 +1,10 @@
import default
import semmle.code.java.security.Encryption
from StringLiteral s
where s.getValue().regexpMatch(getInsecureAlgorithmRegex())
select s
from StringLiteral s, string reason
where
s.getValue().regexpMatch(getInsecureAlgorithmRegex()) and
if exists(getInsecureAlgorithmReason(s.getValue()))
then reason = getInsecureAlgorithmReason(s.getValue())
else reason = "<no reason>"
select s, reason