-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
digest: reject broken header with session protocol and without qop #9077
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.
Have you tried to add a test case that verifies this behavior?
Seeing this code made me file #9079 since it'll make it possible to just |
Not yet. I'm working on #9074 currently. May return to this one later, but for me it's fine if simple test case would be added by someone else. :)
I like the idea. |
It seems we don't even have a single test case using a Digest Can you record a working set of HTTP requests and response that we can use to create a test from? |
Yes, curl doesn't have any single test for session digest. However, as no predefined pseudorandom sequence can be enforced for current libcurl (even for testing), it makes a little sense to write test for sessions, as all cnonce and response values would need to be filtered, like it is implemented for a few tests with qop=auth. Actually, any digest test with non-empty qop could be used for sessions digest as the testsuite doesn't check generated values, only presence of them. Maybe it would make sense to bring back option for predefined pseudorandom sequence, at least for debug builds? Or make it internal only so only tests could use it, while it would not be available in public API (libcurl already have such function, like session reset for easy handle).
This is the problem. Neither Apache nor Nginx supports sessions (they don't support SHA256 as well). |
Where did you get that from? Debug builds of curl even has a fixed random seed when it runs tests, so random is not an issue there. |
8a9b4ec
to
b9cfc54
Compare
The PR itself is correct, I think. |
I've made some investigation about it. See #9074 (comment) and #9074 (comment). |
b9cfc54
to
f6f8b8d
Compare
Rebased |
f6f8b8d
to
de6a782
Compare
Rebased again. |
thanks! |
Session algorithms require use of
cnonce
.cnonce
could be used only whenqop=auth
orqop=auth-int
.cnonce
is not used whenqop
is empty or missing (missingqop
triggers RFC2069 compatibility mode, which does not usecnonce
).When
qop
is empty,cnonce
is not sent by curl so there is no way for the server to check calculations wherecnonce
is involved, likeH(A1)
.Cherry-picked from PR #9074