Skip to content

Commit

Permalink
使用Tss2_RC_Decode()代替现有的错误码查询函数
Browse files Browse the repository at this point in the history
  • Loading branch information
liuqun committed Feb 5, 2021
1 parent e81e8e8 commit 5af1558
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ using namespace std;

#include <tss2/tss2_sys.h>
#include <tss2/tss2_tpm2_types.h>
#include <tss2/tss2_rc.h>

#include "tcti_util.h"
#include "ResponseCodeResolver.h"
#include "NVStorageFormatter.h"

/* 自定义函数 */
Expand Down Expand Up @@ -245,7 +245,7 @@ static void DoMyTestsWithSysContext(TSS2_SYS_CONTEXT *pSysContext)
if (rc1passwd)
{
printf("Write ERROR: %s\n",
GetErrMsgOfTPMResponseCode(rc1passwd));
Tss2_RC_Decode(rc1passwd));
}
else
{
Expand All @@ -266,7 +266,7 @@ static void DoMyTestsWithSysContext(TSS2_SYS_CONTEXT *pSysContext)
if (rc1passwd)
{
printf("Read ERROR: %s\n",
GetErrMsgOfTPMResponseCode(rc1passwd));
Tss2_RC_Decode(rc1passwd));
}
else
{
Expand All @@ -292,7 +292,7 @@ static void DoMyTestsWithSysContext(TSS2_SYS_CONTEXT *pSysContext)
if (rc2passwd)
{
printf("Read ERROR: %s\n",
GetErrMsgOfTPMResponseCode(rc2passwd));
Tss2_RC_Decode(rc2passwd));
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ conf = configuration_data()

tss2_esys_lib = dependency('tss2-esys', version: '>= 3.0.3')
tss2_mu_lib = dependency('tss2-mu', version: '>= 3.0.3')
tss2_rc_lib = dependency('tss2-rc', version: '>= 3.0.3')
tss2_sys_lib = dependency('tss2-sys', version: '>= 3.0.3')
tss2_tcti_device_lib = [
dependency('tss2-tcti-device', version: '>= 3.0.3'),
Expand Down Expand Up @@ -41,6 +42,7 @@ exe = executable('main',
tss2_tcti_swtpm_lib,
tss2_tcti_mssim_lib,
tss2_mu_lib,
tss2_rc_lib,
],
)

Expand Down

0 comments on commit 5af1558

Please sign in to comment.