Showing with 248 additions and 3,187 deletions.
  1. +3 −1 .ci/travis-build-and-run-tests.sh
  2. +4 −18 Makefile.am
  3. +2 −4 lib/files.c
  4. +0 −345 lib/future/test/error.c
  5. +0 −21 lib/pcr.c
  6. +0 −1 lib/pcr.h
  7. +0 −838 lib/rc-decode.c
  8. +0 −290 lib/rc-decode.h
  9. +1 −1 lib/tpm2_alg_util.c
  10. +31 −50 lib/{tpm_hash.c → tpm2_hash.c}
  11. +6 −28 lib/{tpm_hash.h → tpm2_hash.h}
  12. +26 −10 lib/tpm2_nv_util.h
  13. +0 −1 lib/tpm2_openssl.c
  14. +6 −6 lib/tpm2_policy.c
  15. +2 −2 lib/tpm2_session.c
  16. +0 −140 lib/tpm_hmac.c
  17. +0 −1 lib/tpm_kdfa.c
  18. +1 −1 test/system/test.sh
  19. +0 −726 test/unit/tpm2-rc-decode_unit.c
  20. +0 −312 test/unit/tpm2-rc-entry_unit.c
  21. +65 −22 lib/tpm_hmac.h → tools/aux/tpm2_rc_decode.c
  22. +0 −1 tools/tpm2_encryptdecrypt.c
  23. +1 −1 tools/tpm2_getmanufec.c
  24. +3 −4 tools/tpm2_hash.c
  25. +1 −1 tools/tpm2_import.c
  26. +2 −3 tools/tpm2_listpersistent.c
  27. +1 −1 tools/tpm2_load.c
  28. +1 −1 tools/tpm2_loadexternal.c
  29. +3 −3 tools/tpm2_makecredential.c
  30. +2 −2 tools/tpm2_nvdefine.c
  31. +4 −4 tools/tpm2_nvlist.c
  32. +10 −10 tools/tpm2_nvread.c
  33. +2 −2 tools/tpm2_nvreadlock.c
  34. +2 −2 tools/tpm2_nvrelease.c
  35. +9 −9 tools/tpm2_nvwrite.c
  36. +24 −15 tools/tpm2_pcrevent.c
  37. +4 −4 tools/tpm2_pcrextend.c
  38. +2 −4 tools/tpm2_pcrlist.c
  39. +1 −1 tools/tpm2_quote.c
  40. +0 −271 tools/tpm2_rc_decode.c
  41. +1 −1 tools/tpm2_readpublic.c
  42. +1 −1 tools/tpm2_rsaencrypt.c
  43. +9 −9 tools/tpm2_send.c
  44. +4 −4 tools/tpm2_sign.c
  45. +4 −5 tools/tpm2_startup.c
  46. +3 −3 tools/tpm2_tool.c
  47. +3 −3 tools/tpm2_unseal.c
  48. +4 −4 tools/tpm2_verifysignature.c
4 changes: 3 additions & 1 deletion .ci/travis-build-and-run-tests.sh
Expand Up @@ -113,7 +113,9 @@ popd
pushd ./test/system

# Run the tests on ALL device TCTIs configuration
PATH=$(pwd)/../../build/tools:${PATH} ./test.sh -p -t abrmd

TOOLS="$(pwd)/../../build/tools"
PATH=$TOOLS:$TOOLS/aux:$PATH ./test.sh -p -t abrmd

# done go back to tpm2-tools directory
popd
Expand Down
22 changes: 4 additions & 18 deletions Makefile.am
Expand Up @@ -48,6 +48,7 @@ LDADD = \
# keep me sorted
bin_PROGRAMS = \
tools/aux/tpm2_print \
tools/aux/tpm2_rc_decode \
tools/tpm2_activatecredential \
tools/tpm2_certify \
tools/tpm2_changeauth \
Expand Down Expand Up @@ -84,7 +85,6 @@ bin_PROGRAMS = \
tools/tpm2_policypcr \
tools/tpm2_policyrestart \
tools/tpm2_quote \
tools/tpm2_rc_decode \
tools/tpm2_readpublic \
tools/tpm2_rsadecrypt \
tools/tpm2_rsaencrypt \
Expand All @@ -105,8 +105,6 @@ lib_libcommon_a_SOURCES = \
lib/log.h \
lib/pcr.c \
lib/pcr.h \
lib/rc-decode.c \
lib/rc-decode.h \
lib/tpm2_alg_util.c \
lib/tpm2_alg_util.h \
lib/tpm2_attr_util.c \
Expand All @@ -115,6 +113,8 @@ lib_libcommon_a_SOURCES = \
lib/tpm2_errata.h \
lib/tpm2_error.c \
lib/tpm2_error.h \
lib/tpm2_hash.c \
lib/tpm2_hash.h \
lib/tpm2_header.h \
lib/tpm2_hierarchy.c \
lib/tpm2_hierarchy.h \
Expand All @@ -127,10 +127,6 @@ lib_libcommon_a_SOURCES = \
lib/tpm2_policy.h \
lib/tpm2_util.c \
lib/tpm2_util.h \
lib/tpm_hash.c \
lib/tpm_hash.h \
lib/tpm_hmac.c \
lib/tpm_hmac.h \
lib/tpm_kdfa.c \
lib/tpm_kdfa.h \
lib/tpm2_options.c \
Expand All @@ -143,6 +139,7 @@ lib_libcommon_a_SOURCES = \
TOOL_SRC := tools/tpm2_tool.c tools/tpm2_tool.h

