Skip to content

Commit 1882db7

Browse files
committed
Crypto: EVP Signature Operation cleanup.
1 parent fb495bf commit 1882db7

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

cpp/ql/lib/experimental/quantum/OpenSSL/Operations/EVPSignatureOperation.qll

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ class EVP_Signature_Update_Call extends EvpUpdate {
7979
* We model output explicit output arguments as predicate to use it in constructors.
8080
* The predicate must cover all EVP_Signature_Operation subclasses.
8181
*/
82+
pragma[inline]
8283
private Expr signatureOperationOutputArg(Call call) {
8384
if call.getTarget().getName() = "EVP_SignFinal_ex"
8485
then result = call.getArgument(2)
8586
else result = call.getArgument(1)
86-
////*******todo get rid of this predicate */
8787
}
8888

8989
/**
@@ -94,7 +94,6 @@ abstract class EvpSignatureOperation extends EvpOperation, Crypto::SignatureOper
9494
this.(Call).getTarget().getName().matches("EVP_%") and
9595
// NULL output argument means the call is to get the size of the signature and such call is not an operation
9696
(
97-
// ******TODO review logic
9897
not exists(signatureOperationOutputArg(this).getValue())
9998
or
10099
signatureOperationOutputArg(this).getValue() != "0"
@@ -182,16 +181,8 @@ class EVP_Signature_Final_Call extends EVPFinal, EvpSignatureOperation {
182181

183182
override CtxPointerSource getContext() { result = this.(Call).getArgument(0) }
184183

185-
//***********TODO: the algorithm arg might nto be the right type, can't use the initializer the same way if there
186-
// are two initializers for two different algorithms */
187184
override Expr getAlgorithmArg() {
188185
this.getInitCall().(EvpPrimaryAlgorithmInitializer).getAlgorithmArg() = result
189-
// // algorithm specified by the key and the key is provided in this operation
190-
// if this.(Call).getTarget().getName() in ["EVP_SignFinal", "EVP_SignFinal_ex"]
191-
// then result = getAlgorithmFromKey(this.getKeyConsumer().asExpr())
192-
// else
193-
// // or find algorithm in the initialization call
194-
// result = EVP_Signature_Operation.super.getAlgorithmArg()
195186
}
196187

197188
override Crypto::ConsumerInputDataFlowNode getKeyConsumer() {

0 commit comments

Comments
 (0)