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 #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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 OM_uint32* minor_status, | 88 OM_uint32* minor_status, |
89 const gss_ctx_id_t context_handle, | 89 const gss_ctx_id_t context_handle, |
90 gss_name_t* src_name, | 90 gss_name_t* src_name, |
91 gss_name_t* targ_name, | 91 gss_name_t* targ_name, |
92 OM_uint32* lifetime_rec, | 92 OM_uint32* lifetime_rec, |
93 gss_OID* mech_type, | 93 gss_OID* mech_type, |
94 OM_uint32* ctx_flags, | 94 OM_uint32* ctx_flags, |
95 int* locally_initiated, | 95 int* locally_initiated, |
96 int* open) = 0; | 96 int* open) = 0; |
97 | 97 |
98 // Get the default GSSPILibrary instance. The object returned is a singleton | |
99 // instance, and the caller should not delete it. | |
100 static GSSAPILibrary* GetDefault(); | |
101 }; | 98 }; |
102 | 99 |
103 // GSSAPISharedLibrary class is defined here so that unit tests can access it. | 100 // GSSAPISharedLibrary class is defined here so that unit tests can access it. |
104 class GSSAPISharedLibrary : public GSSAPILibrary { | 101 class GSSAPISharedLibrary : public GSSAPILibrary { |
105 public: | 102 public: |
106 GSSAPISharedLibrary(); | 103 // If |gssapi_library_name| is empty, hard-coded default library names are |
| 104 // used. |
| 105 explicit GSSAPISharedLibrary(const std::string& gssapi_library_name); |
107 virtual ~GSSAPISharedLibrary(); | 106 virtual ~GSSAPISharedLibrary(); |
108 | 107 |
109 // GSSAPILibrary methods: | 108 // GSSAPILibrary methods: |
110 virtual bool Init(); | 109 virtual bool Init(); |
111 virtual OM_uint32 import_name( | 110 virtual OM_uint32 import_name( |
112 OM_uint32* minor_status, | 111 OM_uint32* minor_status, |
113 const gss_buffer_t input_name_buffer, | 112 const gss_buffer_t input_name_buffer, |
114 const gss_OID input_name_type, | 113 const gss_OID input_name_type, |
115 gss_name_t* output_name); | 114 gss_name_t* output_name); |
116 virtual OM_uint32 release_name( | 115 virtual OM_uint32 release_name( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 171 |
173 bool InitImpl(); | 172 bool InitImpl(); |
174 // Finds a usable dynamic library for GSSAPI and loads it. The criteria are: | 173 // Finds a usable dynamic library for GSSAPI and loads it. The criteria are: |
175 // 1. The library must exist. | 174 // 1. The library must exist. |
176 // 2. The library must export the functions we need. | 175 // 2. The library must export the functions we need. |
177 base::NativeLibrary LoadSharedLibrary(); | 176 base::NativeLibrary LoadSharedLibrary(); |
178 bool BindMethods(base::NativeLibrary lib); | 177 bool BindMethods(base::NativeLibrary lib); |
179 | 178 |
180 bool initialized_; | 179 bool initialized_; |
181 | 180 |
| 181 std::string gssapi_library_name_; |
182 // Need some way to invalidate the library. | 182 // Need some way to invalidate the library. |
183 base::NativeLibrary gssapi_library_; | 183 base::NativeLibrary gssapi_library_; |
184 | 184 |
185 // Function pointers | 185 // Function pointers |
186 gss_import_name_type import_name_; | 186 gss_import_name_type import_name_; |
187 gss_release_name_type release_name_; | 187 gss_release_name_type release_name_; |
188 gss_release_buffer_type release_buffer_; | 188 gss_release_buffer_type release_buffer_; |
189 gss_display_name_type display_name_; | 189 gss_display_name_type display_name_; |
190 gss_display_status_type display_status_; | 190 gss_display_status_type display_status_; |
191 gss_init_sec_context_type init_sec_context_; | 191 gss_init_sec_context_type init_sec_context_; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 gss_OID gss_oid_; | 254 gss_OID gss_oid_; |
255 GSSAPILibrary* library_; | 255 GSSAPILibrary* library_; |
256 std::string decoded_server_auth_token_; | 256 std::string decoded_server_auth_token_; |
257 ScopedSecurityContext scoped_sec_context_; | 257 ScopedSecurityContext scoped_sec_context_; |
258 bool can_delegate_; | 258 bool can_delegate_; |
259 }; | 259 }; |
260 | 260 |
261 } // namespace net | 261 } // namespace net |
262 | 262 |
263 #endif // NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ | 263 #endif // NET_HTTP_HTTP_AUTH_GSSAPI_POSIX_H_ |
OLD | NEW |