| 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 #ifndef NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ | 6 #define NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 OM_uint32* ctx_flags, | 101 OM_uint32* ctx_flags, |
| 102 int* locally_initiated, | 102 int* locally_initiated, |
| 103 int* open) = 0; | 103 int* open) = 0; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 // GSSAPISharedLibrary class is defined here so that unit tests can access it. | 106 // GSSAPISharedLibrary class is defined here so that unit tests can access it. |
| 107 class NET_EXPORT_PRIVATE GSSAPISharedLibrary : public GSSAPILibrary { | 107 class NET_EXPORT_PRIVATE GSSAPISharedLibrary : public GSSAPILibrary { |
| 108 public: | 108 public: |
| 109 // If |gssapi_library_name| is empty, hard-coded default library names are | 109 // If |gssapi_library_name| is empty, hard-coded default library names are |
| 110 // used. | 110 // used. |
| 111 explicit GSSAPISharedLibrary(const std::string& gssapi_library_name); | 111 explicit GSSAPISharedLibrary(const std::string& gssapi_library_name, |
| 112 bool allow_gssapi_library_load); |
| 112 ~GSSAPISharedLibrary() override; | 113 ~GSSAPISharedLibrary() override; |
| 113 | 114 |
| 114 // GSSAPILibrary methods: | 115 // GSSAPILibrary methods: |
| 115 bool Init() override; | 116 bool Init() override; |
| 116 OM_uint32 import_name(OM_uint32* minor_status, | 117 OM_uint32 import_name(OM_uint32* minor_status, |
| 117 const gss_buffer_t input_name_buffer, | 118 const gss_buffer_t input_name_buffer, |
| 118 const gss_OID input_name_type, | 119 const gss_OID input_name_type, |
| 119 gss_name_t* output_name) override; | 120 gss_name_t* output_name) override; |
| 120 OM_uint32 release_name(OM_uint32* minor_status, | 121 OM_uint32 release_name(OM_uint32* minor_status, |
| 121 gss_name_t* input_name) override; | 122 gss_name_t* input_name) override; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool InitImpl(); | 180 bool InitImpl(); |
| 180 // Finds a usable dynamic library for GSSAPI and loads it. The criteria are: | 181 // Finds a usable dynamic library for GSSAPI and loads it. The criteria are: |
| 181 // 1. The library must exist. | 182 // 1. The library must exist. |
| 182 // 2. The library must export the functions we need. | 183 // 2. The library must export the functions we need. |
| 183 base::NativeLibrary LoadSharedLibrary(); | 184 base::NativeLibrary LoadSharedLibrary(); |
| 184 bool BindMethods(base::NativeLibrary lib); | 185 bool BindMethods(base::NativeLibrary lib); |
| 185 | 186 |
| 186 bool initialized_; | 187 bool initialized_; |
| 187 | 188 |
| 188 std::string gssapi_library_name_; | 189 std::string gssapi_library_name_; |
| 190 bool allow_gssapi_library_load_; |
| 189 // Need some way to invalidate the library. | 191 // Need some way to invalidate the library. |
| 190 base::NativeLibrary gssapi_library_; | 192 base::NativeLibrary gssapi_library_; |
| 191 | 193 |
| 192 // Function pointers | 194 // Function pointers |
| 193 gss_import_name_type import_name_; | 195 gss_import_name_type import_name_; |
| 194 gss_release_name_type release_name_; | 196 gss_release_name_type release_name_; |
| 195 gss_release_buffer_type release_buffer_; | 197 gss_release_buffer_type release_buffer_; |
| 196 gss_display_name_type display_name_; | 198 gss_display_name_type display_name_; |
| 197 gss_display_status_type display_status_; | 199 gss_display_status_type display_status_; |
| 198 gss_init_sec_context_type init_sec_context_; | 200 gss_init_sec_context_type init_sec_context_; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 gss_OID gss_oid_; | 282 gss_OID gss_oid_; |
| 281 GSSAPILibrary* library_; | 283 GSSAPILibrary* library_; |
| 282 std::string decoded_server_auth_token_; | 284 std::string decoded_server_auth_token_; |
| 283 ScopedSecurityContext scoped_sec_context_; | 285 ScopedSecurityContext scoped_sec_context_; |
| 284 bool can_delegate_; | 286 bool can_delegate_; |
| 285 }; | 287 }; |
| 286 | 288 |
| 287 } // namespace net | 289 } // namespace net |
| 288 | 290 |
| 289 #endif // NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ | 291 #endif // NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
| OLD | NEW |