Showing with 4,942 additions and 5,704 deletions.
  1. +43 −33 Makefile.am
  2. +0 −277 lib/context-util.c
  3. +0 −47 lib/context-util.h
  4. +0 −421 lib/options.c
  5. +0 −163 lib/options.h
  6. +66 −0 lib/tcti/tpm2_tools_tcti_abrmd.c
  7. +48 −0 lib/tcti/tpm2_tools_tcti_abrmd.h
  8. +83 −0 lib/tcti/tpm2_tools_tcti_device.c
  9. +47 −0 lib/tcti/tpm2_tools_tcti_device.h
  10. +111 −0 lib/tcti/tpm2_tools_tcti_socket.c
  11. +47 −0 lib/tcti/tpm2_tools_tcti_socket.h
  12. +372 −0 lib/tpm2_options.c
  13. +176 −0 lib/tpm2_options.h
  14. +2 −0 lib/tpm2_util.h
  15. +4 −13 man/tpm2_startup.8.in
  16. +2 −2 test/system/test_tpm2_startup.sh
  17. +0 −104 tools/main.c
  18. +103 −129 tools/tpm2_activatecredential.c
  19. +29 −56 tools/tpm2_akparse.c
  20. +134 −167 tools/tpm2_certify.c
  21. +237 −260 tools/tpm2_create.c
  22. +84 −115 tools/tpm2_createpolicy.c
  23. +184 −188 tools/tpm2_createprimary.c
  24. +82 −117 tools/tpm2_dictionarylockout.c
  25. +68 −100 tools/tpm2_dump_capability.c
  26. +115 −141 tools/tpm2_encryptdecrypt.c
  27. +93 −126 tools/tpm2_evictcontrol.c
  28. +168 −182 tools/tpm2_getmanufec.c
  29. +134 −158 tools/tpm2_getpubak.c
  30. +96 −124 tools/tpm2_getpubek.c
  31. +33 −54 tools/tpm2_getrandom.c
  32. +71 −89 tools/tpm2_hash.c
  33. +121 −152 tools/tpm2_hmac.c
  34. +5 −15 tools/tpm2_listpersistent.c
  35. +127 −147 tools/tpm2_load.c
  36. +59 −90 tools/tpm2_loadexternal.c
  37. +70 −101 tools/tpm2_makecredential.c
  38. +97 −123 tools/tpm2_nvdefine.c
  39. +4 −8 tools/tpm2_nvlist.c
  40. +96 −116 tools/tpm2_nvread.c
  41. +65 −91 tools/tpm2_nvreadlock.c
  42. +67 −86 tools/tpm2_nvrelease.c
  43. +81 −100 tools/tpm2_nvwrite.c
  44. +104 −113 tools/tpm2_pcrevent.c
  45. +27 −31 tools/tpm2_pcrextend.c
  46. +160 −147 tools/tpm2_pcrlist.c
  47. +126 −172 tools/tpm2_quote.c
  48. +121 −134 tools/tpm2_rc_decode.c
  49. +67 −84 tools/tpm2_readpublic.c
  50. +95 −116 tools/tpm2_rsadecrypt.c
  51. +74 −96 tools/tpm2_rsaencrypt.c
  52. +40 −43 tools/tpm2_send_command.c
  53. +136 −160 tools/tpm2_sign.c
  54. +37 −92 tools/tpm2_startup.c
  55. +85 −108 tools/tpm2_takeownership.c
  56. +158 −0 tools/tpm2_tool.c
  57. +39 −21 tools/{main.h → tpm2_tool.h}
  58. +111 −134 tools/tpm2_unseal.c
  59. +138 −158 tools/tpm2_verifysignature.c
76 changes: 43 additions & 33 deletions Makefile.am
Expand Up @@ -32,7 +32,7 @@

ACLOCAL_AMFLAGS = -I m4

INCLUDE_DIRS = -I$(top_srcdir)/src -I$(top_srcdir)/lib
INCLUDE_DIRS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -I$(top_srcdir)/lib/tcti
LIB_COMMON := lib/libcommon.a

AM_CFLAGS := \
Expand All @@ -45,58 +45,68 @@ LDADD = \
$(LIB_COMMON) $(SAPI_LIBS) $(TCTI_SOCK_LIBS) $(TCTI_TABRMD_LIBS) \
$(TCTI_DEV_LIBS) $(CRYPTO_LIBS)

