| 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 "net/third_party/gssapi/gssapi.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; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 306 |
| 306 OM_uint32 MockGSSAPILibrary::display_status( | 307 OM_uint32 MockGSSAPILibrary::display_status( |
| 307 OM_uint32* minor_status, | 308 OM_uint32* minor_status, |
| 308 OM_uint32 status_value, | 309 OM_uint32 status_value, |
| 309 int status_type, | 310 int status_type, |
| 310 const gss_OID mech_type, | 311 const gss_OID mech_type, |
| 311 OM_uint32* message_context, | 312 OM_uint32* message_context, |
| 312 gss_buffer_t status_string) { | 313 gss_buffer_t status_string) { |
| 313 if (minor_status) | 314 if (minor_status) |
| 314 *minor_status = 0; | 315 *minor_status = 0; |
| 315 std::string msg = StringPrintf("Value: %u, Type %u", | 316 std::string msg = base::StringPrintf("Value: %u, Type %u", |
| 316 status_value, | 317 status_value, |
| 317 status_type); | 318 status_type); |
| 318 if (message_context) | 319 if (message_context) |
| 319 *message_context = 0; | 320 *message_context = 0; |
| 320 BufferFromString(msg, status_string); | 321 BufferFromString(msg, status_string); |
| 321 return GSS_S_COMPLETE; | 322 return GSS_S_COMPLETE; |
| 322 } | 323 } |
| 323 | 324 |
| 324 OM_uint32 MockGSSAPILibrary::init_sec_context( | 325 OM_uint32 MockGSSAPILibrary::init_sec_context( |
| 325 OM_uint32* minor_status, | 326 OM_uint32* minor_status, |
| 326 const gss_cred_id_t initiator_cred_handle, | 327 const gss_cred_id_t initiator_cred_handle, |
| 327 gss_ctx_id_t* context_handle, | 328 gss_ctx_id_t* context_handle, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 security_query.context_info.Assign(context_info); | 460 security_query.context_info.Assign(context_info); |
| 460 security_query.expected_input_token = expected_input_token; | 461 security_query.expected_input_token = expected_input_token; |
| 461 security_query.output_token = output_token; | 462 security_query.output_token = output_token; |
| 462 expected_security_queries_.push_back(security_query); | 463 expected_security_queries_.push_back(security_query); |
| 463 } | 464 } |
| 464 | 465 |
| 465 } // namespace test | 466 } // namespace test |
| 466 | 467 |
| 467 } // namespace net | 468 } // namespace net |
| 468 | 469 |
| OLD | NEW |