Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Issue 3360017: Fix multi-round authentication.... (Closed)

Created:
10 years, 3 months ago by cbentzel
Modified:
9 years, 7 months ago
Reviewers:
eroman, wtc, ahendrickson
CC:
chromium-reviews, pam+watch_chromium.org, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix multi-round authentication. In the case of Negotiate, authentication can look like C: GET S: 401, WWW-Authenticate: Negotiate C: GET, WWW-Authorization: Negotiate <client_token_1> S: 401, WWW-Authenticate: Negotiate <server_token_1> C: GET, WWW-Authorization: Negotiate <client_token_2> S: 401, WWW-Authenticate: Negotiate <server_token_2> on that third challenge, the handler was reported as being in "the final round" and this was treated as a rejection of the authentication attempt. After that, the new challenge token was used by a new auth handler that hadn't established a security context, and an ERR_INVALID_HANDLE would be returned. This CL also does some prep work to correctly handle the "stale=true" value for Digest authentication, but I decided to defer the HttpAuthCache changes needed for that to a separate CL since this was large enough. BUG=53282 TEST=net_unittests. Unfortunately, I haven't been able to set up a proxy/server to do more than two auth challenges, but this does happen in the wild. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=59188

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : Improve GSSAPI parsing of authenticate, plus unittests. #

Total comments: 1

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : NTLM #

Patch Set 8 : Fixed #

Patch Set 9 : More files are added #

Patch Set 10 : Added http_auth unittests #

Total comments: 8

Patch Set 11 : Fixed comment for mock init_sec_context #

Patch Set 12 : More unit tests #

Patch Set 13 : SocketStream fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+692 lines, -284 lines) Patch
M net/http/http_auth.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +29 lines, -11 lines 0 comments Download
M net/http/http_auth.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +27 lines, -15 lines 0 comments Download
M net/http/http_auth_cache_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -1 line 0 comments Download
M net/http/http_auth_controller.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M net/http/http_auth_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +35 lines, -18 lines 0 comments Download
M net/http/http_auth_gssapi_posix.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/http_auth_gssapi_posix.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +45 lines, -41 lines 0 comments Download
MM net/http/http_auth_gssapi_posix_unittest.cc View 3 9 10 11 3 chunks +123 lines, -0 lines 0 comments Download
M net/http/http_auth_handler.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +16 lines, -5 lines 0 comments Download
M net/http/http_auth_handler_basic.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M net/http/http_auth_handler_basic.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +18 lines, -2 lines 0 comments Download
M net/http/http_auth_handler_basic_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +46 lines, -0 lines 0 comments Download
M net/http/http_auth_handler_digest.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -3 lines 0 comments Download
M net/http/http_auth_handler_digest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +33 lines, -6 lines 0 comments Download
M net/http/http_auth_handler_digest_unittest.cc View 1 chunk +30 lines, -0 lines 0 comments Download
M net/http/http_auth_handler_mock.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download
M net/http/http_auth_handler_mock.cc View 10 2 chunks +11 lines, -0 lines 0 comments Download
M net/http/http_auth_handler_negotiate.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M net/http/http_auth_handler_negotiate.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -4 lines 0 comments Download
M net/http/http_auth_handler_ntlm.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -7 lines 0 comments Download
M net/http/http_auth_handler_ntlm.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +29 lines, -8 lines 0 comments Download
M net/http/http_auth_handler_ntlm_portable.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -4 lines 0 comments Download
M net/http/http_auth_handler_ntlm_win.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -4 lines 0 comments Download
M net/http/http_auth_sspi_win.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -4 lines 0 comments Download
M net/http/http_auth_sspi_win.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +18 lines, -14 lines 0 comments Download
M net/http/http_auth_sspi_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +100 lines, -2 lines 0 comments Download
M net/http/http_auth_unittest.cc View 9 10 3 chunks +64 lines, -124 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +14 lines, -0 lines 0 comments Download
MM net/http/mock_sspi_library_win.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -2 lines 0 comments Download
M net/socket_stream/socket_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
cbentzel
I think this may fix the cause of some of the user's issues with Negotiate ...
10 years, 3 months ago (2010-09-10 02:20:59 UTC) #1
ahendrickson
LGTM, with minor nits. I only skimmed the unit tests, though. http://codereview.chromium.org/3360017/diff/30003/71005 File net/http/http_auth_controller.cc (right): ...
10 years, 3 months ago (2010-09-10 16:15:16 UTC) #2
cbentzel
Thanks for the review. I've added a few more unit tests. I still need to ...
10 years, 3 months ago (2010-09-10 20:00:18 UTC) #3
cbentzel
10 years, 3 months ago (2010-09-10 20:22:50 UTC) #4
On 2010/09/10 20:00:18, cbentzel wrote:
> Thanks for the review. I've added a few more unit tests. I still need to solve
> the SocketStream issue, although I'm tempted not to spend much time on it
since
> I don't think that many people are using it with proxy authentication and this
> is fixing a known bug.

It turns out the SocketStream fix was pretty easy - the only authentication type
currently supported is Basic, so any follow-up challenges should be treated as a
rejection of the previous attempt.

Powered by Google App Engine
This is Rietveld 408576698