tools_aux_tpm2_print_SOURCES = tools/aux/tpm2_print.c $(TOOL_SRC)
tools_aux_tpm2_rc_decode_SOURCES = tools/aux/tpm2_rc_decode.c $(TOOL_SRC)

tools_tpm2_clear_SOURCES = tools/tpm2_clear.c $(TOOL_SRC)
tools_tpm2_clearlock_SOURCES = tools/tpm2_clearlock.c $(TOOL_SRC)
Expand Down Expand Up @@ -186,7 +183,6 @@ tools_tpm2_dictionarylockout_SOURCES = tools/tpm2_dictionarylockout.c $(TOOL_SRC
tools_tpm2_createpolicy_SOURCES = tools/tpm2_createpolicy.c $(TOOL_SRC)
tools_tpm2_pcrextend_SOURCES = tools/tpm2_pcrextend.c $(TOOL_SRC)
tools_tpm2_pcrevent_SOURCES = tools/tpm2_pcrevent.c $(TOOL_SRC)
tools_tpm2_rc_decode_SOURCES = tools/tpm2_rc_decode.c $(TOOL_SRC)
tools_tpm2_import_SOURCES = tools/tpm2_import.c $(TOOL_SRC)
tools_tpm2_flushcontext_SOURCES = tools/tpm2_flushcontext.c $(TOOL_SRC)
tools_tpm2_startauthsession_SOURCES = tools/tpm2_startauthsession.c $(TOOL_SRC)
Expand All @@ -196,8 +192,6 @@ tools_tpm2_policyrestart_SOURCES = tools/tpm2_policyrestart.c $(TOOL_SRC)
if UNIT
TESTS = $(check_PROGRAMS)
check_PROGRAMS = \
test/unit/tpm2-rc-decode_unit \
test/unit/tpm2-rc-entry_unit \
test/unit/test_string_bytes \
test/unit/test_files \
test/unit/test_tpm2_header \
Expand All @@ -211,14 +205,6 @@ check_PROGRAMS = \
test/unit/test_tpm2_hierarchy \
test/unit/test_tpm2_error

test_unit_tpm2_rc_decode_unit_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
test_unit_tpm2_rc_decode_unit_LDADD = $(CMOCKA_LIBS) $(LIB_COMMON)
test_unit_tpm2_rc_decode_unit_SOURCES = test/unit/tpm2-rc-decode_unit.c

test_unit_tpm2_rc_entry_unit_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
test_unit_tpm2_rc_entry_unit_LDADD = $(CMOCKA_LIBS) $(LIB_COMMON)
test_unit_tpm2_rc_entry_unit_SOURCES = test/unit/tpm2-rc-entry_unit.c

test_unit_test_string_bytes_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
test_unit_test_string_bytes_LDADD = $(CMOCKA_LIBS) $(LIB_COMMON)
test_unit_test_string_bytes_SOURCES = test/unit/test_string_bytes.c
Expand Down
6 changes: 2 additions & 4 deletions lib/files.c
Expand Up @@ -160,9 +160,7 @@ bool files_save_tpm_context_to_file(TSS2_SYS_CONTEXT *sysContext, TPM2_HANDLE ha

TSS2_RC rval = Tss2_Sys_ContextSave(sysContext, handle, &context);
if (rval != TPM2_RC_SUCCESS) {
LOG_ERR(
"Tss2_Sys_ContextSave: Saving handle 0x%x context failed. TPM Error:0x%x",
handle, rval);
LOG_PERR(Tss2_Sys_ContextSave, rval);
return false;
}

Expand Down Expand Up @@ -317,7 +315,7 @@ bool files_load_tpm_context_from_file(TSS2_SYS_CONTEXT *sapi_context,
load_to_tpm:
rval = Tss2_Sys_ContextLoad(sapi_context, &context, handle);
if (rval != TPM2_RC_SUCCESS) {
LOG_ERR("ContextLoad Error. TPM Error:0x%x", rval);
LOG_PERR(Tss2_Sys_ContextLoad, rval);
result = false;
goto out;
}
Expand Down