Skip to content

Commit c98e6d7

Browse files
committed
Adding a stub EVP_CIpher_Operation for EVP_PKEY, this probably should be made into it's own class, hence it is a stub with comments.
1 parent a9458ba commit c98e6d7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cpp/ql/lib/experimental/Quantum/OpenSSL/EVPCipherOperation.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ class EVP_Encrypt_Decrypt_or_Cipher_Final_Call extends EVP_Final_Call {
7070
}
7171
}
7272

73+
class EVP_PKEY_Operation extends EVP_Cipher_Operation {
74+
EVP_PKEY_Operation() {
75+
this.(Call).getTarget().getName() in ["EVP_PKEY_decrypt", "EVP_PKEY_encrypt"]
76+
}
77+
78+
override Expr getInputArg() { result = this.(Call).getArgument(3) }
79+
// TODO: how PKEY is initialized is different that symmetric cipher
80+
// Consider making an entirely new class for this and specializing
81+
// the get init call
82+
}
83+
7384
class EVPCipherOutput extends CipherOutputArtifact {
7485
EVPCipherOutput() { exists(EVP_Cipher_Operation op | op.getOutputArg() = this) }
7586

0 commit comments

Comments
 (0)