Skip to content

Remove dead code (valid_fingerprints, get_validity_range) [source-breaking API change]#35

Open
achamayou wants to merge 3 commits into
mainfrom
remove_dead_code
Open

Remove dead code (valid_fingerprints, get_validity_range) [source-breaking API change]#35
achamayou wants to merge 3 commits into
mainfrom
remove_dead_code

Conversation

@achamayou

@achamayou achamayou commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

Remove two pieces of dead code identified during a security review:

  • valid_fingerprints — an empty, unused std::unordered_set<std::string> declared at the top of the security-critical check_fingerprint routine. It participates in nothing and can mislead readers into thinking it is part of fingerprint validation.
  • UqSTACK_OF_X509::get_validity_range — a public method that is never called anywhere in the codebase and silently ignored ASN1_TIME_to_tm return codes.

Removing UqSTACK_OF_X509::get_validity_range is an intentional source-breaking API change for downstream users that call this method.

Testing

  • cmake --build build && ctest — all tests pass.

Remove two unused pieces of code:

- valid_fingerprints: an empty, unused std::unordered_set sitting in the
  security-critical check_fingerprint routine, where it could mislead
  readers into thinking it participates in fingerprint validation.
- UqSTACK_OF_X509::get_validity_range: a method that is never called (and
  which ignored the ASN1_TIME_to_tm return codes).

No functional change.
@achamayou achamayou requested a review from a team as a code owner June 12, 2026 22:00
@achamayou achamayou requested a review from Copilot June 12, 2026 22:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes two internally unused code paths in didx509cpp.h to reduce confusion in security-sensitive logic and eliminate an unused certificate-chain helper.

Changes:

  • Removed UqSTACK_OF_X509::get_validity_range() from the public UqSTACK_OF_X509 type.
  • Removed an unused valid_fingerprints local from check_fingerprint().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread didx509cpp.h
- verify_signature was declared on UqEVP_PKEY but never defined or called.
- The second throw in UqSTACK_OF_X509::verify() after the rc == 0 branch
  is unreachable because the preceding throw always executes.
Copilot AI changed the title Remove dead code (valid_fingerprints, get_validity_range) Remove dead code (valid_fingerprints, get_validity_range) [source-breaking API change] Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants