Skip to content

Commit 38fdf7e

Browse files
authored
Merge pull request #19880 from bdrodes/operation_step_refactor
Crypto: Refactor OpenSSL operation step data-flow logic
2 parents e02affd + 9f0c62b commit 38fdf7e

File tree

19 files changed

+1513
-1129
lines changed

19 files changed

+1513
-1129
lines changed

cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/MACAlgorithmInstance.qll

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ class KnownOpenSslHMacConstantAlgorithmInstance extends Crypto::HmacAlgorithmIns
5454
then
5555
// ASSUMPTION: if there is an explicit hash algorithm, it is already modeled
5656
// and we can simply grab that model's AVC
57-
exists(OpenSslAlgorithmInstance inst | inst.getAvc() = result and inst = this)
57+
this.(OpenSslAlgorithmInstance).getAvc() = result
5858
else
59-
// ASSUMPTION: If no explicit algorithm is given, then it is assumed to be configured by
60-
// a signature operation
61-
exists(Crypto::SignatureOperationInstance s |
62-
s.getHashAlgorithmValueConsumer() = result and
63-
s.getAnAlgorithmValueConsumer() = this.getAvc()
59+
// ASSUMPTION: If no explicit algorithm is given, then find
60+
// where the current AVC traces to a HashAlgorithmIO consuming operation step.
61+
// TODO: need to consider getting reset values, tracing down to the first set for now
62+
exists(OperationStep s, AvcContextCreationStep avc |
63+
avc = this.getAvc() and
64+
avc.flowsToOperationStep(s) and
65+
s.getAlgorithmValueConsumerForInput(HashAlgorithmIO()) = result
6466
)
6567
}
6668
}

cpp/ql/lib/experimental/quantum/OpenSSL/CtxFlow.qll

Lines changed: 0 additions & 221 deletions
This file was deleted.

0 commit comments

Comments
 (0)