Skip to content

Commit 072765a

Browse files
committed
Crypto: Code scanning warning corrections.
1 parent 93bad3c commit 072765a

File tree

4 files changed

+7
-89
lines changed

4 files changed

+7
-89
lines changed

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

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ class EvpCipherUpdateCall extends OperationStep {
154154
}
155155

156156
/**
157-
* see: https://docs.openssl.org/master/man3/EVP_EncryptInit/#synopsis
158-
* Base configuration for all EVP cipher operations.
157+
* A base configuration for all EVP cipher operations.
159158
*/
160159
abstract class EvpCipherOperationFinalStep extends OperationStep {
161160
override DataFlow::Node getInput(IOType type) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ class EvpDigestUpdateCall extends OperationStep {
5656
/**
5757
* A base class for final digest operations.
5858
*/
59-
abstract class EVPFinalDigestOperationStep extends OperationStep {
59+
abstract class EvpFinalDigestOperationStep extends OperationStep {
6060
override OperationStepType getStepType() { result = FinalStep() }
6161
}
6262

6363
/**
6464
* A call to `EVP_Q_digest`
6565
* https://docs.openssl.org/3.0/man3/EVP_DigestInit/#synopsis
6666
*/
67-
class EvpQDigestOperation extends EVPFinalDigestOperationStep {
67+
class EvpQDigestOperation extends EvpFinalDigestOperationStep {
6868
EvpQDigestOperation() { this.(Call).getTarget().getName() = "EVP_Q_digest" }
6969

7070
override DataFlow::Node getInput(IOType type) {
@@ -83,7 +83,7 @@ class EvpQDigestOperation extends EVPFinalDigestOperationStep {
8383
}
8484
}
8585

86-
class EvpDigestOperation extends EVPFinalDigestOperationStep {
86+
class EvpDigestOperation extends EvpFinalDigestOperationStep {
8787
EvpDigestOperation() { this.(Call).getTarget().getName() = "EVP_Digest" }
8888

8989
override DataFlow::Node getInput(IOType type) {
@@ -100,7 +100,7 @@ class EvpDigestOperation extends EVPFinalDigestOperationStep {
100100
/**
101101
* A call to EVP_DigestFinal variants
102102
*/
103-
class EvpDigestFinalCall extends EVPFinalDigestOperationStep {
103+
class EvpDigestFinalCall extends EvpFinalDigestOperationStep {
104104
EvpDigestFinalCall() {
105105
this.(Call).getTarget().getName() in [
106106
"EVP_DigestFinal", "EVP_DigestFinal_ex", "EVP_DigestFinalXOF"
@@ -122,7 +122,7 @@ class EvpDigestFinalCall extends EVPFinalDigestOperationStep {
122122
/**
123123
* An openssl digest final hash operation instance
124124
*/
125-
class EvpDigestFinalOperationInstance extends Crypto::HashOperationInstance instanceof EVPFinalDigestOperationStep
125+
class EvpDigestFinalOperationInstance extends Crypto::HashOperationInstance instanceof EvpFinalDigestOperationStep
126126
{
127127
override Crypto::AlgorithmValueConsumer getAnAlgorithmValueConsumer() {
128128
super.getPrimaryAlgorithmValueConsumer() = result

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import semmle.code.cpp.dataflow.new.DataFlow
66
// even if only importing the operation by itself.
77
import EVPPKeyCtxInitializer
88

9-
//TODO: this needs to just be ctx type definitions
10-
// private import experimental.quantum.OpenSSL.CtxTypes
119
/**
1210
* An openSSL CTX type, which is type for which the stripped underlying type
1311
* matches the pattern 'evp_%ctx_%st'.
@@ -51,13 +49,6 @@ class CtxPointerArgument extends CtxPointerExpr {
5149
Call getCall() { result.getAnArgument() = this }
5250
}
5351

54-
/**
55-
* A call returning a CtxPointerExpr.
56-
*/
57-
private class CtxPointerReturn extends CtxPointerExpr instanceof Call {
58-
Call getCall() { result = this }
59-
}
60-
6152
/**
6253
* The type of inputs and ouputs for an `OperationStep`.
6354
*/
@@ -330,9 +321,6 @@ abstract class OperationStep extends Call {
330321
* we will use both cases as primary inputs.
331322
*/
332323
class AvcContextCreationStep extends OperationStep instanceof OpenSslAlgorithmValueConsumer {
333-
DataFlow::Node output;
334-
DataFlow::Node input;
335-
336324
override DataFlow::Node getOutput(IOType type) {
337325
type = ContextIO() and result = super.getResultNode()
338326
}
@@ -477,7 +465,7 @@ module OperationStepFlowConfig implements DataFlow::ConfigSig {
477465
// is defined.
478466
exists(OperationStep s | s.getAnInput() = node1 and s.getAnOutput() = node2)
479467
// TODO: consideration for additional alises defined as follows:
480-
// if an output from an operation step itself flows from teh output of another operation step
468+
// if an output from an operation step itself flows from the output of another operation step
481469
// then the source of that flow's outputs (all of them) are potential aliases
482470
}
483471
}

0 commit comments

Comments
 (0)