Skip to content

Commit 98b9afd

Browse files
committed
CPP: Remove apparently irrelevant parts of the query.
This is not strictly behaviour preserving, but I believe the parts I've removed or simplified weren't intended to do what they were doing.
1 parent c084936 commit 98b9afd

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

cpp/ql/src/Likely Bugs/Protocols/boostorg/TlsSettingsMisconfiguration.ql

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ class ExistsAnyFlowConfig extends DataFlow::Configuration {
2222

2323
bindingset[flag]
2424
predicate isOptionSet(ConstructorCall cc, int flag, FunctionCall fcSetOptions) {
25-
exists(
26-
BoostorgAsio::SslContextFlowsToSetOptionConfig config, ExistsAnyFlowConfig anyFlowConfig,
27-
Expr optionsSink
25+
exists(BoostorgAsio::SslContextClass c, ExistsAnyFlowConfig anyFlowConfig
2826
|
29-
config.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(optionsSink)) and
27+
c.getAContructorCall() = cc and
3028
exists(VariableAccess contextSetOptions |
3129
anyFlowConfig.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(contextSetOptions)) and
3230
exists(BoostorgAsio::SslSetOptionsFunction f | f.getACallToThisFunction() = fcSetOptions |
@@ -55,15 +53,14 @@ predicate isOptionNotSet(ConstructorCall cc, int flag) {
5553

5654
from
5755
BoostorgAsio::SslContextCallTlsProtocolConfig configConstructor,
58-
BoostorgAsio::SslContextFlowsToSetOptionConfig config, Expr protocolSource, Expr protocolSink,
59-
ConstructorCall cc, Expr e, string msg
56+
Expr protocolSource, Expr protocolSink,
57+
BoostorgAsio::SslContextClass c, ConstructorCall cc, Expr e, string msg
6058
where
6159
configConstructor.hasFlow(DataFlow::exprNode(protocolSource), DataFlow::exprNode(protocolSink)) and
6260
cc.getArgument(0) = protocolSink and
6361
(
6462
BoostorgAsio::isExprSslV23BoostProtocol(protocolSource) and
65-
not exists(Expr optionsSink |
66-
config.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(optionsSink)) and
63+
not (
6764
isOptionSet(cc, BoostorgAsio::getShiftedSslOptionsNoSsl3(), _) and
6865
isOptionSet(cc, BoostorgAsio::getShiftedSslOptionsNoTls1(), _) and
6966
isOptionSet(cc, BoostorgAsio::getShiftedSslOptionsNoTls1_1(), _) and
@@ -72,8 +69,7 @@ where
7269
or
7370
BoostorgAsio::isExprTlsBoostProtocol(protocolSource) and
7471
not BoostorgAsio::isExprSslV23BoostProtocol(protocolSource) and
75-
not exists(Expr optionsSink |
76-
config.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(optionsSink)) and
72+
not (
7773
isOptionSet(cc, BoostorgAsio::getShiftedSslOptionsNoTls1(), _) and
7874
isOptionSet(cc, BoostorgAsio::getShiftedSslOptionsNoTls1_1(), _) and
7975
isOptionNotSet(cc, BoostorgAsio::getShiftedSslOptionsNoTls1_2())

0 commit comments

Comments
 (0)