Skip to content

Commit b77923f

Browse files
authored
Merge pull request github#11767 from atorralba/atorralba/java/fix-pinning-tests
Java: Small simplification in Missing Certificate Pinning tests
2 parents 597523e + ab73d13 commit b77923f

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

java/ql/test/query-tests/security/CWE-295/AndroidMissingCertificatePinning/Test2/test.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ class Test extends InlineExpectationsTest {
1313
loc = node.getLocation() and
1414
el = node.toString() and
1515
value = "" and
16-
(
17-
if exists(string x | trustedDomain(x))
18-
then tag = "hasUntrustedResult"
19-
else tag = "hasNoTrustedResult"
20-
)
16+
if trustedDomain(_) then tag = "hasUntrustedResult" else tag = "hasNoTrustedResult"
2117
)
2218
}
2319
}

java/ql/test/query-tests/security/CWE-295/AndroidMissingCertificatePinning/Test3/test.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ class Test extends InlineExpectationsTest {
1313
loc = node.getLocation() and
1414
el = node.toString() and
1515
value = "" and
16-
(
17-
if exists(string x | trustedDomain(x))
18-
then tag = "hasUntrustedResult"
19-
else tag = "hasNoTrustedResult"
20-
)
16+
if trustedDomain(_) then tag = "hasUntrustedResult" else tag = "hasNoTrustedResult"
2117
)
2218
}
2319
}

java/ql/test/query-tests/security/CWE-295/AndroidMissingCertificatePinning/Test4/test.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ class Test extends InlineExpectationsTest {
1313
loc = node.getLocation() and
1414
el = node.toString() and
1515
value = "" and
16-
(
17-
if exists(string x | trustedDomain(x))
18-
then tag = "hasUntrustedResult"
19-
else tag = "hasNoTrustedResult"
20-
)
16+
if trustedDomain(_) then tag = "hasUntrustedResult" else tag = "hasNoTrustedResult"
2117
)
2218
}
2319
}

java/ql/test/query-tests/security/CWE-295/AndroidMissingCertificatePinning/Test5/test.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ class Test extends InlineExpectationsTest {
1313
loc = node.getLocation() and
1414
el = node.toString() and
1515
value = "" and
16-
(
17-
if exists(string x | trustedDomain(x))
18-
then tag = "hasUntrustedResult"
19-
else tag = "hasNoTrustedResult"
20-
)
16+
if trustedDomain(_) then tag = "hasUntrustedResult" else tag = "hasNoTrustedResult"
2117
)
2218
}
2319
}

0 commit comments

Comments
 (0)