Skip to content

Conversation

@bdrodes
Copy link
Contributor

@bdrodes bdrodes commented Jul 1, 2025

A complete overhaul of how signatures are modeled to take into account that some operations are ambiguous, they can be either MAC or Signature. Significant updates to the OpenSSL models both to use the new signature/mac models but also misc. fixes and additional modeling to make the scope of the OpenSSL models wider and more accurate. Updates to the JCA models also to account for the new signature/mac models.

This PR is a culmination of many misc. updates necessary to get the openssl models to a consistent representation, with rigorous unit tests, especially as represented in the graph. Next steps are to ensure other models (e.g., the JCA) are similarly consistent with rigorous unit tests.

bdrodes added 6 commits June 26, 2025 09:18
# Conflicts:
#	cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/AlgToAVCFlow.qll
#	cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/PaddingAlgorithmInstance.qll
…for APIs having one function to do both. Incomplete. Work in progress.
…ests for openssl, refactor still required for JCA.
@github-actions github-actions bot added the C++ label Jul 1, 2025
@github-actions github-actions bot added the Java label Jul 1, 2025
bdrodes and others added 10 commits July 1, 2025 12:21
…model) and simplified unit tests in terms of the graph complexity to aid visual assessments of model correctness.
…is now just a passthrough, it is not a known implicit operation call. Some final operations generating null outputs are now removed from possible final operartions (typically used to determine buffer lenghth and not actually performing the operation). Misc. false positive/error fixes and code clean up, and added missing models.
@bdrodes bdrodes marked this pull request as ready for review October 2, 2025 13:02
@bdrodes bdrodes requested a review from a team as a code owner October 2, 2025 13:02
Copilot AI review requested due to automatic review settings October 2, 2025 13:02
Copy link
Contributor

Copilot AI left a 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 refactors the signature model architecture to consolidate MAC and signature operations under a unified hierarchy. The key changes include:

  • Merges MAC algorithm types into the general key operation algorithm type system
  • Introduces a new SignatureOrMacOperationInstance base class to handle APIs that can perform either signature or MAC operations
  • Updates OpenSSL operation modeling to better distinguish between signature-only and signature/MAC operations
  • Adds comprehensive verification operation support alongside existing signing operations

Reviewed Changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
shared/quantum/codeql/quantum/experimental/Standardization.qll Integrates MAC algorithm types into the main key operation algorithm hierarchy
shared/quantum/codeql/quantum/experimental/Model.qll Refactors signature/MAC operation class hierarchy and removes standalone MAC classes
java/ql/lib/experimental/quantum/JCA.qll Updates JCA model to use new MAC algorithm types and fixes hash algorithm name parsing
cpp/ql/test/experimental/library-tests/quantum/openssl_signature.c Restructures test code into focused individual test functions
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/SignatureOperation.qll Adds comprehensive signature/verification operations and introduces SignatureOrMacFinalOperation
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/MACAlgorithmInstance.qll Updates MAC instances to extend KeyOperationAlgorithmInstance instead of MacAlgorithmInstance
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/OpenSSLOperationBase.qll Switches from DataFlow to TaintTracking and adds new IO types for hash algorithms

…ures to make the inheritance decomposition and caveats clearer, and 2) use getConsumer to establish the hash and hmac consumer. Update the Model to expect hash node types specifically for HMAC getHashALgorithmOrUnknown.
@nicolaswill nicolaswill changed the title Signature model refactor Crypto: Refactor Model.qll and signatures, update JCA and OpenSSL, add unit tests Oct 2, 2025
@nicolaswill nicolaswill changed the title Crypto: Refactor Model.qll and signatures, update JCA and OpenSSL, add unit tests Crypto: Refactor Model and signatures, fix models, add unit tests Oct 2, 2025
@nicolaswill nicolaswill merged commit cbe34f1 into github:main Oct 2, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants