Quantum: Add OpenSSL PKEY algorithm value consumers.#19547
Merged
nicolaswill merged 2 commits intogithub:mainfrom May 21, 2025
Merged
Quantum: Add OpenSSL PKEY algorithm value consumers.#19547nicolaswill merged 2 commits intogithub:mainfrom
nicolaswill merged 2 commits intogithub:mainfrom
Conversation
…of the additional modeling, updated the generic dataflow source to match JCA with how "EC" is handled as a consumed algorithm for PKEY.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds modeling of PKEY algorithm value consumers for OpenSSL in CodeQL, enabling data-flow analysis for EVP_PKEY_* operations.
- Introduces a new
PKeyAlgorithmValueConsumersubclass (EVPPKeyAlgorithmConsumer) to capture algorithm arguments for various EVP_PKEY functions. - Registers the new consumer in
OpenSSLAlgorithmValueConsumers.qll. - Updates
Language.qllto use the new taint-tracking API (TaintTracking) and adds aConstantDataSourcefor literals.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/PKeyAlgorithmValueConsumer.qll | New consumer class capturing algorithm arguments for EVP_PKEY calls |
| cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/OpenSSLAlgorithmValueConsumers.qll | Imports the new PKey algorithm value consumer |
| cpp/ql/lib/experimental/quantum/Language.qll | Switches to TaintTracking API and adds ConstantDataSource |
Comments suppressed due to low confidence (2)
cpp/ql/lib/experimental/quantum/Language.qll:110
- The
DataFlow::ConfigSiginterface is referenced butDataFlowis no longer imported; add backimport semmle.code.cpp.dataflow.new.DataFlowor update this to useTaintTracking.
module ArtifactUniversalFlowConfig implements DataFlow::ConfigSig {
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/PKeyAlgorithmValueConsumer.qll:10
- No unit tests have been added for this new consumer; consider adding tests that cover each EVP_PKEY_* function case to validate correct data-flow modeling.
class EVPPKeyAlgorithmConsumer extends PKeyValueConsumer {
|
|
||
| abstract class PKeyValueConsumer extends OpenSSLAlgorithmValueConsumer { } | ||
|
|
||
| class EVPPKeyAlgorithmConsumer extends PKeyValueConsumer { |
Check warning
Code scanning / CodeQL
Acronyms should be PascalCase/camelCase. Warning
nicolaswill
reviewed
May 21, 2025
|
|
||
| module GenericDataSourceFlow = TaintTracking::Global<GenericDataSourceFlowConfig>; | ||
|
|
||
| private class ConstantDataSource extends Crypto::GenericConstantSourceInstance instanceof Literal { |
Contributor
There was a problem hiding this comment.
Can you test this with MRVA or DCA before merging? I worry the performance impact will be severe from this.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
nicolaswill
approved these changes
May 21, 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.
Value consumer modeling for PKEY alg consumers in openssl.