-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Crypto: Model OpenSSL intermediate digest operations #19521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crypto: Model OpenSSL intermediate digest operations #19521
Conversation
…eling final and update digest separately).
…nd EVP_Final_Call used for ciphers to explicitly say "Cipher", e.g., EVP_Cipher_Update_Call. This is also consistent with the new analogous digest operations.
|
||
// NOTE: not modeled as hash operations, these are intermediate calls | ||
class EVP_Digest_Update_Call extends Call { | ||
EVP_Digest_Update_Call() { this.(Call).getTarget().getName() in ["EVP_DigestUpdate"] } |
Check warning
Code scanning / CodeQL
Singleton set literal Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the OpenSSL quantum library by adding intermediate modeling for EVP digest update/final calls and improving the algorithm-value flow in hash operations.
- Override
getAnAlgorithmValueConsumer
inEVP_Hash_Operation
to propagate the algorithm from the init call. - Introduce
EVP_Digest_Update_Call
andEVP_Digest_Final_Call
classes for intermediate digest calls. - Rename intermediate cipher call classes in
EVPCipherOperation.qll
toEVP_Cipher_Update_Call
andEVP_Cipher_Final_Call
for naming consistency.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/EVPHashOperation.qll | Added algorithm-value override and new digest intermediate call classes. |
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/EVPCipherOperation.qll | Renamed intermediate cipher call classes to include Cipher prefix. |
Comments suppressed due to low confidence (2)
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/EVPHashOperation.qll:31
- [nitpick] Remove the large commented-out code blocks and TODO comments (lines 31-101) or move them to issue trackers/documentation to improve readability.
// // override Crypto::AlgorithmValueConsumer getAnAlgorithmValueConsumer() {
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/EVPHashOperation.qll:103
- Introduce unit tests for the new
EVP_Digest_Update_Call
andEVP_Digest_Final_Call
classes to verify their data‐flow modeling.
class EVP_Digest_Update_Call extends Call {
// } | ||
// } | ||
|
||
// NOTE: not modeled as hash operations, these are intermediate calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Add a concise doc comment above the EVP_Digest_Update_Call
and EVP_Digest_Final_Call
classes to explain their intended data‐flow role.
// NOTE: not modeled as hash operations, these are intermediate calls | |
/** | |
* Represents an intermediate call to `EVP_DigestUpdate`, which processes | |
* additional input data for a digest operation. This class models the | |
* data flow of the input and context arguments used in the update step. | |
*/ |
Copilot uses AI. Check for mistakes.
…s for the OpenSSL.qll model.
Adds digest modeling for 'update' and 'final' calls in openssl.