Skip to content

Commit 36e565d

Browse files
Use classes from semmle.code.java.security.Encryption
1 parent 651e43d commit 36e565d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

java/ql/src/experimental/Security/CWE/CWE-297/IgnoredHostnameVerification.ql

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@
1111
*/
1212

1313
import java
14-
15-
/** The `HostnameVerifier.verify()` method. */
16-
private class HostnameVerifierVerifyMethod extends Method {
17-
HostnameVerifierVerifyMethod() {
18-
this.getDeclaringType().getASupertype*().hasQualifiedName("javax.net.ssl", "HostnameVerifier") and
19-
this.hasStringSignature("verify(String, SSLSession)")
20-
}
21-
}
14+
import semmle.code.java.security.Encryption
2215

2316
/** A `HostnameVerifier.verify()` call that is not wrapped in another `HostnameVerifier`. */
2417
private class HostnameVerificationCall extends MethodAccess {
2518
HostnameVerificationCall() {
26-
this.getMethod() instanceof HostnameVerifierVerifyMethod and
27-
not this.getCaller() instanceof HostnameVerifierVerifyMethod
19+
this.getMethod() instanceof HostnameVerifierVerify and
20+
not this.getCaller() instanceof HostnameVerifierVerify
2821
}
2922

3023
/** Holds if the result of the call is not used. */

0 commit comments

Comments
 (0)