]> xenbits.xensource.com Git - people/liuw/stubdom.git/commitdiff
stubdom/vtpm: correct the buffer size returned by TPM_CAP_PROP_INPUT_BUFFER
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Thu, 21 Mar 2013 20:11:23 +0000 (16:11 -0400)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 12 Apr 2013 13:28:17 +0000 (14:28 +0100)
The vtpm2 ABI supports packets of up to 4088 bytes by default; expose
this property though the TPM's interface so clients do not attempt to
send larger packets.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Makefile
vtpm-bufsize.patch [new file with mode: 0644]

index 674132a9dbd2fa3e64c9f8e789bff1391f18f854..5372715f4d2ea5de1483ff4e8e5165c5fc4e322a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -209,6 +209,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
        tar xzf $<
        mv tpm_emulator-$(TPMEMU_VERSION) $@
        patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+       patch -d $@ -p1 < vtpm-bufsize.patch
        mkdir $@/build
        cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
        touch $@
diff --git a/vtpm-bufsize.patch b/vtpm-bufsize.patch
new file mode 100644 (file)
index 0000000..9c9304c
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/config.h.in b/config.h.in
+index d16a997..8088a2a 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -27,7 +27,7 @@
+ #define TPM_STORAGE_NAME "${TPM_STORAGE_NAME}"
+ #define TPM_DEVICE_NAME  "${TPM_DEVICE_NAME}"
+ #define TPM_LOG_FILE     "${TPM_LOG_FILE}"
+-#define TPM_CMD_BUF_SIZE 4096
++#define TPM_CMD_BUF_SIZE 4088
+ #endif /* _CONFIG_H_ */