Skip to content

Commit 6a865ed

Browse files
committed
CPP: De-duplicate TlsSettingsMisconfiguration.ql.
1 parent fa20325 commit 6a865ed

1 file changed

Lines changed: 2 additions & 23 deletions

File tree

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

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,8 @@ predicate isOptionSet(ConstructorCall cc, int flag, FunctionCall fcSetOptions) {
4646

4747
bindingset[flag]
4848
predicate isOptionNotSet(ConstructorCall cc, int flag) {
49-
not exists(
50-
BoostorgAsio::SslContextFlowsToSetOptionConfig config, ExistsAnyFlowConfig testConfig,
51-
Expr optionsSink
52-
|
53-
config.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(optionsSink)) and
54-
exists(VariableAccess contextSetOptions |
55-
testConfig.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(contextSetOptions)) and
56-
exists(FunctionCall fcSetOptions, BoostorgAsio::SslSetOptionsFunction f |
57-
f.getACallToThisFunction() = fcSetOptions
58-
|
59-
contextSetOptions = fcSetOptions.getQualifier() and
60-
forall(
61-
Expr optionArgument, BoostorgAsio::SslOptionConfig optionArgConfig,
62-
Expr optionArgumentSource
63-
|
64-
optionArgument = fcSetOptions.getArgument(0) and
65-
optionArgConfig
66-
.hasFlow(DataFlow::exprNode(optionArgumentSource), DataFlow::exprNode(optionArgument))
67-
|
68-
optionArgument.getValue().toInt().bitShiftRight(16).bitAnd(flag) = flag
69-
)
70-
)
71-
)
49+
not exists(FunctionCall fcSetOptions |
50+
isOptionSet(cc, flag, fcSetOptions)
7251
)
7352
}
7453

0 commit comments

Comments
 (0)