Skip to content

Commit 22c0f9f

Browse files
committed
Crypto: Adding a proof of concept bad mac ordering predicate that takes in an ArtifactNode to be used for graph generation to intercept nodes with known mac ordering issues, in order to format the node and output error messages in the graph.
1 parent eff94ef commit 22c0f9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

java/ql/src/experimental/quantum/Examples/BadMacOrder.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ predicate isDecryptToMacFlow(ArtifactFlow::PathNode src, ArtifactFlow::PathNode
1717
)
1818
}
1919

20+
predicate isDecryptToMacNode(Crypto::ArtifactNode node) {
21+
exists(ArtifactFlow::PathNode src, ArtifactFlow::PathNode sink |
22+
isDecryptToMacFlow(src, sink) and
23+
node.asElement() = src.getNode().asExpr()
24+
)
25+
}
26+
2027
/**
2128
* Holds when the src node is used as plaintext input to both
2229
* an encryption operation and a mac operation, via the

0 commit comments

Comments
 (0)