Skip to content

Commit 0626684

Browse files
committed
Python: small cleanups enabled by review
1 parent acf8fd0 commit 0626684

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

python/ql/src/Security/CWE-327/FluentApiModel.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import TlsLibraryModel
33

44
/**
55
* Configuration to determine the state of a context being used to create
6-
* a conection. There is one configuration for each pair of `TlsLibrary` and `ProtocolVersion`,
6+
* a connection. There is one configuration for each pair of `TlsLibrary` and `ProtocolVersion`,
77
* such that a single configuration only tracks contexts where a specific `ProtocolVersion` is allowed.
88
*
99
* The state is in terms of whether a specific protocol is allowed. This is
@@ -73,11 +73,8 @@ predicate unsafe_connection_creation_with_context(
7373
boolean specific
7474
) {
7575
// Connection created from a context allowing `insecure_version`.
76-
exists(InsecureContextConfiguration c |
77-
c.hasFlow(contextOrigin, connectionCreation)
78-
|
76+
exists(InsecureContextConfiguration c | c.hasFlow(contextOrigin, connectionCreation) |
7977
insecure_version = c.getTrackedVersion() and
80-
contextOrigin instanceof ProtocolUnrestriction and
8178
specific = false
8279
)
8380
or
@@ -104,6 +101,5 @@ predicate unsafe_connection_creation_without_context(
104101

105102
/** Holds if `contextCreation` is creating a context ties to a specific insecure version. */
106103
predicate unsafe_context_creation(DataFlow::CallCfgNode contextCreation, string insecure_version) {
107-
contextCreation instanceof ContextCreation and
108104
exists(TlsLibrary l | contextCreation = l.insecure_context_creation(insecure_version))
109105
}

0 commit comments

Comments
 (0)