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/mock_gssapi_library_posix.h" | 5 #include "net/http/mock_gssapi_library_posix.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "net/third_party/gssapi/gssapi.h" | |
11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
12 | 11 |
13 namespace net { | 12 namespace net { |
14 | 13 |
15 namespace test { | 14 namespace test { |
16 | 15 |
17 struct GssNameMockImpl { | 16 struct GssNameMockImpl { |
18 std::string name; | 17 std::string name; |
19 gss_OID_desc name_type; | 18 gss_OID_desc name_type; |
20 }; | 19 }; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 return GSS_S_BAD_NAMETYPE; | 271 return GSS_S_BAD_NAMETYPE; |
273 GssNameMockImpl* output = new GssNameMockImpl; | 272 GssNameMockImpl* output = new GssNameMockImpl; |
274 if (output == NULL) | 273 if (output == NULL) |
275 return GSS_S_FAILURE; | 274 return GSS_S_FAILURE; |
276 output->name_type.length = 0; | 275 output->name_type.length = 0; |
277 output->name_type.elements = NULL; | 276 output->name_type.elements = NULL; |
278 | 277 |
279 // Save the data. | 278 // Save the data. |
280 output->name = BufferToString(input_name_buffer); | 279 output->name = BufferToString(input_name_buffer); |
281 CopyOid(&output->name_type, input_name_type); | 280 CopyOid(&output->name_type, input_name_type); |
282 *output_name = output; | 281 *output_name = reinterpret_cast<gss_name_t>(output); |
283 | 282 |
284 return GSS_S_COMPLETE; | 283 return GSS_S_COMPLETE; |
285 } | 284 } |
286 | 285 |
287 OM_uint32 MockGSSAPILibrary::release_name( | 286 OM_uint32 MockGSSAPILibrary::release_name( |
288 OM_uint32* minor_status, | 287 OM_uint32* minor_status, |
289 gss_name_t* input_name) { | 288 gss_name_t* input_name) { |
290 if (minor_status) | 289 if (minor_status) |
291 *minor_status = 0; | 290 *minor_status = 0; |
292 if (!input_name) | 291 if (!input_name) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 *locally_initiated = context.locally_initiated; | 471 *locally_initiated = context.locally_initiated; |
473 if (open) | 472 if (open) |
474 *open = context.open; | 473 *open = context.open; |
475 return GSS_S_COMPLETE; | 474 return GSS_S_COMPLETE; |
476 } | 475 } |
477 | 476 |
478 } // namespace test | 477 } // namespace test |
479 | 478 |
480 } // namespace net | 479 } // namespace net |
481 | 480 |
OLD | NEW |