File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
sonar-kotlin-checks/src/main/java/org/sonarsource/kotlin/checks Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,14 @@ private const val msg = "Use a strong cipher algorithm."
39
39
private val cipherGetInstanceMatcher = FunMatcher (qualifier = " javax.crypto.Cipher" , name = " getInstance" )
40
40
private val nullCipherConstructorMatcher = ConstructorMatcher (" javax.crypto.NullCipher" )
41
41
42
- @org.sonarsource.kotlin.api.frontend.K1only
43
42
@Rule(key = " S5547" )
44
43
class StrongCipherAlgorithmCheck : AbstractCheck () {
45
44
override fun visitCallExpression (callExpr : KtCallExpression , kotlinFileContext : KotlinFileContext ) {
46
- val (_, _, bindingContext) = kotlinFileContext
47
- if (nullCipherConstructorMatcher.matches(callExpr, bindingContext)) {
45
+ if (nullCipherConstructorMatcher.matches(callExpr)) {
48
46
kotlinFileContext.reportIssue(callExpr, msg)
49
- } else if (cipherGetInstanceMatcher.matches(callExpr, bindingContext )) {
47
+ } else if (cipherGetInstanceMatcher.matches(callExpr)) {
50
48
callExpr.valueArguments.firstOrNull()?.let { arg ->
51
- arg.getArgumentExpression()?.predictRuntimeStringValue(bindingContext )?.uppercase()?.let { candidateString ->
49
+ arg.getArgumentExpression()?.predictRuntimeStringValue()?.uppercase()?.let { candidateString ->
52
50
if (weakCiphers.any { cipher -> candidateString == cipher || candidateString.startsWith(" $cipher /" ) }) {
53
51
kotlinFileContext.reportIssue(arg, msg)
54
52
}
You can’t perform that action at this time.
0 commit comments