Skip to content

Commit f22db2a

Browse files
committed
Python: One family to rule them all...
1 parent a0e3e3a commit f22db2a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,10 @@ abstract class UnspecificContextCreation extends ContextCreation, ProtocolUnrest
7171
override DataFlow::CfgNode getContext() { result = this }
7272

7373
override ProtocolVersion getUnrestriction() {
74-
// see https://www.openssl.org/docs/man1.1.0/man3/TLS_method.html
75-
family = "TLS" and
76-
result in ["SSLv3", "TLSv1", "TLSv1_1", "TLSv1_2", "TLSv1_3"]
77-
or
78-
// This can negotiate a TLS 1.3 connection (!)
79-
// see
80-
// - https://docs.python.org/3/library/ssl.html#ssl-contexts
81-
// - https://www.openssl.org/docs/man1.0.2/man3/TLSv1_method.html
82-
family = "SSLv23" and
74+
// There is only one family, the two names are aliases in OpenSSL.
75+
// see https://github.com/openssl/openssl/blob/13888e797c5a3193e91d71e5f5a196a2d68d266f/include/openssl/ssl.h.in#L1953-L1955
76+
family in ["SSLv23", "TLS"] and
77+
// see https://docs.python.org/3/library/ssl.html#ssl-contexts
8378
result in ["SSLv2", "SSLv3", "TLSv1", "TLSv1_1", "TLSv1_2", "TLSv1_3"]
8479
}
8580
}

0 commit comments

Comments
 (0)