Conversation
Tie the peer/origin already on input handling and flush stale data when it changed.
Fix the handling of digest reset on input to react to peer changes, link the peer but leave creds NULL. Digest state at input time has no relation to creds. The dependency on creds is only set on use, e.g. when generating output.
icing
force-pushed
the
digest-flush-on-input
branch
from
August 26, 2026 11:21
cd5eb3a to
9be1182
Compare
bagder
approved these changes
Aug 26, 2026
support proxies, just ignore it.
There was a problem hiding this comment.
Pull request overview
This PR updates HTTP Digest authentication handling so Digest state is tied to the peer/origin when parsing server headers (“input”), and stale Digest state is flushed when switching to a different peer or different credentials when generating auth headers (“output”). It also adds a new libtest + testcase to cover a handle-reuse scenario where a Digest challenge is received when Digest isn’t requested, then Digest is later enabled against a different host.
Changes:
- Add peer/origin tracking on Digest “input” and flush stale Digest state on “output”.
- Introduce new libtest
lib1985and testcasetest1985to validate Digest state isolation across origins when reusing an easy handle. - Register the new libtest/testcase in the test build files.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
lib/http_digest.c |
Adds stale-state flushing and origin tracking for Digest auth across input/output paths. |
tests/libtest/Makefile.inc |
Registers new libtest source file lib1985.c. |
tests/libtest/lib1985.c |
New libtest exercising easy-handle reuse across two hosts with different auth settings. |
tests/data/Makefile.am |
Registers new testcase test1985. |
tests/data/test1985 |
New testcase data to validate Digest behavior and request/response sequencing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Tie the peer already on input handling and flush stale data when it changed. Leave creds
NULLas digest state after "input" (parsing a server header) is unrelated to creds. The tie to credentials happens on "output", e.g. when a header is sent.