Add missing sha256 support to fix signedcookiesession compilation error#283
Merged
Add missing sha256 support to fix signedcookiesession compilation error#283
Conversation
… individual SHA-2 types Co-authored-by: ringabout <[email protected]>
Co-authored-by: ringabout <[email protected]>
Copilot
AI
changed the title
[WIP] Fix signedcookiesession compilation error
Add missing sha256 support to fix signedcookiesession compilation error
Jan 9, 2026
Member
|
@copilot don't forget to add a changelog |
Copilot stopped work on behalf of
ringabout due to an error
January 9, 2026 13:43
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a compilation error in the signedcookiesession module by adding missing SHA-256 support. When the code was refactored to use individual SHA-2 types instead of the sha2 union type (which is no longer exported by newer nimcrypto versions), sha256 was accidentally omitted.
Key changes:
- Added
sha256to theBaseDigestTypeunion type alongside other SHA-2 variants - Added
Sha256Typeto theBaseDigestMethodTypeenum - Added case handlers for
Sha256Typein both signature encode and decode functions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The
signedcookiesessionmodule failed to compile with newer nimcrypto versions due to missing sha256 type support in the signing module.Root Cause
The original code used
sha2as a union type, which is no longer directly exported by nimcrypto. When refactored to use individual SHA-2 types (sha224,sha384,sha512, etc.),sha256was accidentally omitted.Changes
sha256toBaseDigestTypeunion typeSha256TypetoBaseDigestMethodTypeenumSha256TypeingetSignatureEncode()andgetSignatureDecode()The fix ensures SHA-256 hashing is available alongside other SHA-2 variants (SHA-224, SHA-384, SHA-512, SHA-512/224, SHA-512/256).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)nim-lang.org/usr/bin/curl curl REDACTED -sSf -o choosenim-init.sh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.