Skip to content

Crypto: Fix cpp-specific code scanning alert failure #19814

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bdrodes
Copy link
Contributor

@bdrodes bdrodes commented Jun 18, 2025

Failing code scanning alert fixes affecting experimental crypto CPP code specifically.

@bdrodes bdrodes marked this pull request as ready for review June 18, 2025 15:07
@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 15:07
@bdrodes bdrodes requested a review from a team as a code owner June 18, 2025 15:07
@github-actions github-actions bot added the C++ label Jun 18, 2025
Copy link
Contributor

@Copilot 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 addresses code scanning alert failures in the experimental C++ quantum/OpenSSL QL libraries by improving documentation, standardizing string-matching logic, and renaming modules/classes for consistency.

  • Refactored comments and grammar in various .qll files for clarity.
  • Replaced matches() calls with exact string equality for known algorithm constants.
  • Renamed modules and classes (e.g., RSAPadding…RsaPadding…, NID…Nid…) and adjusted class names (e.g., OAEPPaddingAlgorithmInstanceOaepPaddingAlgorithmInstance).

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cpp/ql/lib/experimental/quantum/OpenSSL/Operations/EVPCipherOperation.qll Reformatted and clarified top-level doc comments
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/HashAlgorithmValueConsumer.qll Adjusted article in doc comment for consistency
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmValueConsumers/DirectAlgorithmValueConsumer.qll Reworded doc comment to improve readability
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/PaddingAlgorithmInstance.qll Switched from matches() to = and renamed padding instance class
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/KnownAlgorithmConstants.qll Rephrased comment headings
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/HashAlgorithmInstance.qll Standardized constant checks from matches() to =
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/BlockAlgorithmInstance.qll Standardized constant checks and renamed conditions
cpp/ql/lib/experimental/quantum/OpenSSL/AlgorithmInstances/AlgToAVCFlow.qll Renamed modules and classes to consistent PascalCase
cpp/ql/lib/experimental/quantum/Language.qll Refined comment and class-brace formatting

Comment on lines +33 to 34
name = "GCM" and type instanceof Crypto::GCM
or
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entry for GCM is duplicated later in the OR chain; consider removing the redundant clause to reduce code duplication and simplify maintenance.

Suggested change
name = "GCM" and type instanceof Crypto::GCM
or

Copilot uses AI. Check for mistakes.

@@ -210,7 +210,8 @@ string getAlgorithmAlias(string alias) {
}

/**
* Finds aliases of known alagorithms defined by users (through obj_name_add and various macros pointing to this function)
* Holds for aliases of known alagorithms defined by users
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in 'alagorithms'; it should be spelled 'algorithms'.

Suggested change
* Holds for aliases of known alagorithms defined by users
* Holds for aliases of known algorithms defined by users

Copilot uses AI. Check for mistakes.

@@ -161,10 +161,10 @@
// else result = Crypto::OtherPadding()
// }
// }
class OAEPPaddingAlgorithmInstance extends Crypto::OAEPPaddingAlgorithmInstance,
class OaepPaddingAlgorithmInstance extends Crypto::OAEPPaddingAlgorithmInstance,

Check warning

Code scanning / CodeQL

Names only differing by case Warning

OaepPaddingAlgorithmInstance is only different by casing from OAEPPaddingAlgorithmInstance that is used elsewhere for classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant