Add staged request header decoding - #100
Open
endophysics wants to merge 1 commit into
Open
Conversation
Separate header and encapsulated-key inspection from HPKE setup for buffered and streaming requests while preserving the existing convenience APIs. Cover key selection, validation failures, truncation, and cancelled stream reads. Extend CI to streaming and isolated feature sets with MSRV-aware dependency resolution.
martinthomson
left a comment
Owner
There was a problem hiding this comment.
I just want to acknowledge this. I see a few problems that are worth following up on.
The CI change is a good one that is independent of the main change.
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.
Adds staged server-side request decoding, following the approach discussed in #88 and the scope requested in #99.
Applications can inspect the request header to select a server key, then inspect the encapsulated key (
enc) before initializing HPKE or decrypting the body.This supports key rotation and lets callers reject known replays before cryptographic processing.
Changes
RequestHeaderwith the key ID and raw KEM, KDF, and AEAD identifiers.Server::decode_header()and a borrowedServerRequestfor buffered requests.Server::decode_header_stream(), with separate encapsulated-key decoding and receiver initialization for streamed requests.decapsulate()anddecapsulate_stream()convenience APIs.