aboutsummaryrefslogtreecommitdiffstats
path: root/tools/vtpm
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-09-20 09:08:26 +0000
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2005-09-20 09:08:26 +0000
commit20e8ba075ba1a968006e4748ac4113ab84796549 (patch)
tree0edfd0bd04c4b2d7d23785db54f03dcc7fcc7259 /tools/vtpm
parentbc6ef390faf4648d3cca12e68315512aebcf0db7 (diff)
downloadxen-20e8ba075ba1a968006e4748ac4113ab84796549.tar.gz
xen-20e8ba075ba1a968006e4748ac4113ab84796549.tar.bz2
xen-20e8ba075ba1a968006e4748ac4113ab84796549.zip
Add 64 bit support to the VTPM Tools plus do some minor cleanups.
The VTPM manager and VTPMs fully support both 32 and 64 bit OSes. The tpm_emulator (provided for debugging on TPM-less machines) does not support 64-bit kernels by default though. See the README for details on how to use it on 64-bit kernels. (Vinnie Scarlata, Intel Corporation) Signed-off-by: Joe Cihula <joe.cihula@intel.com>
Diffstat (limited to 'tools/vtpm')
-rw-r--r--tools/vtpm/Makefile34
-rw-r--r--tools/vtpm/README1
-rw-r--r--tools/vtpm/tpm_emulator.patch85
-rw-r--r--tools/vtpm/vtpm.patch379
4 files changed, 246 insertions, 253 deletions
diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile
index 5b9cd0a9f2..a1c8aa6438 100644
--- a/tools/vtpm/Makefile
+++ b/tools/vtpm/Makefile
@@ -4,7 +4,7 @@ XEN_ROOT = ../..
include $(XEN_ROOT)/tools/vtpm/Rules.mk
# Dir name for emulator (as dom0 tpm driver)
-TPM_EMULATOR_DIR = tpm_emulator-0.2
+TPM_EMULATOR_DIR = tpm_emulator
# Dir name for vtpm instance
VTPM_DIR = vtpm
@@ -13,7 +13,7 @@ TPM_EMULATOR_TARFILE = tpm_emulator-0.2b.tar.gz
all: build
-build: $(TPM_EMULATOR_TARFILE) extract patch build_sub
+build: $(TPM_EMULATOR_DIR) $(VTPM_DIR) build_sub
install: build
$(MAKE) -C $(TPM_EMULATOR_DIR) $@
@@ -26,36 +26,32 @@ clean:
if [ -d $(VTPM_DIR) ]; \
then $(MAKE) -C $(VTPM_DIR) clean; \
fi
- rm -rf $(TPM_EMULATOR_DIR)
- rm -rf $(VTPM_DIR)
-mrproper: clean
+mrproper:
rm -f $(TPM_EMULATOR_TARFILE)
+ rm -rf $(TPM_EMULATOR_DIR)
+ rm -rf $(VTPM_DIR)
# Download Swiss emulator
$(TPM_EMULATOR_TARFILE):
wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
# Create vtpm and TPM emulator dirs
-extract: $(TPM_EMULATOR_DIR)/README $(VTPM_DIR)/README
-
-$(TPM_EMULATOR_DIR)/README:
- -rm -rf $(TPM_EMULATOR_DIR)
- tar -xzf $(TPM_EMULATOR_TARFILE)
-
-$(VTPM_DIR)/README:
- -rm -rf $(VTPM_DIR)
- cp -r --preserve $(TPM_EMULATOR_DIR) $(VTPM_DIR)
-
# apply patches for 1) used as dom0 tpm driver 2) used as vtpm device instance
-patch: $(TPM_EMULATOR_DIR)/Makefile $(VTPM_DIR)/Makefile
-
-$(TPM_EMULATOR_DIR)/Makefile: tpm_emulator.patch
+$(TPM_EMULATOR_DIR): $(TPM_EMULATOR_TARFILE)
+ tar -xzf $(TPM_EMULATOR_TARFILE);
+ mv tpm_emulator-0.2 $(TPM_EMULATOR_DIR);
+
-cd $(TPM_EMULATOR_DIR); \
+ patch -p1 < ../tpm_emulator-0.2b-x86_64.patch; \
patch -p1 <../tpm_emulator.patch
-$(VTPM_DIR)/Makefile: vtpm.patch
+$(VTPM_DIR): $(TPM_EMULATOR_TARFILE)
+ tar -xzf $(TPM_EMULATOR_TARFILE);
+ mv tpm_emulator-0.2 $(VTPM_DIR);
+
-cd $(VTPM_DIR); \
+ patch -p1 < ../tpm_emulator-0.2b-x86_64.patch; \
patch -p1 <../vtpm.patch
build_sub:
diff --git a/tools/vtpm/README b/tools/vtpm/README
index c72ed7dbc8..2008cbdfb7 100644
--- a/tools/vtpm/README
+++ b/tools/vtpm/README
@@ -23,6 +23,7 @@ Requirements
- xen-unstable
- IBM frontend/backend vtpm driver patch
- vtpm_managerd
+- GNU MP Big number library (GMP)
vtpmd Flow (for vtpm_manager. vtpmd never run by default)
============================
diff --git a/tools/vtpm/tpm_emulator.patch b/tools/vtpm/tpm_emulator.patch
index 85d11feafc..7af2f9dd27 100644
--- a/tools/vtpm/tpm_emulator.patch
+++ b/tools/vtpm/tpm_emulator.patch
@@ -1,12 +1,12 @@
-diff -uprN orig/tpm_emulator-0.2/AUTHORS tpm_emulator-0.2/AUTHORS
---- orig/tpm_emulator-0.2/AUTHORS 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/AUTHORS 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/AUTHORS tpm_emulator/AUTHORS
+--- orig/tpm_emulator-0.2-x86_64/AUTHORS 2005-08-15 00:58:57.000000000 -0700
++++ tpm_emulator/AUTHORS 2005-09-14 20:27:22.000000000 -0700
@@ -1 +1,2 @@
Mario Strasser <mast@gmx.net>
+INTEL Corp <>
-diff -uprN orig/tpm_emulator-0.2/ChangeLog tpm_emulator-0.2/ChangeLog
---- orig/tpm_emulator-0.2/ChangeLog 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/ChangeLog 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/ChangeLog tpm_emulator/ChangeLog
+--- orig/tpm_emulator-0.2-x86_64/ChangeLog 2005-08-15 00:58:57.000000000 -0700
++++ tpm_emulator/ChangeLog 2005-09-14 20:27:22.000000000 -0700
@@ -1,3 +1,7 @@
+2005-08-16: INTEL Corp
+ * Set default permissions to PCRs
@@ -15,10 +15,29 @@ diff -uprN orig/tpm_emulator-0.2/ChangeLog tpm_emulator-0.2/ChangeLog
2005-08-15 Mario Strasser <mast@gmx.net>
* all: some typos corrected
* tpm_integrity.c: bug in TPM_Extend fixed
-diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
---- orig/tpm_emulator-0.2/Makefile 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/Makefile 2005-08-17 10:55:52.000000000 -0700
-@@ -1,15 +1,19 @@
+diff -uprN orig/tpm_emulator-0.2-x86_64/linux_module.h tpm_emulator/linux_module.h
+--- orig/tpm_emulator-0.2-x86_64/linux_module.h 2005-09-15 19:21:14.844078720 -0700
++++ tpm_emulator/linux_module.h 2005-09-14 20:27:22.000000000 -0700
+@@ -1,5 +1,6 @@
+ /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
+ * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
++ * Copyright (C) 2005 INTEL Corp.
+ *
+ * This module is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+@@ -35,7 +36,7 @@
+ #include "tpm_version.h"
+
+ #define TPM_DEVICE_MINOR 224
+-#define TPM_DEVICE_NAME "tpm"
++#define TPM_DEVICE_NAME "tpm0"
+ #define TPM_MODULE_NAME "tpm_emulator"
+
+ /* debug and log output functions */
+diff -uprN orig/tpm_emulator-0.2-x86_64/Makefile tpm_emulator/Makefile
+--- orig/tpm_emulator-0.2-x86_64/Makefile 2005-09-15 19:21:14.845078568 -0700
++++ tpm_emulator/Makefile 2005-09-14 20:27:22.000000000 -0700
+@@ -1,16 +1,20 @@
# Software-Based Trusted Platform Module (TPM) Emulator for Linux
# Copyright (C) 2004 Mario Strasser <mast@gmx.net>
+# Copyright (C) 2005 INTEL Corp.
@@ -33,6 +52,7 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
-KERNEL_BUILD := /lib/modules/$(KERNEL_RELEASE)/build
+KERNEL_BUILD := $(XEN_ROOT)/linux-2.6.12-xen0
MOD_SUBDIR := misc
+ COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
# module settings
-MODULE_NAME := tpm_emulator
@@ -40,7 +60,7 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
VERSION_MAJOR := 0
VERSION_MINOR := 2
VERSION_BUILD := $(shell date +"%s")
-@@ -27,11 +30,9 @@ DIRS := . crypto tpm
+@@ -34,11 +38,9 @@ DIRS := . crypto tpm
SRCS := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
OBJS := $(patsubst %.c, %.o, $(SRCS))
SRCS += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
@@ -54,7 +74,7 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
EXTRA_CFLAGS += -I$(src) -I$(src)/crypto -I$(src)/tpm
-@@ -42,23 +43,17 @@ all: $(src)/crypto/gmp.h $(src)/crypto/l
+@@ -49,23 +51,17 @@ all: $(src)/crypto/gmp.h $(src)/crypto/l
@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
install:
@@ -84,9 +104,9 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
$(src)/crypto/libgmp.a:
test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
-diff -uprN orig/tpm_emulator-0.2/README tpm_emulator-0.2/README
---- orig/tpm_emulator-0.2/README 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/README 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/README tpm_emulator/README
+--- orig/tpm_emulator-0.2-x86_64/README 2005-08-15 00:58:57.000000000 -0700
++++ tpm_emulator/README 2005-09-14 20:27:22.000000000 -0700
@@ -13,7 +13,8 @@ $Id: README 8 2005-01-25 21:11:45Z jmoli
Copyright
--------------------------------------------------------------------------
@@ -97,28 +117,9 @@ diff -uprN orig/tpm_emulator-0.2/README tpm_emulator-0.2/README
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-diff -uprN orig/tpm_emulator-0.2/linux_module.h tpm_emulator-0.2/linux_module.h
---- orig/tpm_emulator-0.2/linux_module.h 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/linux_module.h 2005-08-17 10:55:52.000000000 -0700
-@@ -1,5 +1,6 @@
- /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
- * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
-+ * Copyright (C) 2005 INTEL Corp.
- *
- * This module is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
-@@ -33,7 +34,7 @@
- #include "tpm_version.h"
-
- #define TPM_DEVICE_MINOR 224
--#define TPM_DEVICE_NAME "tpm"
-+#define TPM_DEVICE_NAME "tpm0"
- #define TPM_MODULE_NAME "tpm_emulator"
-
- /* debug and log output functions */
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_data.c tpm_emulator-0.2/tpm/tpm_data.c
---- orig/tpm_emulator-0.2/tpm/tpm_data.c 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/tpm/tpm_data.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_data.c tpm_emulator/tpm/tpm_data.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_data.c 2005-09-15 19:21:14.847078264 -0700
++++ tpm_emulator/tpm/tpm_data.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -139,13 +140,3 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_data.c tpm_emulator-0.2/tpm/tpm_data.c
tpmData.permanent.data.pcrAttrib[i].pcrReset = TRUE;
}
/* set tick type */
-diff -uprN orig/tpm_emulator-0.2/tpm_version.h tpm_emulator-0.2/tpm_version.h
---- orig/tpm_emulator-0.2/tpm_version.h 2005-08-17 10:58:36.000000000 -0700
-+++ tpm_emulator-0.2/tpm_version.h 2005-08-17 10:55:53.000000000 -0700
-@@ -2,5 +2,5 @@
- #define _TPM_VERSION_H_
- #define VERSION_MAJOR 0
- #define VERSION_MINOR 2
--#define VERSION_BUILD 1123950310
-+#define VERSION_BUILD 1124301353
- #endif /* _TPM_VERSION_H_ */
diff --git a/tools/vtpm/vtpm.patch b/tools/vtpm/vtpm.patch
index 608e6d116b..1964f3e46b 100644
--- a/tools/vtpm/vtpm.patch
+++ b/tools/vtpm/vtpm.patch
@@ -1,12 +1,12 @@
-diff -uprN orig/tpm_emulator-0.2/AUTHORS vtpm/AUTHORS
---- orig/tpm_emulator-0.2/AUTHORS 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/AUTHORS 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/AUTHORS vtpm/AUTHORS
+--- orig/tpm_emulator-0.2-x86_64/AUTHORS 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/AUTHORS 2005-09-14 20:27:22.000000000 -0700
@@ -1 +1,2 @@
Mario Strasser <mast@gmx.net>
+INTEL Corp <>
-diff -uprN orig/tpm_emulator-0.2/ChangeLog vtpm/ChangeLog
---- orig/tpm_emulator-0.2/ChangeLog 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/ChangeLog 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/ChangeLog vtpm/ChangeLog
+--- orig/tpm_emulator-0.2-x86_64/ChangeLog 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/ChangeLog 2005-09-14 20:27:22.000000000 -0700
@@ -1,3 +1,7 @@
+2005-08-16 Intel Corp
+ Moved module out of kernel to run as a ring 3 app
@@ -15,115 +15,9 @@ diff -uprN orig/tpm_emulator-0.2/ChangeLog vtpm/ChangeLog
2005-08-15 Mario Strasser <mast@gmx.net>
* all: some typos corrected
* tpm_integrity.c: bug in TPM_Extend fixed
-diff -uprN orig/tpm_emulator-0.2/Makefile vtpm/Makefile
---- orig/tpm_emulator-0.2/Makefile 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/Makefile 2005-08-17 10:55:52.000000000 -0700
-@@ -1,21 +1,29 @@
- # Software-Based Trusted Platform Module (TPM) Emulator for Linux
- # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
-+# Copyright (C) 2005 INTEL Corp.
- #
- # $Id: Makefile 10 2005-04-26 20:59:50Z mast $
-
--# kernel settings
--KERNEL_RELEASE := $(shell uname -r)
--KERNEL_BUILD := /lib/modules/$(KERNEL_RELEASE)/build
--MOD_SUBDIR := misc
--
- # module settings
--MODULE_NAME := tpm_emulator
-+BIN := vtpmd
- VERSION_MAJOR := 0
- VERSION_MINOR := 2
- VERSION_BUILD := $(shell date +"%s")
-
--# enable/disable DEBUG messages
--EXTRA_CFLAGS += -DDEBUG -g
-+# Installation program and options
-+INSTALL = install
-+INSTALL_PROG = $(INSTALL) -m0755
-+INSTALL_DIR = $(INSTALL) -d -m0755
-+
-+# Xen tools installation directory
-+TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
-+
-+CC := gcc
-+CFLAGS += -g -Wall $(INCLUDE) -DDEBUG
-+CFLAGS += -I. -Itpm
-+
-+# Is the simulator running in it's own vm?
-+#CFLAGS += -DVTPM_MULTI_VM
-
- # GNU MP configuration
- GMP_LIB := /usr/lib/libgmp.a
-@@ -27,38 +35,31 @@ DIRS := . crypto tpm
- SRCS := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
- OBJS := $(patsubst %.c, %.o, $(SRCS))
- SRCS += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
--DISTSRC := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
--DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
-
--obj-m := $(MODULE_NAME).o
--$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
-+obj-m := $(BIN)
-+$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
-
- EXTRA_CFLAGS += -I$(src) -I$(src)/crypto -I$(src)/tpm
-
- # do not print "Entering directory ..."
- MAKEFLAGS += --no-print-directory
-
--all: $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
-- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
-+all: $(BIN)
-+
-+$(BIN): $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
-+ $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
-+
-+%.o: %.c
-+ $(CC) $(CFLAGS) -c $< -o $@
-
- install:
-- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
-- test -d /var/tpm || mkdir /var/tpm
-- test -c /dev/tpm || mknod /dev/tpm c 10 224
-- chmod 666 /dev/tpm
-- depmod -a
-+ $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
-
- clean:
-- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
-- rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
-+ rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
-
--dist: $(DISTSRC)
-- rm -rf $(DISTDIR)
-- mkdir $(DISTDIR)
-- cp --parents $(DISTSRC) $(DISTDIR)/
-- rm -f $(DISTDIR)/crypto/gmp.h
-- tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
-- rm -rf $(DISTDIR)
-+mrproper: clean
-+ rm -f $(BIN)
-
- $(src)/crypto/libgmp.a:
- test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
-diff -uprN orig/tpm_emulator-0.2/README vtpm/README
---- orig/tpm_emulator-0.2/README 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/README 2005-08-17 10:55:52.000000000 -0700
-@@ -13,7 +13,8 @@ $Id: README 8 2005-01-25 21:11:45Z jmoli
- Copyright
- --------------------------------------------------------------------------
- Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
--Institute of Technology (ETH) Zurich.
-+ Institute of Technology (ETH) Zurich.
-+Copyright (C) 2005 INTEL Corp
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
-diff -uprN orig/tpm_emulator-0.2/crypto/gmp_kernel_wrapper.c vtpm/crypto/gmp_kernel_wrapper.c
---- orig/tpm_emulator-0.2/crypto/gmp_kernel_wrapper.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/crypto/gmp_kernel_wrapper.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/crypto/gmp_kernel_wrapper.c vtpm/crypto/gmp_kernel_wrapper.c
+--- orig/tpm_emulator-0.2-x86_64/crypto/gmp_kernel_wrapper.c 2005-09-15 19:21:42.508873032 -0700
++++ vtpm/crypto/gmp_kernel_wrapper.c 2005-09-15 19:25:37.319176440 -0700
@@ -1,5 +1,6 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -154,9 +48,9 @@ diff -uprN orig/tpm_emulator-0.2/crypto/gmp_kernel_wrapper.c vtpm/crypto/gmp_ker
{
- void *ret = (void*)kmalloc(size, GFP_KERNEL);
- if (!ret) panic(KERN_CRIT TPM_MODULE_NAME
-- "GMP: cannot allocate memory (size=%u)\n", size);
+- "GMP: cannot allocate memory (size=%Zu)\n", size);
+ void *ret = (void*)malloc(size);
-+ if (!ret) error("GMP: cannot allocate memory (size=%u)\n", size);
++ if (!ret) error("GMP: cannot allocate memory (size=%Zu)\n", size);
return ret;
}
@@ -165,9 +59,10 @@ diff -uprN orig/tpm_emulator-0.2/crypto/gmp_kernel_wrapper.c vtpm/crypto/gmp_ker
{
- void *ret = (void*)kmalloc(new_size, GFP_KERNEL);
- if (!ret) panic(KERN_CRIT TPM_MODULE_NAME "GMP: Cannot reallocate memory "
+- "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
+ void *ret = (void*)malloc(new_size);
+ if (!ret) error("GMP: Cannot reallocate memory "
- "(old_size=%u new_size=%u)\n", old_size, new_size);
++ "(old_size=%Zu new_size=%Zu)\n", old_size, new_size);
memcpy(ret, oldptr, old_size);
- kfree(oldptr);
+ free(oldptr);
@@ -183,9 +78,9 @@ diff -uprN orig/tpm_emulator-0.2/crypto/gmp_kernel_wrapper.c vtpm/crypto/gmp_ker
}
}
-diff -uprN orig/tpm_emulator-0.2/crypto/rsa.c vtpm/crypto/rsa.c
---- orig/tpm_emulator-0.2/crypto/rsa.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/crypto/rsa.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/crypto/rsa.c vtpm/crypto/rsa.c
+--- orig/tpm_emulator-0.2-x86_64/crypto/rsa.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/crypto/rsa.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,5 +1,6 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -211,8 +106,8 @@ diff -uprN orig/tpm_emulator-0.2/crypto/rsa.c vtpm/crypto/rsa.c
sha1_final(&ctx, &msg[1]);
if (memcmp(&msg[1], &msg[1 + SHA1_DIGEST_LENGTH],
SHA1_DIGEST_LENGTH) != 0) return -1;
-diff -uprN orig/tpm_emulator-0.2/linux_module.c vtpm/linux_module.c
---- orig/tpm_emulator-0.2/linux_module.c 2005-08-17 10:58:36.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/linux_module.c vtpm/linux_module.c
+--- orig/tpm_emulator-0.2-x86_64/linux_module.c 2005-09-15 19:22:40.343080896 -0700
+++ vtpm/linux_module.c 1969-12-31 16:00:00.000000000 -0800
@@ -1,163 +0,0 @@
-/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
@@ -283,7 +178,7 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.c vtpm/linux_module.c
-
-static ssize_t tpm_read(struct file *file, char *buf, size_t count, loff_t *ppos)
-{
-- debug("%s(%d)", __FUNCTION__, count);
+- debug("%s(%Zu)", __FUNCTION__, count);
- down(&tpm_mutex);
- if (tpm_response.data != NULL) {
- count = min(count, (size_t)tpm_response.size - (size_t)*ppos);
@@ -298,7 +193,7 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.c vtpm/linux_module.c
-
-static ssize_t tpm_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
-- debug("%s(%d)", __FUNCTION__, count);
+- debug("%s(%Zu)", __FUNCTION__, count);
- down(&tpm_mutex);
- *ppos = 0;
- if (tpm_response.data != NULL) kfree(tpm_response.data);
@@ -378,9 +273,9 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.c vtpm/linux_module.c
- return (ticks > 0) ? ticks : 1;
-}
-
-diff -uprN orig/tpm_emulator-0.2/linux_module.h vtpm/linux_module.h
---- orig/tpm_emulator-0.2/linux_module.h 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/linux_module.h 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/linux_module.h vtpm/linux_module.h
+--- orig/tpm_emulator-0.2-x86_64/linux_module.h 2005-09-15 19:21:14.844078720 -0700
++++ vtpm/linux_module.h 2005-09-14 20:27:22.000000000 -0700
@@ -1,5 +1,6 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -416,17 +311,20 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.h vtpm/linux_module.h
+/* module settings */
+#define min(A,B) ((A)<(B)?(A):(B))
+ #ifndef STR
#define STR(s) __STR__(s)
#define __STR__(s) #s
- #include "tpm_version.h"
-@@ -39,32 +45,35 @@
+@@ -39,34 +45,38 @@
+ #define TPM_MODULE_NAME "tpm_emulator"
+
/* debug and log output functions */
++extern int dmi_id;
#ifdef DEBUG
-#define debug(fmt, ...) printk(KERN_DEBUG "%s %s:%d: Debug: " fmt "\n", \
- TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define debug(fmt, ...) printf("%s:%d: Debug: " fmt "\n", \
-+ __FILE__, __LINE__, ## __VA_ARGS__)
++#define debug(fmt, ...) printf("TPMD[%d]: %s:%d: Debug: " fmt "\n", \
++ dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
#else
#define debug(fmt, ...)
#endif
@@ -436,12 +334,12 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.h vtpm/linux_module.h
- TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-#define alert(fmt, ...) printk(KERN_ALERT "%s %s:%d: Alert: " fmt "\n", \
- TPM_MODULE_NAME, __FILE__, __LINE__, ## __VA_ARGS__)
-+#define info(fmt, ...) printf("%s:%d: Info: " fmt "\n", \
-+ __FILE__, __LINE__, ## __VA_ARGS__)
-+#define error(fmt, ...) printf("%s:%d: Error: " fmt "\n", \
-+ __FILE__, __LINE__, ## __VA_ARGS__)
-+#define alert(fmt, ...) printf("%s:%d: Alert: " fmt "\n", \
-+ __FILE__, __LINE__, ## __VA_ARGS__)
++#define info(fmt, ...) printf("TPMD[%d]: %s:%d: Info: " fmt "\n", \
++ dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
++#define error(fmt, ...) printf("TPMD[%d]: %s:%d: Error: " fmt "\n", \
++ dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
++#define alert(fmt, ...) printf("TPMD[%d]: %s:%d: Alert: " fmt "\n", \
++ dmi_id, __FILE__, __LINE__, ## __VA_ARGS__)
/* memory allocation */
@@ -465,7 +363,7 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.h vtpm/linux_module.h
static inline void tpm_get_random_bytes(void *buf, int nbytes)
{
get_random_bytes(buf, nbytes);
-@@ -84,9 +93,9 @@ uint64_t tpm_get_ticks(void);
+@@ -86,9 +96,9 @@ uint64_t tpm_get_ticks(void);
#define CPU_TO_LE16(x) __cpu_to_le16(x)
#define BE64_TO_CPU(x) __be64_to_cpu(x)
@@ -477,9 +375,116 @@ diff -uprN orig/tpm_emulator-0.2/linux_module.h vtpm/linux_module.h
#define BE16_TO_CPU(x) __be16_to_cpu(x)
#define LE16_TO_CPU(x) __le16_to_cpu(x)
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_audit.c vtpm/tpm/tpm_audit.c
---- orig/tpm_emulator-0.2/tpm/tpm_audit.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_audit.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/Makefile vtpm/Makefile
+--- orig/tpm_emulator-0.2-x86_64/Makefile 2005-09-15 19:21:14.845078568 -0700
++++ vtpm/Makefile 2005-09-14 20:27:22.000000000 -0700
+@@ -1,22 +1,31 @@
+ # Software-Based Trusted Platform Module (TPM) Emulator for Linux
+ # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
++# Copyright (C) 2005 INTEL Corp.
+ #
+ # $Id: Makefile 10 2005-04-26 20:59:50Z mast $
+
+-# kernel settings
+-KERNEL_RELEASE := $(shell uname -r)
+-KERNEL_BUILD := /lib/modules/$(KERNEL_RELEASE)/build
+-MOD_SUBDIR := misc
+ COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/)
+
+ # module settings
+-MODULE_NAME := tpm_emulator
++BIN := vtpmd
+ VERSION_MAJOR := 0
+ VERSION_MINOR := 2
+ VERSION_BUILD := $(shell date +"%s")
+
+-# enable/disable DEBUG messages
+-EXTRA_CFLAGS += -DDEBUG -g
++# Installation program and options
++INSTALL = install
++INSTALL_PROG = $(INSTALL) -m0755
++INSTALL_DIR = $(INSTALL) -d -m0755
++
++# Xen tools installation directory
++TOOLS_INSTALL_DIR = $(DESTDIR)/usr/bin
++
++CC := gcc
++CFLAGS += -g -Wall $(INCLUDE) -DDEBUG
++CFLAGS += -I. -Itpm
++
++# Is the simulator running in it's own vm?
++#CFLAGS += -DVTPM_MULTI_VM
+
+ ifeq ($(COMPILE_ARCH),x86_64)
+ LIBDIR = lib64
+@@ -34,38 +43,31 @@ DIRS := . crypto tpm
+ SRCS := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
+ OBJS := $(patsubst %.c, %.o, $(SRCS))
+ SRCS += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
+-DISTSRC := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
+-DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
+
+-obj-m := $(MODULE_NAME).o
+-$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
++obj-m := $(BIN)
++$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
+
+ EXTRA_CFLAGS += -I$(src) -I$(src)/crypto -I$(src)/tpm
+
+ # do not print "Entering directory ..."
+ MAKEFLAGS += --no-print-directory
+
+-all: $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version
+- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
++all: $(BIN)
++
++$(BIN): $(src)/crypto/gmp.h $(src)/crypto/libgmp.a version $(SRCS) $(OBJS)
++ $(CC) $(CFLAGS) $(OBJS) $(src)/crypto/libgmp.a -o $(BIN)
++
++%.o: %.c
++ $(CC) $(CFLAGS) -c $< -o $@
+
+ install:
+- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
+- test -d /var/tpm || mkdir /var/tpm
+- test -c /dev/tpm || mknod /dev/tpm c 10 224
+- chmod 666 /dev/tpm
+- depmod -a
++ $(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)
+
+ clean:
+- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
+- rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
++ rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a $(OBJS)
+
+-dist: $(DISTSRC)
+- rm -rf $(DISTDIR)
+- mkdir $(DISTDIR)
+- cp --parents $(DISTSRC) $(DISTDIR)/
+- rm -f $(DISTDIR)/crypto/gmp.h
+- tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
+- rm -rf $(DISTDIR)
++mrproper: clean
++ rm -f $(BIN) tpm_version.h
+
+ $(src)/crypto/libgmp.a:
+ test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
+diff -uprN orig/tpm_emulator-0.2-x86_64/README vtpm/README
+--- orig/tpm_emulator-0.2-x86_64/README 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/README 2005-09-14 20:27:22.000000000 -0700
+@@ -13,7 +13,8 @@ $Id: README 8 2005-01-25 21:11:45Z jmoli
+ Copyright
+ --------------------------------------------------------------------------
+ Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
+-Institute of Technology (ETH) Zurich.
++ Institute of Technology (ETH) Zurich.
++Copyright (C) 2005 INTEL Corp
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_audit.c vtpm/tpm/tpm_audit.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_audit.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_audit.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -542,9 +547,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_audit.c vtpm/tpm/tpm_audit.c
return TPM_SUCCESS;
}
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_authorization.c vtpm/tpm/tpm_authorization.c
---- orig/tpm_emulator-0.2/tpm/tpm_authorization.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_authorization.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_authorization.c vtpm/tpm/tpm_authorization.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_authorization.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_authorization.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -568,9 +573,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_authorization.c vtpm/tpm/tpm_authorizat
}
-
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
---- orig/tpm_emulator-0.2/tpm/tpm_capability.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_capability.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_capability.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_capability.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -593,9 +598,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_capability.c vtpm/tpm/tpm_capability.c
}
}
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
---- orig/tpm_emulator-0.2/tpm/tpm_cmd_handler.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_cmd_handler.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_cmd_handler.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_cmd_handler.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -658,9 +663,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_cmd_handler.c vtpm/tpm/tpm_cmd_handler.
return 0;
}
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_crypto.c vtpm/tpm/tpm_crypto.c
---- orig/tpm_emulator-0.2/tpm/tpm_crypto.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_crypto.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_crypto.c vtpm/tpm/tpm_crypto.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_crypto.c 2005-09-15 19:21:14.846078416 -0700
++++ vtpm/tpm/tpm_crypto.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -678,14 +683,14 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_crypto.c vtpm/tpm/tpm_crypto.c
memcpy(&buf[30], areaToSign, areaToSignSize);
if (rsa_sign(&key->key, RSA_SSA_PKCS1_SHA1,
buf, areaToSignSize + 30, *sig)) {
-@@ -379,4 +380,3 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
+@@ -383,4 +384,3 @@ TPM_RESULT TPM_CertifyKey2(TPM_KEY_HANDL
}
return TPM_SUCCESS;
}
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_data.c vtpm/tpm/tpm_data.c
---- orig/tpm_emulator-0.2/tpm/tpm_data.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_data.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_data.c vtpm/tpm/tpm_data.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_data.c 2005-09-15 19:21:14.847078264 -0700
++++ vtpm/tpm/tpm_data.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1005,7 +1010,7 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_data.c vtpm/tpm/tpm_data.c
}
#else
-@@ -231,7 +431,6 @@ int tpm_restore_permanent_data(void)
+@@ -232,7 +432,6 @@ int tpm_restore_permanent_data(void)
int tpm_erase_permanent_data(void)
{
@@ -1014,9 +1019,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_data.c vtpm/tpm/tpm_data.c
return res;
}
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_deprecated.c vtpm/tpm/tpm_deprecated.c
---- orig/tpm_emulator-0.2/tpm/tpm_deprecated.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_deprecated.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_deprecated.c vtpm/tpm/tpm_deprecated.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_deprecated.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_deprecated.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1043,9 +1048,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_deprecated.c vtpm/tpm/tpm_deprecated.c
authContextSize, &contextBlob);
if (res != TPM_SUCCESS) return res;
len = *authContextSize;
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_emulator.h vtpm/tpm/tpm_emulator.h
---- orig/tpm_emulator-0.2/tpm/tpm_emulator.h 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_emulator.h 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_emulator.h vtpm/tpm/tpm_emulator.h
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_emulator.h 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_emulator.h 2005-09-14 20:27:22.000000000 -0700
@@ -1,5 +1,6 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1063,9 +1068,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_emulator.h vtpm/tpm/tpm_emulator.h
/**
* tpm_emulator_init - initialises and starts the TPM emulator
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_integrity.c vtpm/tpm/tpm_integrity.c
---- orig/tpm_emulator-0.2/tpm/tpm_integrity.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_integrity.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_integrity.c vtpm/tpm/tpm_integrity.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_integrity.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_integrity.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1079,9 +1084,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_integrity.c vtpm/tpm/tpm_integrity.c
return TPM_SUCCESS;
}
-
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_structures.h vtpm/tpm/tpm_structures.h
---- orig/tpm_emulator-0.2/tpm/tpm_structures.h 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_structures.h 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_structures.h vtpm/tpm/tpm_structures.h
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_structures.h 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_structures.h 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1099,9 +1104,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_structures.h vtpm/tpm/tpm_structures.h
#include "crypto/rsa.h"
/*
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_testing.c vtpm/tpm/tpm_testing.c
---- orig/tpm_emulator-0.2/tpm/tpm_testing.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_testing.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_testing.c vtpm/tpm/tpm_testing.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_testing.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_testing.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1217,9 +1222,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_testing.c vtpm/tpm/tpm_testing.c
rsa_private_key_t priv_key;
rsa_public_key_t pub_key;
-diff -uprN orig/tpm_emulator-0.2/tpm/tpm_ticks.c vtpm/tpm/tpm_ticks.c
---- orig/tpm_emulator-0.2/tpm/tpm_ticks.c 2005-08-17 10:58:36.000000000 -0700
-+++ vtpm/tpm/tpm_ticks.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/tpm_ticks.c vtpm/tpm/tpm_ticks.c
+--- orig/tpm_emulator-0.2-x86_64/tpm/tpm_ticks.c 2005-08-15 00:58:57.000000000 -0700
++++ vtpm/tpm/tpm_ticks.c 2005-09-14 20:27:22.000000000 -0700
@@ -1,6 +1,7 @@
/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
* Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
@@ -1302,9 +1307,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/tpm_ticks.c vtpm/tpm/tpm_ticks.c
}
-diff -uprN orig/tpm_emulator-0.2/tpm/vtpm_manager.h vtpm/tpm/vtpm_manager.h
---- orig/tpm_emulator-0.2/tpm/vtpm_manager.h 1969-12-31 16:00:00.000000000 -0800
-+++ vtpm/tpm/vtpm_manager.h 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpm/vtpm_manager.h vtpm/tpm/vtpm_manager.h
+--- orig/tpm_emulator-0.2-x86_64/tpm/vtpm_manager.h 1969-12-31 16:00:00.000000000 -0800
++++ vtpm/tpm/vtpm_manager.h 2005-09-14 20:27:22.000000000 -0700
@@ -0,0 +1,126 @@
+// ===================================================================
+//
@@ -1432,9 +1437,9 @@ diff -uprN orig/tpm_emulator-0.2/tpm/vtpm_manager.h vtpm/tpm/vtpm_manager.h
+*********************************************************************/
+
+#endif //_VTPM_MANAGER_H_
-diff -uprN orig/tpm_emulator-0.2/tpmd.c vtpm/tpmd.c
---- orig/tpm_emulator-0.2/tpmd.c 1969-12-31 16:00:00.000000000 -0800
-+++ vtpm/tpmd.c 2005-08-17 10:55:52.000000000 -0700
+diff -uprN orig/tpm_emulator-0.2-x86_64/tpmd.c vtpm/tpmd.c
+--- orig/tpm_emulator-0.2-x86_64/tpmd.c 1969-12-31 16:00:00.000000000 -0800
++++ vtpm/tpmd.c 2005-09-15 19:28:55.783005352 -0700
@@ -0,0 +1,207 @@
+/* Software-Based Trusted Platform Module (TPM) Emulator for Linux
+ * Copyright (C) 2005 INTEL Corp
@@ -1468,9 +1473,9 @@ diff -uprN orig/tpm_emulator-0.2/tpmd.c vtpm/tpmd.c
+#else
+ #define GUEST_RX_FIFO_D "/var/vtpm/fifos/guest-to-%d.fifo"
+ #define GUEST_TX_FIFO "/var/vtpm/fifos/guest-from-all.fifo"
++#endif
+
+ int dmi_id;
-+#endif
+
+#define BUFFER_SIZE 2048
+
@@ -1506,7 +1511,7 @@ diff -uprN orig/tpm_emulator-0.2/tpmd.c vtpm/tpmd.c
+{
+ uint8_t in[BUFFER_SIZE], *out, *addressed_out;
+ uint32_t out_size;
-+ int in_size, written ;
++ int in_size, written;
+ int i, guest_id=-1;
+
+ int vtpm_tx_fh=-1, vtpm_rx_fh=-1;
@@ -1602,7 +1607,7 @@ diff -uprN orig/tpm_emulator-0.2/tpmd.c vtpm/tpmd.c
+ written = write(vtpm_tx_fh, ctrl_msg, sizeof(ctrl_msg));
+
+ if (written != sizeof(ctrl_msg)) {
-+ printf("ERROR: Part of response not written %d/%d.\n", written, sizeof(ctrl_msg));
++ printf("ERROR: Part of response not written %d/%Zu.\n", written, sizeof(ctrl_msg));
+ } else {
+ printf("Send Ctrl Message confermation\n");
+ }
@@ -1623,7 +1628,7 @@ diff -uprN orig/tpm_emulator-0.2/tpmd.c vtpm/tpmd.c
+ printf("%x ", addressed_out[i]);
+ printf("\n");
+ } else {
-+ printf("Sent[%d]: ", out_size + sizeof(uint32_t));
++ printf("Sent[%Zu]: ", out_size + sizeof(uint32_t));
+ for (i=0; i< out_size+ sizeof(uint32_t); i++)
+ printf("%x ", addressed_out[i]);
+ printf("\n");