Home | History | Annotate | Download | only in trunks

Lines Matching refs:string

19 #include <string>
46 void Assign(std::string* to, const std::string& from) {
68 const std::string kNoAuthorization;
69 const std::string kNoParameters;
77 std::string CreateCommand(TPM_CC code,
79 const std::string& authorization,
80 const std::string& parameters) {
81 std::string buffer;
98 std::string CreateResponse(TPM_RC code,
100 const std::string& authorization,
101 const std::string& parameters) {
102 std::string buffer;
119 std::string CreateCommandAuthorization(TPM_HANDLE handle,
121 std::string buffer;
123 Serialize_TPM2B_NONCE(Make_TPM2B_DIGEST(std::string(32, 'A')), &buffer);
125 Serialize_TPM2B_DIGEST(Make_TPM2B_DIGEST(std::string(32, 'B')), &buffer);
130 std::string CreateResponseAuthorization(bool continue_session) {
131 std::string buffer;
132 Serialize_TPM2B_NONCE(Make_TPM2B_DIGEST(std::string(32, 'A')), &buffer);
134 Serialize_TPM2B_DIGEST(Make_TPM2B_DIGEST(std::string(32, 'B')), &buffer);
138 std::string GetHeader(const std::string& message) {
142 std::string StripHeader(const std::string& message) {
150 std::string command = CreateCommand(TPM_CC_Load, input_handles,
153 std::string response = CreateResponse(TPM_RC_SUCCESS, output_handles,
157 std::string actual_response = resource_manager_.SendCommandAndWait(command);
158 std::string handle_blob = StripHeader(actual_response);
167 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
169 std::string response = CreateErrorResponse(TPM_RC_OBJECT_MEMORY);
170 std::string success_response = CreateResponse(
185 std::string command = CreateCommand(TPM_CC_StartAuthSession, input_handles,
188 std::string response = CreateResponse(TPM_RC_SUCCESS, output_handles,
192 std::string actual_response = resource_manager_.SendCommandAndWait(command);
198 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
200 std::string response = CreateErrorResponse(TPM_RC_SESSION_MEMORY);
201 std::string success_response = CreateResponse(
220 std::string CreateContextParameter(UINT64 sequence) {
221 std::string buffer;
234 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
236 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
240 std::string actual_response = resource_manager_.SendCommandAndWait(command);
245 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
247 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
251 std::string actual_response;
260 std::string command = CreateCommand(TPM_CC_Load, input_handles,
263 std::string response = CreateResponse(TPM_RC_SUCCESS, output_handles,
267 std::string actual_response = resource_manager_.SendCommandAndWait(command);
282 std::string command = CreateCommand(TPM_CC_Sign, input_handles,
287 std::string expected_command = CreateCommand(
289 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
293 std::string actual_response = resource_manager_.SendCommandAndWait(command);
300 std::string parameters;
302 std::string command = CreateCommand(TPM_CC_FlushContext, kNoHandles,
304 std::string expected_parameters;
306 std::string expected_command = CreateCommand(
308 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
312 std::string actual_response = resource_manager_.SendCommandAndWait(command);
338 std::string command = CreateCommand(TPM_CC_Sign, input_handles,
341 std::string expected_command = CreateCommand(
343 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
348 std::string actual_response = resource_manager_.SendCommandAndWait(command);
354 std::string command = CreateCommand(TPM_CC_Sign, input_handles,
356 std::string response =
358 std::string actual_response = resource_manager_.SendCommandAndWait(command);
364 std::string parameters = "12345";
365 std::string command =
377 std::string fuzzed_command(command);
390 std::string parameters = "12345";
391 std::string command =
397 std::string response =
401 std::string fuzzed_response;
424 std::string command =
429 std::string response =
435 std::string actual_response = resource_manager_.SendCommandAndWait(command);
442 std::string command =
447 std::string response =
453 std::string actual_response = resource_manager_.SendCommandAndWait(command);
464 std::string command =
469 std::string response =
476 std::string actual_response = resource_manager_.SendCommandAndWait(command);
482 std::string parameters;
484 std::string command = CreateCommand(TPM_CC_FlushContext, kNoHandles,
486 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
490 std::string actual_response = resource_manager_.SendCommandAndWait(command);
508 std::string command = CreateCommand(TPM_CC_Sign, input_handles,
511 std::string response = CreateErrorResponse(TPM_RC_OBJECT_MEMORY);
512 std::string success_response = CreateResponse(
521 std::string actual_response = resource_manager_.SendCommandAndWait(command);
528 std::string command =
533 std::string response =
537 std::string error_response = CreateErrorResponse(TPM_RC_SESSION_MEMORY);
543 std::string actual_response = resource_manager_.SendCommandAndWait(command);
555 std::string response = CreateResponse(TPM_RC_SUCCESS, kNoHandles,
564 std::string command = CreateCommand(TPM_CC_Sign, input_handles,
566 std::string actual_response = resource_manager_.SendCommandAndWait(command);
575 std::string response =
583 std::string command =
588 std::string actual_response = resource_manager_.SendCommandAndWait(command);
597 std::string command =
602 std::string actual_response = resource_manager_.SendCommandAndWait(command);
606 std::string command =
612 std::string actual_response = resource_manager_.SendCommandAndWait(command);
628 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
630 std::string response = CreateErrorResponse(TPM_RC_CONTEXT_GAP);
631 std::string success_response = CreateResponse(
645 std::string actual_response = resource_manager_.SendCommandAndWait(command);
653 std::string context_save = CreateCommand(TPM_CC_ContextSave, handles,
655 std::string context_parameter1 = CreateContextParameter(1);
656 std::string context_save_response1 = CreateResponse(
660 std::string actual_response =
671 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
673 std::string response = CreateErrorResponse(TPM_RC_CONTEXT_GAP);
674 std::string success_response = CreateResponse(
683 std::string context_load1 = CreateCommand(
685 std::string context_load2 =
688 std::string context_load_response =
715 std::string error_response = CreateErrorResponse(TPM_RC_MEMORY);
729 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
731 std::string response = resource_manager_.SendCommandAndWait(command);
736 std::string error_response = CreateErrorResponse(TPM_RC_MEMORY);
739 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
741 std::string response = resource_manager_.SendCommandAndWait(command);
753 std::string error_response = CreateErrorResponse(TPM_RC_CONTEXT_GAP);
761 std::string command = CreateCommand(TPM_CC_Startup, kNoHandles,
763 std::string response = resource_manager_.SendCommandAndWait(command);
768 std::string command =
773 std::string response =
779 std::string actual_response = resource_manager_.SendCommandAndWait(command);