Skip to content

Commit f7a6628

Browse files
committed
simplify usesSsl()
1 parent 2d87489 commit f7a6628

File tree

1 file changed

+4
-11
lines changed
  • ruby/ql/lib/codeql/ruby/frameworks

1 file changed

+4
-11
lines changed

ruby/ql/lib/codeql/ruby/frameworks/Ldap.qll

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,10 @@ module NetLdap {
3232
NetLdapConnection() { this in [ldap().getAnInstantiation(), ldap().getAMethodCall(["open"])] }
3333

3434
predicate usesSsl() {
35-
this.getKeywordArgument("encryption").getConstantValue().isStringlikeValue("simple_tls")
36-
or
37-
this.getAMethodCall("encryption")
38-
.getArgument(0)
39-
.getConstantValue()
40-
.isStringlikeValue(":simple_tls")
41-
or
42-
this.getAMethodCall("encryption")
43-
.getKeywordArgument("method")
44-
.getConstantValue()
45-
.isStringlikeValue("simple_tls")
35+
[
36+
this.getKeywordArgument("encryption"), this.getAMethodCall("encryption").getArgument(0),
37+
this.getAMethodCall("encryption").getKeywordArgument("method")
38+
].getConstantValue().isStringlikeValue("simple_tls")
4639
}
4740

4841
DataFlow::Node getAuthValue(string arg) {

0 commit comments

Comments
 (0)