Repository navigation
Conversation
Owner
Author
|
Introduced |
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.
Reworked PR #319 by @dajiaohuang.
Original descritption:
Names printed by --list-hashes, such as RIPEMD-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 existing urlname/mtime directives. The original implementation fails at RIPEMD-160, returning the directive literally; the fix passes. All 26 groups of the full existing CLI suite pass, and git diff --check passes. Run the new standalone regression with python3 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.