Skip to content

Commit a5825c9

Browse files
GrosQuildumschwager
authored andcommitted
MsgNotHashedBeforeSigVerfication fixed
1 parent 40423da commit a5825c9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

go/src/crypto/MsgNotHashedBeforeSigVerfication/MsgNotHashedBeforeSigVerfication.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private module LongestFlowConfig implements DataFlow::ConfigSig {
9292
predicate isSource(DataFlow::Node source) { source = source }
9393
predicate isSink(DataFlow::Node sink) { sink = sink }
9494
}
95-
module LongestFlowFlow = TaintTracking::Global<LongestFlowConfig>;
95+
module LongestFlowFlow = DataFlow::Global<LongestFlowConfig>;
9696

9797
/**
9898
* Flows from anything to SignatureMsgTruncationFunction
@@ -138,13 +138,15 @@ module AnythingToSignatureMsgTrunFuncConfig implements DataFlow::ConfigSig {
138138
node.asExpr().getType().getUnderlyingType().(ArrayType).getLength() <= 66
139139
}
140140
}
141-
module AnythingToSignatureMsgTrunFuncFlow = TaintTracking::Global<AnythingToSignatureMsgTrunFuncConfig>;
141+
module AnythingToSignatureMsgTrunFuncFlow = DataFlow::Global<AnythingToSignatureMsgTrunFuncConfig>;
142+
import AnythingToSignatureMsgTrunFuncFlow::PathGraph
142143

143144
from AnythingToSignatureMsgTrunFuncFlow::PathNode source, AnythingToSignatureMsgTrunFuncFlow::PathNode sink
144145
where
145146
AnythingToSignatureMsgTrunFuncFlow::flowPath(source, sink)
146147

147148
// only the longest flow
149+
// TODO: find only flows originating from user input
148150
and not exists(DataFlow::Node source2 |
149151
LongestFlowFlow::flow(source2, source.getNode())
150152
and source2 != source.getNode()

go/test/query-tests/crypto/MsgNotHashedBeforeSigVerfication/MsgNotHashedBeforeSigVerfication.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
edges
2-
| MsgNotHashedBeforeSigVerfication.go:78:33:78:46 | "test message" | MsgNotHashedBeforeSigVerfication.go:78:26:78:47 | type conversion |
3-
| MsgNotHashedBeforeSigVerfication.go:86:31:86:44 | "test message" | MsgNotHashedBeforeSigVerfication.go:86:24:86:45 | type conversion |
2+
| MsgNotHashedBeforeSigVerfication.go:78:33:78:46 | "test message" | MsgNotHashedBeforeSigVerfication.go:78:26:78:47 | type conversion | provenance | |
3+
| MsgNotHashedBeforeSigVerfication.go:86:31:86:44 | "test message" | MsgNotHashedBeforeSigVerfication.go:86:24:86:45 | type conversion | provenance | |
44
nodes
55
| MsgNotHashedBeforeSigVerfication.go:78:26:78:47 | type conversion | semmle.label | type conversion |
66
| MsgNotHashedBeforeSigVerfication.go:78:33:78:46 | "test message" | semmle.label | "test message" |

0 commit comments

Comments
 (0)