Files
codeql/java/ql/test/query-tests/security/CWE-295/AndroidMissingCertificatePinning/Test1/test.ql
Tony Torralba 3e7a819fe7 Simplification
2022-12-20 09:42:25 +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"
)
}
}