• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*############################################################################
2 # Copyright 2017 Intel Corporation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 ############################################################################*/
16 /// TPM context implementation.
17 /*! \file */
18 #ifndef EPID_ENABLE_DEBUG_PRINT
19 #define EPID_ENABLE_DEBUG_PRINT
20 #endif
21 
22 #include "epid/member/tpm2/ibm_tss/printtss.h"
23 #include <tss2/TPM_Types.h>
24 #include <tss2/tss.h>
25 #include <tss2/tssresponsecode.h>
26 
print_tpm2_response_code(char const * operation,TPM_RC rc)27 void print_tpm2_response_code(char const* operation, TPM_RC rc) {
28   const char* msg;
29   const char* submsg;
30   const char* num;
31   TSS_ResponseCode_toString(&msg, &submsg, &num, rc);
32   printf("%s: %s%s%s\n", operation, msg, submsg, num);
33 }
34 
35 #ifdef EPID_ENABLE_DEBUG_PRINT
36 #undef EPID_ENABLE_DEBUG_PRINT
37 #endif
38