Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 * under the terms of either the GPL or the LGPL, and not to allow others to | 64 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 65 * use your version of this file under the terms of the MPL, indicate your | 65 * use your version of this file under the terms of the MPL, indicate your |
| 66 * decision by deleting the provisions above and replace them with the notice | 66 * decision by deleting the provisions above and replace them with the notice |
| 67 * and other provisions required by the GPL or the LGPL. If you do not delete | 67 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 68 * the provisions above, a recipient may use your version of this file under | 68 * the provisions above, a recipient may use your version of this file under |
| 69 * the terms of any one of the MPL, the GPL or the LGPL. | 69 * the terms of any one of the MPL, the GPL or the LGPL. |
| 70 * | 70 * |
| 71 * ***** END LICENSE BLOCK ***** */ | 71 * ***** END LICENSE BLOCK ***** */ |
| 72 | 72 |
| 73 // Discover the endianness by testing processor architecture. | 73 // Discover the endianness by testing processor architecture. |
| 74 #if defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARMEL) | 74 #if defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARMEL) || defined(ARCH_CPU_MIPSEL) |
|
Ryan Hamilton
2012/07/10 16:59:46
nit: is it possible to avoid the long line here?
| |
| 75 #define IS_LITTLE_ENDIAN 1 | 75 #define IS_LITTLE_ENDIAN 1 |
| 76 #undef IS_BIG_ENDIAN | 76 #undef IS_BIG_ENDIAN |
| 77 #elif defined(ARCH_CPU_MIPSEB) | |
| 78 #define IS_BIG_ENDIAN 1 | |
| 79 #undef IS_LITTLE_ENDIAN | |
| 77 #else | 80 #else |
| 78 #error "Unknown endianness" | 81 #error "Unknown endianness" |
| 79 #endif | 82 #endif |
| 80 | 83 |
| 81 #define NTLM_LOG(x) ((void) 0) | 84 #define NTLM_LOG(x) ((void) 0) |
| 82 | 85 |
| 83 //----------------------------------------------------------------------------- | 86 //----------------------------------------------------------------------------- |
| 84 // This file contains a cross-platform NTLM authentication implementation. It | 87 // This file contains a cross-platform NTLM authentication implementation. It |
| 85 // is based on documentation from: http://davenport.sourceforge.net/ntlm.html | 88 // is based on documentation from: http://davenport.sourceforge.net/ntlm.html |
| 86 //----------------------------------------------------------------------------- | 89 //----------------------------------------------------------------------------- |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 717 // NOTE: Default credentials are not supported for the portable implementation | 720 // NOTE: Default credentials are not supported for the portable implementation |
| 718 // of NTLM. | 721 // of NTLM. |
| 719 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); | 722 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); |
| 720 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) | 723 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) |
| 721 return ERR_INVALID_RESPONSE; | 724 return ERR_INVALID_RESPONSE; |
| 722 handler->swap(tmp_handler); | 725 handler->swap(tmp_handler); |
| 723 return OK; | 726 return OK; |
| 724 } | 727 } |
| 725 | 728 |
| 726 } // namespace net | 729 } // namespace net |
| OLD | NEW |