-
Notifications
You must be signed in to change notification settings - Fork 82
Signature: Accept signatures with hs2019 algorithm #1814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the hs2019
HTTP signature algorithm, updates the signature detection logic, and includes new tests plus a changelog entry.
- Introduce
hs2019
case inget_signature_algorithm
mapping tosha512
- Add unit tests for signature algorithm detection and full HTTP signature verification with
hs2019
- Include a changelog entry for the new fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/includes/class-test-signature.php | New data provider and tests for get_signature_algorithm and end-to-end hs2019 verification |
includes/class-signature.php | Updated get_signature_algorithm to recognize hs2019 |
.github/changelog/1814-from-description | Added changelog entry for the hs2019 signature fix |
Comments suppressed due to low confidence (2)
includes/class-signature.php:356
- Accessing
$signature_block['algorithm']
without checking if the key exists can trigger a PHP notice for undefined index. Wrap it inisset()
or use! empty()
to safely guard against missing keys.
if ( $signature_block['algorithm'] ) {
includes/class-signature.php:359
- The previous support for 'rsa-sha-512' was removed in this switch, causing that algorithm to fallback to the default 'sha256'. Consider re-adding a
case 'rsa-sha-512': return 'sha512';
if you still intend to support it.
case 'hs2019':
@mediaformat It looks like I can't add you to the list of reviewers—would you still be able to give this a look and share any feedback you have? |
Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
Follow-up to #1803 and depends on it for all tests to pass.
Proposed changes:
get_signature_algorithm
to check forhs2019
to identify algorithm.Other information:
Testing instructions:
Changelog entry
Changelog Entry Details
Significance
Type
Message
HTTP signatures using the hs2019 algorithm now get accepted without error.