| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 29 matching lines...) Expand all Loading... |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 int HttpAuthHandlerNTLM::GenerateDefaultAuthToken( | 43 int HttpAuthHandlerNTLM::GenerateDefaultAuthToken( |
| 44 const HttpRequestInfo* request, | 44 const HttpRequestInfo* request, |
| 45 const ProxyInfo* proxy, | 45 const ProxyInfo* proxy, |
| 46 std::string* auth_token) { | 46 std::string* auth_token) { |
| 47 return auth_sspi_.GenerateAuthToken( | 47 return auth_sspi_.GenerateAuthToken( |
| 48 NULL, // username | 48 NULL, // username |
| 49 NULL, // password | 49 NULL, // password |
| 50 origin_, | 50 CreateSPN(origin_), |
| 51 request, | 51 request, |
| 52 proxy, | 52 proxy, |
| 53 auth_token); | 53 auth_token); |
| 54 } | 54 } |
| 55 | 55 |
| 56 HttpAuthHandlerNTLM::Factory::Factory() | 56 HttpAuthHandlerNTLM::Factory::Factory() |
| 57 : max_token_length_(0), | 57 : max_token_length_(0), |
| 58 first_creation_(true), | 58 first_creation_(true), |
| 59 is_unsupported_(false), | 59 is_unsupported_(false), |
| 60 sspi_library_(SSPILibrary::GetDefault()) { | 60 sspi_library_(SSPILibrary::GetDefault()) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 82 // method and only constructing when valid. | 82 // method and only constructing when valid. |
| 83 scoped_refptr<HttpAuthHandler> tmp_handler( | 83 scoped_refptr<HttpAuthHandler> tmp_handler( |
| 84 new HttpAuthHandlerNTLM(sspi_library_, max_token_length_)); | 84 new HttpAuthHandlerNTLM(sspi_library_, max_token_length_)); |
| 85 if (!tmp_handler->InitFromChallenge(challenge, target, origin)) | 85 if (!tmp_handler->InitFromChallenge(challenge, target, origin)) |
| 86 return ERR_INVALID_RESPONSE; | 86 return ERR_INVALID_RESPONSE; |
| 87 handler->swap(tmp_handler); | 87 handler->swap(tmp_handler); |
| 88 return OK; | 88 return OK; |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace net | 91 } // namespace net |
| OLD | NEW |