Remove dead code (valid_fingerprints, get_validity_range) [source-breaking API change]#35
Open
achamayou wants to merge 3 commits into
Open
Remove dead code (valid_fingerprints, get_validity_range) [source-breaking API change]#35achamayou wants to merge 3 commits into
achamayou wants to merge 3 commits into
Conversation
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.
Contributor
There was a problem hiding this comment.
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 publicUqSTACK_OF_X509type. - Removed an unused
valid_fingerprintslocal fromcheck_fingerprint().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- 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
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.
Summary
Remove two pieces of dead code identified during a security review:
valid_fingerprints— an empty, unusedstd::unordered_set<std::string>declared at the top of the security-criticalcheck_fingerprintroutine. 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 ignoredASN1_TIME_to_tmreturn codes.Removing
UqSTACK_OF_X509::get_validity_rangeis an intentional source-breaking API change for downstream users that call this method.Testing
cmake --build build && ctest— all tests pass.