| 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 #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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 NTLM_Unknown6 = 0x04000000, | 114 NTLM_Unknown6 = 0x04000000, |
| 115 NTLM_Unknown7 = 0x08000000, | 115 NTLM_Unknown7 = 0x08000000, |
| 116 NTLM_Unknown8 = 0x10000000, | 116 NTLM_Unknown8 = 0x10000000, |
| 117 NTLM_Negotiate128 = 0x20000000, | 117 NTLM_Negotiate128 = 0x20000000, |
| 118 NTLM_NegotiateKeyExchange = 0x40000000, | 118 NTLM_NegotiateKeyExchange = 0x40000000, |
| 119 NTLM_Negotiate56 = 0x80000000 | 119 NTLM_Negotiate56 = 0x80000000 |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 // We send these flags with our type 1 message. | 122 // We send these flags with our type 1 message. |
| 123 enum { | 123 enum { |
| 124 NTLM_TYPE1_FLAGS = | 124 NTLM_TYPE1_FLAGS = (NTLM_NegotiateUnicode | |
| 125 NTLM_NegotiateUnicode | | 125 NTLM_NegotiateOEM | |
| 126 NTLM_NegotiateOEM | | 126 NTLM_RequestTarget | |
| 127 NTLM_RequestTarget | | 127 NTLM_NegotiateNTLMKey | |
| 128 NTLM_NegotiateNTLMKey | | 128 NTLM_NegotiateAlwaysSign | |
| 129 NTLM_NegotiateAlwaysSign | | 129 NTLM_NegotiateNTLM2Key) |
| 130 NTLM_NegotiateNTLM2Key | |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 static const char NTLM_SIGNATURE[] = "NTLMSSP"; | 132 static const char NTLM_SIGNATURE[] = "NTLMSSP"; |
| 134 static const char NTLM_TYPE1_MARKER[] = { 0x01, 0x00, 0x00, 0x00 }; | 133 static const char NTLM_TYPE1_MARKER[] = { 0x01, 0x00, 0x00, 0x00 }; |
| 135 static const char NTLM_TYPE2_MARKER[] = { 0x02, 0x00, 0x00, 0x00 }; | 134 static const char NTLM_TYPE2_MARKER[] = { 0x02, 0x00, 0x00, 0x00 }; |
| 136 static const char NTLM_TYPE3_MARKER[] = { 0x03, 0x00, 0x00, 0x00 }; | 135 static const char NTLM_TYPE3_MARKER[] = { 0x03, 0x00, 0x00, 0x00 }; |
| 137 | 136 |
| 138 enum { | 137 enum { |
| 139 NTLM_TYPE1_HEADER_LEN = 32, | 138 NTLM_TYPE1_HEADER_LEN = 32, |
| 140 NTLM_TYPE2_HEADER_LEN = 32, | 139 NTLM_TYPE2_HEADER_LEN = 32, |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 // NOTE: Default credentials are not supported for the portable implementation | 735 // NOTE: Default credentials are not supported for the portable implementation |
| 737 // of NTLM. | 736 // of NTLM. |
| 738 scoped_refptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); | 737 scoped_refptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNTLM); |
| 739 if (!tmp_handler->InitFromChallenge(challenge, target, origin)) | 738 if (!tmp_handler->InitFromChallenge(challenge, target, origin)) |
| 740 return ERR_INVALID_RESPONSE; | 739 return ERR_INVALID_RESPONSE; |
| 741 handler->swap(tmp_handler); | 740 handler->swap(tmp_handler); |
| 742 return OK; | 741 return OK; |
| 743 } | 742 } |
| 744 | 743 |
| 745 } // namespace net | 744 } // namespace net |
| OLD | NEW |