Skip to content

fix hmac algorithm lookup for names without a hashlib attribute - #4

Merged
OneNobleSoul merged 1 commit into
mainfrom
fix/signature-algorithm-hashlib-mismatch
Jul 15, 2026
Merged

fix hmac algorithm lookup for names without a hashlib attribute#4
OneNobleSoul merged 1 commit into
mainfrom
fix/signature-algorithm-hashlib-mismatch

Conversation

@OneNobleSoul

Copy link
Copy Markdown
Owner

a few names in hashlib.algorithms_available (ripemd160, sm3, sha512_224, md5-sha1) pass config validation but have no matching hashlib module attribute, so compute() rejected them at request time via getattr(hashlib, ...). switched to passing the algorithm name straight to hmac.new as digestmod, which handles all of them. added a regression test.

hashlib.algorithms_available includes a few names (ripemd160, sm3,
sha512_224, md5-sha1) that config.py's validation already accepts but
compute() rejected via getattr(hashlib, ...), since those don't exist
as module attributes. pass the name straight to hmac.new instead.
@OneNobleSoul
OneNobleSoul merged commit 0b3f86e into main Jul 15, 2026
3 checks passed
@OneNobleSoul
OneNobleSoul deleted the fix/signature-algorithm-hashlib-mismatch branch July 15, 2026 04:05
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.

1 participant