Skip to content

Commit ccdd9bc

Browse files
committed
Refactor Revocation checking
1 parent 380888e commit ccdd9bc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

java/ql/src/experimental/Security/CWE/CWE-299/DisabledRevocationChecking.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
import java
1515
import RevocationCheckingLib
16-
import DataFlow::PathGraph
16+
import DisabledRevocationCheckingFlow::PathGraph
1717

18-
from DataFlow::PathNode source, DataFlow::PathNode sink, DisabledRevocationCheckingConfig config
19-
where config.hasFlowPath(source, sink)
18+
from DisabledRevocationCheckingFlow::PathNode source, DisabledRevocationCheckingFlow::PathNode sink
19+
where DisabledRevocationCheckingFlow::flowPath(source, sink)
2020
select source.getNode(), source, sink, "This disables revocation checking."

java/ql/src/experimental/Security/CWE/CWE-299/RevocationCheckingLib.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import DataFlow
55
/**
66
* A taint-tracking configuration for disabling revocation checking.
77
*/
8-
class DisabledRevocationCheckingConfig extends TaintTracking::Configuration {
9-
DisabledRevocationCheckingConfig() { this = "DisabledRevocationCheckingConfig" }
10-
11-
override predicate isSource(DataFlow::Node source) {
12-
exists(BooleanLiteral b | b.getBooleanValue() = false | source.asExpr() = b)
8+
module DisabledRevocationCheckingConfig implements DataFlow::ConfigSig {
9+
predicate isSource(DataFlow::Node source) {
10+
source.asExpr().(BooleanLiteral).getBooleanValue() = false
1311
}
1412

15-
override predicate isSink(DataFlow::Node sink) { sink instanceof SetRevocationEnabledSink }
13+
predicate isSink(DataFlow::Node sink) { sink instanceof SetRevocationEnabledSink }
1614
}
1715

16+
module DisabledRevocationCheckingFlow = TaintTracking::Global<DisabledRevocationCheckingConfig>;
17+
1818
/**
1919
* A sink that disables revocation checking,
2020
* i.e. calling `PKIXParameters.setRevocationEnabled(false)`

0 commit comments

Comments
 (0)