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