Skip to content

Commit a81fffc

Browse files
committed
Crypto: Fix redundant override issue.
1 parent f2f97c9 commit a81fffc

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,19 @@ abstract class EvpKeyInitializer extends EvpInitializer {
137137
* the key. Extend any instance of key initializer provide initialization
138138
* of the algorithm and key size from the key.
139139
*/
140-
class EvpInitializerThroughKey extends EvpPrimaryAlgorithmInitializer, EvpKeySizeInitializer instanceof EvpKeyInitializer
140+
class EvpInitializerThroughKey extends EvpPrimaryAlgorithmInitializer, EvpKeySizeInitializer,
141+
EvpKeyInitializer
141142
{
142-
//TODO: charpred that traces from creation to key arg, grab creator
143-
override CtxPointerSource getContext() { result = EvpKeyInitializer.super.getContext() }
143+
Expr arg;
144+
CtxPointerSource context;
145+
146+
EvpInitializerThroughKey() {
147+
exists(EvpKeyInitializer keyInit |
148+
arg = keyInit.getKeyArg() and this = keyInit and context = keyInit.getContext()
149+
)
150+
}
151+
152+
override CtxPointerSource getContext() { result = context }
144153

145154
override Expr getAlgorithmArg() {
146155
result =
@@ -151,7 +160,7 @@ class EvpInitializerThroughKey extends EvpPrimaryAlgorithmInitializer, EvpKeySiz
151160
result = getSourceKeyCreationInstanceFromArg(this.getKeyArg()).getKeySizeConsumer().asExpr()
152161
}
153162

154-
Expr getKeyArg() { result = EvpKeyInitializer.super.getKeyArg() }
163+
override Expr getKeyArg() { result = arg }
155164
}
156165

157166
/**

0 commit comments

Comments
 (0)