Repository navigation
Accept canonical hash names in templates - #319
Closed
dajiaohuang wants to merge 2 commits into
Closed
dajiaohuang wants to merge 2 commits into
dajiaohuang wants to merge 2 commits into
Conversation
Owner
|
Commit looks good. The change requires testing. |
Contributor
Author
|
The requested tests are complete. The Linux/GCC 13.3 shared build passes a compiled-CLI regression for 32 canonical hash names and their dashless aliases, a known SHA-256 value, and the legacy |
Owner
|
The fix is rewritten as PR #329 |
Owner
|
Accepted with changes as 7b2801d. |
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.
Names printed by
--list-hashes, such asRIPEMD-160, are not recognized as template directives and are emitted literally. Match hash names case-insensitively after removing dashes from both the input and hash-table name. Initialize the normalization buffer so legacy-directive comparisons cannot inspect unset bytes, and cast input bytes to unsigned char before case conversion.Closes #311.
Validation: compiled the actual shared-library CLI on Ubuntu with GCC 13.3 and SHA-NI disabled. The added executable-level regression verifies all 32 public hash names against their dashless aliases, SHA-256 of
abc, and existingurlname/mtimedirectives. The original implementation fails atRIPEMD-160, returning the directive literally; the fix passes. All 26 groups of the full existing CLI suite pass, andgit diff --checkpasses. Run the new standalone regression withpython3 tests/test_template_hash_names.py ./rhash; it is not automatically wired into the existing shell suite. Other platforms and SHA-NI-enabled builds were not exercised for this PR.