Files
codeql/java/ql/test/query-tests/security/CWE-295/AndroidMissingCertificatePinning/Test4/test.ql
2022-12-21 09:58:13 +01:00

20 lines
666 B
Plaintext

import java
import TestUtilities.InlineExpectationsTest
import semmle.code.java.security.AndroidCertificatePinningQuery
class Test extends InlineExpectationsTest {
Test() { this = "AndroidMissingCertificatePinningTest" }
override string getARelevantTag() { result = ["hasNoTrustedResult", "hasUntrustedResult"] }
override predicate hasActualResult(Location loc, string el, string tag, string value) {
exists(DataFlow::Node node |
missingPinning(node, _) and
loc = node.getLocation() and
el = node.toString() and
value = "" and
if trustedDomain(_) then tag = "hasUntrustedResult" else tag = "hasNoTrustedResult"
)
}
}