ia64/xen-unstable

view tools/vtpm/tpm_emulator.patch @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children c0796e18b6a4 f8e7af29daa1
line source
1 diff -uprN orig/tpm_emulator-0.2/AUTHORS tpm_emulator-0.2/AUTHORS
2 --- orig/tpm_emulator-0.2/AUTHORS 2005-08-17 10:58:36.000000000 -0700
3 +++ tpm_emulator-0.2/AUTHORS 2005-08-17 10:55:52.000000000 -0700
4 @@ -1 +1,2 @@
5 Mario Strasser <mast@gmx.net>
6 +INTEL Corp <>
7 diff -uprN orig/tpm_emulator-0.2/ChangeLog tpm_emulator-0.2/ChangeLog
8 --- orig/tpm_emulator-0.2/ChangeLog 2005-08-17 10:58:36.000000000 -0700
9 +++ tpm_emulator-0.2/ChangeLog 2005-08-17 10:55:52.000000000 -0700
10 @@ -1,3 +1,7 @@
11 +2005-08-16: INTEL Corp
12 + * Set default permissions to PCRs
13 + * Changed device to /dev/tpm0
14 +
15 2005-08-15 Mario Strasser <mast@gmx.net>
16 * all: some typos corrected
17 * tpm_integrity.c: bug in TPM_Extend fixed
18 diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
19 --- orig/tpm_emulator-0.2/Makefile 2005-08-17 10:58:36.000000000 -0700
20 +++ tpm_emulator-0.2/Makefile 2005-08-17 10:55:52.000000000 -0700
21 @@ -1,15 +1,19 @@
22 # Software-Based Trusted Platform Module (TPM) Emulator for Linux
23 # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
24 +# Copyright (C) 2005 INTEL Corp.
25 #
26 # $Id: Makefile 10 2005-04-26 20:59:50Z mast $
28 +XEN_ROOT := ../../..
29 +EUID := $(shell id -u)
30 +
31 # kernel settings
32 KERNEL_RELEASE := $(shell uname -r)
33 -KERNEL_BUILD := /lib/modules/$(KERNEL_RELEASE)/build
34 +KERNEL_BUILD := $(XEN_ROOT)/linux-2.6.12-xen0
35 MOD_SUBDIR := misc
37 # module settings
38 -MODULE_NAME := tpm_emulator
39 +BIN := tpm_emulator
40 VERSION_MAJOR := 0
41 VERSION_MINOR := 2
42 VERSION_BUILD := $(shell date +"%s")
43 @@ -27,11 +30,9 @@ DIRS := . crypto tpm
44 SRCS := $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.c))
45 OBJS := $(patsubst %.c, %.o, $(SRCS))
46 SRCS += $(foreach dir, $(DIRS), $(wildcard $(src)/$(dir)/*.h))
47 -DISTSRC := ./README ./AUTHORS ./ChangeLog ./Makefile $(SRCS)
48 -DISTDIR := tpm_emulator-$(VERSION_MAJOR).$(VERSION_MINOR)
50 -obj-m := $(MODULE_NAME).o
51 -$(MODULE_NAME)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
52 +obj-m := $(BIN).o
53 +$(BIN)-objs := $(patsubst $(src)/%.o, %.o, $(OBJS)) crypto/libgmp.a
55 EXTRA_CFLAGS += -I$(src) -I$(src)/crypto -I$(src)/tpm
57 @@ -42,23 +43,17 @@ all: $(src)/crypto/gmp.h $(src)/crypto/l
58 @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
60 install:
61 - @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules_install
62 - test -d /var/tpm || mkdir /var/tpm
63 - test -c /dev/tpm || mknod /dev/tpm c 10 224
64 - chmod 666 /dev/tpm
65 - depmod -a
66 + @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) INSTALL_MOD_PATH=$(DESTDIR) modules_install
67 + test -d $(DESTDIR)/var/tpm || mkdir $(DESTDIR)/var/tpm
68 + test -d $(DESTDIR)/dev || mkdir $(DESTDIR)/dev
69 + test -c $(DESTDIR)/dev/tpm0 || [ $(EUID) -ne 0 ] || mknod $(DESTDIR)/dev/tpm0 c 10 224
70 + [ $(EUID) -ne 0 ] || chmod 666 $(DESTDIR)/dev/tpm0
72 clean:
73 @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean
74 rm -f $(src)/crypto/gmp.h $(src)/crypto/libgmp.a
76 -dist: $(DISTSRC)
77 - rm -rf $(DISTDIR)
78 - mkdir $(DISTDIR)
79 - cp --parents $(DISTSRC) $(DISTDIR)/
80 - rm -f $(DISTDIR)/crypto/gmp.h
81 - tar -chzf $(DISTDIR).tar.gz $(DISTDIR)
82 - rm -rf $(DISTDIR)
83 +mrproper: clean
85 $(src)/crypto/libgmp.a:
86 test -f $(src)/crypto/libgmp.a || ln -s $(GMP_LIB) $(src)/crypto/libgmp.a
87 diff -uprN orig/tpm_emulator-0.2/README tpm_emulator-0.2/README
88 --- orig/tpm_emulator-0.2/README 2005-08-17 10:58:36.000000000 -0700
89 +++ tpm_emulator-0.2/README 2005-08-17 10:55:52.000000000 -0700
90 @@ -13,7 +13,8 @@ $Id: README 8 2005-01-25 21:11:45Z jmoli
91 Copyright
92 --------------------------------------------------------------------------
93 Copyright (C) 2004 Mario Strasser <mast@gmx.net> and Swiss Federal
94 -Institute of Technology (ETH) Zurich.
95 + Institute of Technology (ETH) Zurich.
96 +Copyright (C) 2005
98 This program is free software; you can redistribute it and/or modify
99 it under the terms of the GNU General Public License as published by
100 diff -uprN orig/tpm_emulator-0.2/linux_module.h tpm_emulator-0.2/linux_module.h
101 --- orig/tpm_emulator-0.2/linux_module.h 2005-08-17 10:58:36.000000000 -0700
102 +++ tpm_emulator-0.2/linux_module.h 2005-08-17 10:55:52.000000000 -0700
103 @@ -1,5 +1,6 @@
104 /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
105 * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
106 + * Copyright (C) 2005 INTEL Corp.
107 *
108 * This module is free software; you can redistribute it and/or modify
109 * it under the terms of the GNU General Public License as published
110 @@ -33,7 +34,7 @@
111 #include "tpm_version.h"
113 #define TPM_DEVICE_MINOR 224
114 -#define TPM_DEVICE_NAME "tpm"
115 +#define TPM_DEVICE_NAME "tpm0"
116 #define TPM_MODULE_NAME "tpm_emulator"
118 /* debug and log output functions */
119 diff -uprN orig/tpm_emulator-0.2/tpm/tpm_data.c tpm_emulator-0.2/tpm/tpm_data.c
120 --- orig/tpm_emulator-0.2/tpm/tpm_data.c 2005-08-17 10:58:36.000000000 -0700
121 +++ tpm_emulator-0.2/tpm/tpm_data.c 2005-08-17 10:55:52.000000000 -0700
122 @@ -1,6 +1,7 @@
123 /* Software-Based Trusted Platform Module (TPM) Emulator for Linux
124 * Copyright (C) 2004 Mario Strasser <mast@gmx.net>,
125 * Swiss Federal Institute of Technology (ETH) Zurich
126 + * Copyright (C) 2005 INTEL Corp
127 *
128 * This module is free software; you can redistribute it and/or modify
129 * it under the terms of the GNU General Public License as published
130 @@ -85,6 +86,11 @@ void tpm_init_data(void)
131 tpmData.permanent.data.version.revMinor = VERSION_MINOR;
132 /* setup PCR attributes */
133 for (i = 0; i < TPM_NUM_PCR; i++) {
134 + int j;
135 + for (j=0; j < TPM_NUM_LOCALITY; j++) {
136 + tpmData.permanent.data.pcrAttrib[i].pcrExtendLocal[j] = TRUE;
137 + }
138 +
139 tpmData.permanent.data.pcrAttrib[i].pcrReset = TRUE;
140 }
141 /* set tick type */
142 diff -uprN orig/tpm_emulator-0.2/tpm_version.h tpm_emulator-0.2/tpm_version.h
143 --- orig/tpm_emulator-0.2/tpm_version.h 2005-08-17 10:58:36.000000000 -0700
144 +++ tpm_emulator-0.2/tpm_version.h 2005-08-17 10:55:53.000000000 -0700
145 @@ -2,5 +2,5 @@
146 #define _TPM_VERSION_H_
147 #define VERSION_MAJOR 0
148 #define VERSION_MINOR 2
149 -#define VERSION_BUILD 1123950310
150 +#define VERSION_BUILD 1124301353
151 #endif /* _TPM_VERSION_H_ */