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

Side by Side Diff: net/http/http_auth_handler_ntlm_win.cc

Issue 1408433006: Support tls-server-end-point channel bindings for HTTP authentication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Narrower dependencies, update comments, address review comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See "SSPI Sample Application" at 5 // See "SSPI Sample Application" at
6 // http://msdn.microsoft.com/en-us/library/aa918273.aspx 6 // http://msdn.microsoft.com/en-us/library/aa918273.aspx
7 // and "NTLM Security Support Provider" at 7 // and "NTLM Security Support Provider" at
8 // http://msdn.microsoft.com/en-us/library/aa923611.aspx. 8 // http://msdn.microsoft.com/en-us/library/aa923611.aspx.
9 9
10 #include "net/http/http_auth_handler_ntlm.h" 10 #include "net/http/http_auth_handler_ntlm.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 : max_token_length_(0), 45 : max_token_length_(0),
46 is_unsupported_(false) { 46 is_unsupported_(false) {
47 } 47 }
48 48
49 HttpAuthHandlerNTLM::Factory::~Factory() { 49 HttpAuthHandlerNTLM::Factory::~Factory() {
50 } 50 }
51 51
52 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler( 52 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler(
53 HttpAuthChallengeTokenizer* challenge, 53 HttpAuthChallengeTokenizer* challenge,
54 HttpAuth::Target target, 54 HttpAuth::Target target,
55 const SSLInfo& ssl_info,
55 const GURL& origin, 56 const GURL& origin,
56 CreateReason reason, 57 CreateReason reason,
57 int digest_nonce_count, 58 int digest_nonce_count,
58 const BoundNetLog& net_log, 59 const BoundNetLog& net_log,
59 scoped_ptr<HttpAuthHandler>* handler) { 60 scoped_ptr<HttpAuthHandler>* handler) {
60 if (is_unsupported_ || reason == CREATE_PREEMPTIVE) 61 if (is_unsupported_ || reason == CREATE_PREEMPTIVE)
61 return ERR_UNSUPPORTED_AUTH_SCHEME; 62 return ERR_UNSUPPORTED_AUTH_SCHEME;
62 if (max_token_length_ == 0) { 63 if (max_token_length_ == 0) {
63 int rv = DetermineMaxTokenLength(sspi_library_.get(), NTLMSP_NAME, 64 int rv = DetermineMaxTokenLength(sspi_library_.get(), NTLMSP_NAME,
64 &max_token_length_); 65 &max_token_length_);
65 if (rv == ERR_UNSUPPORTED_AUTH_SCHEME) 66 if (rv == ERR_UNSUPPORTED_AUTH_SCHEME)
66 is_unsupported_ = true; 67 is_unsupported_ = true;
67 if (rv != OK) 68 if (rv != OK)
68 return rv; 69 return rv;
69 } 70 }
70 // TODO(cbentzel): Move towards model of parsing in the factory 71 // TODO(cbentzel): Move towards model of parsing in the factory
71 // method and only constructing when valid. 72 // method and only constructing when valid.
72 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM( 73 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM(
73 sspi_library_.get(), max_token_length_, http_auth_preferences())); 74 sspi_library_.get(), max_token_length_, http_auth_preferences()));
74 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) 75 if (!tmp_handler->InitFromChallenge(challenge, target, ssl_info, origin,
76 net_log))
75 return ERR_INVALID_RESPONSE; 77 return ERR_INVALID_RESPONSE;
76 handler->swap(tmp_handler); 78 handler->swap(tmp_handler);
77 return OK; 79 return OK;
78 } 80 }
79 81
80 } // namespace net 82 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698