| 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_gssapi_posix.h" | 5 #include "net/http/http_auth_gssapi_posix.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
| 19 | 19 |
| 20 #if defined(DLOPEN_KERBEROS) | |
| 21 // These are defined for the GSSAPI library: | 20 // These are defined for the GSSAPI library: |
| 22 // Paraphrasing the comments from gssapi.h: | 21 // Paraphrasing the comments from gssapi.h: |
| 23 // "The implementation must reserve static storage for a | 22 // "The implementation must reserve static storage for a |
| 24 // gss_OID_desc object for each constant. That constant | 23 // gss_OID_desc object for each constant. That constant |
| 25 // should be initialized to point to that gss_OID_desc." | 24 // should be initialized to point to that gss_OID_desc." |
| 26 namespace { | 25 namespace { |
| 27 | 26 |
| 28 static gss_OID_desc GSS_C_NT_USER_NAME_VAL = { | 27 static gss_OID_desc GSS_C_NT_USER_NAME_VAL = { |
| 29 10, | 28 10, |
| 30 const_cast<char*>("\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01") | 29 const_cast<char*>("\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01") |
| (...skipping 25 matching lines...) Expand all Loading... |
| 56 | 55 |
| 57 } // namespace | 56 } // namespace |
| 58 | 57 |
| 59 gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_VAL; | 58 gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_VAL; |
| 60 gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_VAL; | 59 gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_VAL; |
| 61 gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_VAL; | 60 gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_VAL; |
| 62 gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_VAL; | 61 gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_VAL; |
| 63 gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_VAL; | 62 gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_VAL; |
| 64 gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_VAL; | 63 gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_VAL; |
| 65 gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_VAL; | 64 gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_VAL; |
| 66 #endif // defined(DLOPEN_KERBEROS) | |
| 67 | 65 |
| 68 namespace net { | 66 namespace net { |
| 69 | 67 |
| 70 // These are encoded using ASN.1 BER encoding. | 68 // These are encoded using ASN.1 BER encoding. |
| 71 | 69 |
| 72 // This one is used by Firefox's nsAuthGSSAPI class. | 70 // This one is used by Firefox's nsAuthGSSAPI class. |
| 73 gss_OID_desc CHROME_GSS_KRB5_MECH_OID_DESC_VAL = { | 71 gss_OID_desc CHROME_GSS_KRB5_MECH_OID_DESC_VAL = { |
| 74 9, | 72 9, |
| 75 const_cast<char*>("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02") | 73 const_cast<char*>("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02") |
| 76 }; | 74 }; |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 if (rv != OK) { | 881 if (rv != OK) { |
| 884 LOG(ERROR) << "Problem initializing context. \n" | 882 LOG(ERROR) << "Problem initializing context. \n" |
| 885 << DisplayExtendedStatus(library_, major_status, minor_status) | 883 << DisplayExtendedStatus(library_, major_status, minor_status) |
| 886 << '\n' | 884 << '\n' |
| 887 << DescribeContext(library_, scoped_sec_context_.get()); | 885 << DescribeContext(library_, scoped_sec_context_.get()); |
| 888 } | 886 } |
| 889 return rv; | 887 return rv; |
| 890 } | 888 } |
| 891 | 889 |
| 892 } // namespace net | 890 } // namespace net |
| OLD | NEW |