Crypto: Refactor OpenSSL operation step data-flow logic#19880
Merged
nicolaswill merged 16 commits intogithub:mainfrom Jun 27, 2025
Merged
Crypto: Refactor OpenSSL operation step data-flow logic#19880nicolaswill merged 16 commits intogithub:mainfrom
nicolaswill merged 16 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Quantum CodeQL library to introduce a unified OperationStep model for API inputs/outputs across OpenSSL operations. The key changes are:
- Introduce a new
OperationStepbase class withIOTypeandOperationStepTypeenums for standardized dataflow modeling - Add dedicated QL modules (
SignatureOperation,KeyGenOperation,HashOperation,CipherOperation) that extendOperationStepfor each OpenSSL API pattern - Update imports and remove legacy operation modules, wiring in new dataflow analyses (
OperationStepFlow,AvcToOperationStepFlow,EncValToInitEncArgFlow) inOpenSSLOperationBase.qll
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| shared/quantum/codeql/quantum/experimental/Model.qll | Added getRawKeyValueConsumer and raw‐value source logic, with a TODO left |
| cpp/ql/test/experimental/library-tests/quantum/{nodes,node_properties,node_edges}.expected | Updated expected outputs to cover new KeyGeneration and SignatureOperation nodes |
| cpp/ql/lib/experimental/quantum/OpenSSL/Operations/SignatureOperation.qll | New OperationStep‐based QL module for signature APIs |
| cpp/ql/lib/experimental/quantum/OpenSSL/Operations/OpenSSLOperations.qll | Swapped out legacy imports for new CipherOperation, HashOperation, etc. |
Comments suppressed due to low confidence (4)
shared/quantum/codeql/quantum/experimental/Model.qll:1923
- [nitpick] The method name getARawValueSource uses an extra 'A' prefix which is inconsistent with other method names; consider renaming it to getRawValueSource for clarity.
NodeBase getARawValueSource() {
shared/quantum/codeql/quantum/experimental/Model.qll:1935
- There is a lingering TODO in getChild regarding raw key output; to improve maintainability, address this case or remove the placeholder before merging.
//TODO: how do I output the raw key if known? If not known, it may not require/have a raw value consumer, don't output
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/OpenSSLOperations.qll:2
- [nitpick] After refactoring the import list, verify that all required operation modules are present and remove any stale imports to avoid missing dependencies.
import CipherOperation
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/SignatureOperation.qll:1
- New
OperationStep‐based modules like SignatureOperation.qll do not have dedicated unit tests inlibrary-tests/quantum; consider adding tests to validate their dataflow behaviors.
/**
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/OpenSSLOperationBase.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/OpenSSLOperationBase.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/OpenSSLOperationBase.qll
Fixed
Show fixed
Hide fixed
nicolaswill
requested changes
Jun 26, 2025
… failures do not make sense.
nicolaswill
requested changes
Jun 27, 2025
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/MACAlgorithmInstance.qll
Outdated
Show resolved
Hide resolved
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/CipherOperation.qll
Outdated
Show resolved
Hide resolved
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/HashOperation.qll
Outdated
Show resolved
Hide resolved
Contributor
|
I've kicked off CI runs again. |
…AlgorithmInstance.qll Co-authored-by: Nicolas Will <nicolaswill@github.com>
nicolaswill
approved these changes
Jun 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor to use 'OperationStep' to model API input/outputs for individual functions.