| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/http/http_auth_handler_ntlm.h" | 5 #include "net/http/http_auth_handler_ntlm.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 // For gethostname | 8 // For gethostname |
| 9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 rv = GenerateType1Msg(out_token, out_token_len); | 704 rv = GenerateType1Msg(out_token, out_token_len); |
| 705 } | 705 } |
| 706 | 706 |
| 707 if (rv == OK) | 707 if (rv == OK) |
| 708 LogToken("out-token", *out_token, *out_token_len); | 708 LogToken("out-token", *out_token, *out_token_len); |
| 709 | 709 |
| 710 return rv; | 710 return rv; |
| 711 } | 711 } |
| 712 | 712 |
| 713 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler( | 713 int HttpAuthHandlerNTLM::Factory::CreateAuthHandler( |
| 714 HttpAuthChallengeTokenizer* challenge, | 714 const HttpAuthChallengeTokenizer& challenge, |
| 715 HttpAuth::Target target, | 715 HttpAuth::Target target, |
| 716 const GURL& origin, | 716 const GURL& origin, |
| 717 CreateReason reason, | 717 CreateReason reason, |
| 718 int digest_nonce_count, | 718 int digest_nonce_count, |
| 719 const BoundNetLog& net_log, | 719 const BoundNetLog& net_log, |
| 720 scoped_ptr<HttpAuthHandler>* handler) { | 720 scoped_ptr<HttpAuthHandler>* handler) { |
| 721 if (reason == CREATE_PREEMPTIVE) | 721 if (reason == CREATE_PREEMPTIVE) |
| 722 return ERR_UNSUPPORTED_AUTH_SCHEME; | 722 return ERR_UNSUPPORTED_AUTH_SCHEME; |
| 723 // TODO(cbentzel): Move towards model of parsing in the factory | 723 // TODO(cbentzel): Move towards model of parsing in the factory |
| 724 // method and only constructing when valid. | 724 // method and only constructing when valid. |
| 725 // NOTE: Default credentials are not supported for the portable implementation | 725 // NOTE: Default credentials are not supported for the portable implementation |
| 726 // of NTLM. | 726 // of NTLM. |
| 727 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); | 727 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); |
| 728 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) | 728 int result = |
| 729 return ERR_INVALID_RESPONSE; | 729 tmp_handler->HandleInitialChallenge(challenge, target, origin, net_log); |
| 730 handler->swap(tmp_handler); | 730 if (result == OK) |
| 731 return OK; | 731 handler->swap(tmp_handler); |
| 732 return result; |
| 732 } | 733 } |
| 733 | 734 |
| 734 } // namespace net | 735 } // namespace net |
| OLD | NEW |