22 * Provides modeling of SSL/TLS functionality of the `ssl` module from the standard library.
33 * See https://docs.python.org/3.9/library/ssl.html
44 */
5+
56private import python
67private import semmle.python.ApiGraphs
78import TlsLibraryModel
89
9- class SSLContextCreation extends ContextCreation {
10- override CallNode node ;
11-
10+ class SSLContextCreation extends ContextCreation , DataFlow:: CallCfgNode {
1211 SSLContextCreation ( ) { this = API:: moduleImport ( "ssl" ) .getMember ( "SSLContext" ) .getACall ( ) }
1312
1413 override string getProtocol ( ) {
@@ -46,7 +45,7 @@ class WrapSocketCall extends ConnectionCreation, DataFlow::CallCfgNode {
4645 }
4746}
4847
49- class OptionsAugOr extends ProtocolRestriction {
48+ class OptionsAugOr extends ProtocolRestriction , DataFlow :: CallCfgNode {
5049 ProtocolVersion restriction ;
5150
5251 OptionsAugOr ( ) {
@@ -69,7 +68,7 @@ class OptionsAugOr extends ProtocolRestriction {
6968 override ProtocolVersion getRestriction ( ) { result = restriction }
7069}
7170
72- class OptionsAugAndNot extends ProtocolUnrestriction {
71+ class OptionsAugAndNot extends ProtocolUnrestriction , DataFlow :: CallCfgNode {
7372 ProtocolVersion restriction ;
7473
7574 OptionsAugAndNot ( ) {
@@ -127,7 +126,7 @@ predicate impliesBitSet(BinaryExpr whole, Expr part, boolean partHasBitSet, bool
127126 )
128127}
129128
130- class ContextSetVersion extends ProtocolRestriction , ProtocolUnrestriction {
129+ class ContextSetVersion extends ProtocolRestriction , ProtocolUnrestriction , DataFlow :: CallCfgNode {
131130 ProtocolVersion restriction ;
132131
133132 ContextSetVersion ( ) {
@@ -189,8 +188,7 @@ class Ssl extends TlsLibrary {
189188
190189 override DataFlow:: CfgNode insecure_connection_creation ( ProtocolVersion version ) {
191190 result = API:: moduleImport ( "ssl" ) .getMember ( "wrap_socket" ) .getACall ( ) and
192- this .specific_version ( version ) =
193- result .( DataFlow:: CallCfgNode ) .getArgByName ( "ssl_version" ) and
191+ this .specific_version ( version ) = result .( DataFlow:: CallCfgNode ) .getArgByName ( "ssl_version" ) and
194192 version .isInsecure ( )
195193 }
196194
0 commit comments