# keep me sorted
bin_PROGRAMS = \
tools/tpm2_activatecredential \
tools/tpm2_akparse \
tools/tpm2_certify \
tools/tpm2_create \
tools/tpm2_createpolicy \
tools/tpm2_createprimary \
tools/tpm2_load \
tools/tpm2_send_command \
tools/tpm2_dictionarylockout \
tools/tpm2_dump_capability \
tools/tpm2_pcrlist \
tools/tpm2_listpersistent \
tools/tpm2_startup \
tools/tpm2_rc_decode \
tools/tpm2_verifysignature \
tools/tpm2_encryptdecrypt \
tools/tpm2_evictcontrol \
tools/tpm2_getmanufec \
tools/tpm2_quote \
tools/tpm2_takeownership \
tools/tpm2_getpubek \
tools/tpm2_getpubak \
tools/tpm2_akparse \
tools/tpm2_getpubek \
tools/tpm2_getrandom \
tools/tpm2_hash \
tools/tpm2_activatecredential \
tools/tpm2_hmac \
tools/tpm2_listpersistent \
tools/tpm2_load \
tools/tpm2_loadexternal \
tools/tpm2_makecredential \
tools/tpm2_nvdefine \
tools/tpm2_nvlist \
tools/tpm2_nvread \
tools/tpm2_nvreadlock \
tools/tpm2_nvwrite \
tools/tpm2_nvdefine \
tools/tpm2_nvrelease \
tools/tpm2_hmac \
tools/tpm2_certify \
tools/tpm2_nvwrite \
tools/tpm2_pcrevent \
tools/tpm2_pcrextend \
tools/tpm2_pcrlist \
tools/tpm2_quote \
tools/tpm2_rc_decode \
tools/tpm2_readpublic \
tools/tpm2_getrandom \
tools/tpm2_encryptdecrypt \
tools/tpm2_evictcontrol \
tools/tpm2_loadexternal \
tools/tpm2_rsadecrypt \
tools/tpm2_rsaencrypt \
tools/tpm2_send_command \
tools/tpm2_sign \
tools/tpm2_startup \
tools/tpm2_takeownership \
tools/tpm2_unseal \
tools/tpm2_dictionarylockout \
tools/tpm2_createpolicy \
tools/tpm2_pcrextend \
tools/tpm2_pcrevent
tools/tpm2_verifysignature

tcti_src = ""
if HAVE_TCTI_DEV
tcti_src += lib/tcti/tpm2_tools_tcti_device.c
endif
if HAVE_TCTI_SOCK
tcti_src += lib/tcti/tpm2_tools_tcti_socket.c
endif
if HAVE_TCTI_TABRMD
tcti_src += lib/tcti/tpm2_tools_tcti_abrmd.c
endif


noinst_LIBRARIES = $(LIB_COMMON)
lib_libcommon_a_SOURCES = \
lib/context-util.c \
lib/context-util.h \
$(tcti_src) \
lib/files.c \
lib/files.h \
lib/log.c \
lib/log.h \
lib/options.c \
lib/options.h \
lib/pcr.c \
lib/pcr.h \
lib/rc-decode.c \
Expand All @@ -118,10 +128,12 @@ lib_libcommon_a_SOURCES = \
lib/tpm_hmac.h \
lib/tpm_kdfa.c \
lib/tpm_kdfa.h \
lib/tpm2_options.c \
lib/tpm2_options.h \
lib/tpm_session.c \
lib/tpm_session.h

TOOL_SRC := tools/main.c tools/main.h
TOOL_SRC := tools/tpm2_tool.c tools/tool.h

tools_tpm2_create_SOURCES = tools/tpm2_create.c $(TOOL_SRC)
tools_tpm2_createprimary_SOURCES = tools/tpm2_createprimary.c $(TOOL_SRC)
Expand Down Expand Up @@ -164,9 +176,7 @@ 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)

# rc_decode does not use common main, since it does not need a dynamic TCTI.
tools_tpm2_rc_decode_SOURCES = lib/rc-decode.c tools/tpm2_rc_decode.c
tools_tpm2_rc_decode_SOURCES = tools/tpm2_rc_decode.c $(TOOL_SRC)

if UNIT
TESTS = $(check_PROGRAMS)
Expand Down