Closed GoogleCodeExporter closed 9 years ago
I'll have a look.
Original comment by lieven.govaerts@gmail.com
on 31 May 2013 at 7:04
SIDEBAR: It appears that this bit of code is the only code that tries to use
conn->host_info.path. But when conn->host_url -- which presumably is supposed
to represent the same information as conn->host_info, just in another format --
is built, the path information is stripped (per the APR_URI_UNP_OMITPATHINFO
flag to apr_uri_unparse()).
I might suggest that conn->host_info should be re-parsed from the host_url to
ensure that the two stay in sync?
{{{
Index: outgoing.c
===================================================================
--- outgoing.c (revision 1877)
+++ outgoing.c (working copy)
@@ -1227,7 +1227,7 @@
c->host_url = apr_uri_unparse(c->pool,
&host_info,
APR_URI_UNP_OMITPATHINFO);
- c->host_info = host_info;
+ (void)apr_uri_parse(c->pool, c->host_url, &(c->host_info));
*conn = c;
}}}
Original comment by cmpilato
on 31 May 2013 at 7:24
Should be fixed in r1885. The response digest in the Authentication-Info header
is indeed calculated with the uri of the original request. (RFC 2617, 3.2.3).
When you say: " I was able to determine that, had build_digest_ha2() been
called with the URI "/tests-digest/repos/!svn/rvr/27" (instead of
"/tests-digest/repos"), the MD5 calculations which make use of the ha2 would
have yielded the correct value.", I suppose you tested this by changing this
uri in gdb? Because, in the response handler the uri of the request is not
directly available, so I had to work around this a bit.
FYI: when I originally implemented digest this worked ok with subversion, but
serf didn't validate the successful response headers yet. I've fixed this in
r1669 for auth_kerb, but then broke auth_digest as that code path had never
been tested before.
L.
Original comment by lieven.govaerts@gmail.com
on 31 May 2013 at 9:57
I didn't change the URI in GDB, no. Rather, I manually calculate the checksums.
"What would happen if HA2 was md5(method + ':' + '/correct/uri') instead? Aha!
The result is what's expected!"
Either way, glad you found a solution. It's the same solution I was thinking
to implement, but I second-guessed myself. "Surely they'd have stored the URI
associated with the request_t if it wasn't just outright wrong to do so..."
Guess not. :-)
Original comment by cmpilato
on 1 Jun 2013 at 2:01
Original issue reported on code.google.com by
cmpilato
on 31 May 2013 at 6:24