• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

crypto/H03-May-2022-1,5131,039

mtm/H03-May-2022-1,9401,286

tddl/H03-May-2022-792508

tpm/H03-May-2022-26,40219,476

tpmd/H03-May-2022-796689

tpmd_dev/H03-May-2022-1,6151,244

AUTHORSH A D20-Dec-201167 32

ChangeLogH A D20-Dec-201116.6 KiB601360

READMEH A D20-Dec-20117.7 KiB209159

build.batH A D20-Dec-2011353 1610

build.shH A D20-Dec-2011204 2012

config.h.inH A D20-Dec-20111.1 KiB3428

README

1 _____ ____  __  __           _____                 _       _
2|_   _|  _ \|  \/  |         | ____|_ __ ___  _   _| | __ _| |_ ___  _ __
3  | | | |_) | |\/| |  _____  |  _| | '_ ` _ \| | | | |/ _` | __/ _ \| '__|
4  | | |  __/| |  | | |_____| | |___| | | | | | |_| | | (_| | || (_) | |
5  |_| |_|   |_|  |_|         |_____|_| |_| |_|\__,_|_|\__,_|\__\___/|_|
6
7 TPM-Emulator v0.7 -
8 A Software-based TPM and MTM Emulator.
9--------------------------------------------------------------------------
10
11Copyright
12--------------------------------------------------------------------------
13Copyright (C) 2009-2011 Mario Strasser.
14Copyright (C) 2004-2009 Mario Strasser, ETH Zurich.
15
16
17This program is free software; you can redistribute it and/or modify
18it under the terms of the GNU General Public License as published by
19the Free Software Foundation; either version 2 of the License, or
20(at your option) any later version.
21
22This program is distributed in the hope that it will be useful,
23but WITHOUT ANY WARRANTY; without even the implied warranty of
24MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25GNU General Public License for more details.
26
27
28Package
29--------------------------------------------------------------------------
30The tpm emulator package comprises four main parts:
31
32a) tpmd - a user-space application that implements the actual emulator
33   and can be accessed by means of Unix domain sockets (Unix) or
34   named pipes (Windows).
35
36b) tpmd_dev - a kernel module that provides the device /dev/tpm for
37   backward compatibility and forwards the received commands to tpmd
38   (Unix and Mac OS X only).
39
40c) tddl - a TSS conform device driver library for the emulator.
41
42
43Compilation and Installation
44--------------------------------------------------------------------------
45The compilation and installation of the TPM emulator package is based on
46the CMake build environment (version 2.6 or better) and requires that the
47GNU MP library (version 4.0 or better) is properly installed on your
48system. A working MinGW compiler suite is further required on Windows
49(see http://www.mingw.org/). To compile and install the package execute:
50
51# tar -xvzf tpm_emulator-X.Y.tar.gz
52# cd tpm_emulator-X.Y
53# mkdir build
54# cd build
55# cmake ../
56# make
57# make install
58
59The script files build.sh and build.bat automate the compliation process.
60
61On Windows, the TPM emulator system service has additionally to be
62registered by calling:
63# control_tpmd.bat install
64
65MTM support can be enabled by replacing
66# cmake ../
67with
68# cmake ../ -DMTM_EMULATOR=ON
69
70
71Startup
72--------------------------------------------------------------------------
73In order to use the TPM emulator on Unix or Mac OS X, one has to start the
74TPM emulator daemon and load the TPM device forwarding module. On Linux,
75this is done by executing:
76
77# modprobe tpmd_dev
78# tpmd
79
80On Windows, the TPM emulator service can either be started with the
81Microsoft Management Console or with the control_tpmd.bat script:
82
83# control_tpmd.bat start
84# control_tpmd.bat status
85
86The startup mode of the TPM (see TPM Spec. Part 1) is defined by the
87startup mode argument and can either be set to clear, save (default)
88or deactivated. Additionally supported arguments are
89
90usage: tpmd [-d] [-f] [-s storage file] [-u unix socket name]
91            [-o user name] [-g group name] [-h] [startup mode]
92  d : enable debug mode
93  f : forces the application to run in the foreground
94  s : storage file to use (default: /var/lib/tpm/tpm_emulator-1_2_0_7)
95  u : unix socket name to use (default: /var/run/tpm/tpmd_socket:0)
96  o : effective user the application should run as
97  g : effective group the application should run as
98  h : print this help message
99  startup mode : must be 'clear', 'save' (default) or 'deactivated
100
101and
102
103usage: tpmd.exe [-d] [-f] [-s storage file] [-u windows pipe name]
104                [-l log file] [-h] [startup mode]
105  d : enable debug mode
106  f : forces the application to run in the foreground
107  s : storage file to use (default:
108      C:/Program Files/TPM_Emulator/tpm_emulator-1_2_0_7)
109  u : windows named pipe name to use (default: //./pipe/tpmd:0)
110  l : name of the log file (default: C:/Program Files/TPM_Emulator/tpmd.log)
111  h : print this help message
112  startup mode : must be 'clear', 'save' (default) or 'deactivated
113
114on Unix and Windows, respectively.
115
116If the emulator is started in mode save and fails to load a previously
117stored TPM state, it will go into fail-stop mode and has to be reloaded.
118Therefore, the first time the TPM emulator is started, the argument must
119be set to 'clear'. Recovering a TPM emulator that is in fail-stop mode
120is done by first deactivating it and then reloading it in mode 'clear':
121
122# tpmd deactivated
123# killall tpmd
124# tpmd clear
125
126
127Usage and Backward Compatibility
128--------------------------------------------------------------------------
129The most correct and convenient way to access the tpm emulator is to use
130the provided device driver library (tddl). For a comprehensive description
131of its functionality we refer to the official TCG specification (see
132https://www.trustedcomputinggroup.org/specs/TSS), an example of use is
133given by the test application tddl/test_tddl.
134
135Note that on Windows the tddl is called ifxtpm.dll as many applications
136(e.g., TPM/J) expect this name and do not support alternative drivers.
137
138For backward compatibility with existing Unix applications, the kernel
139module tpmd_dev forwards any command sent to the device /dev/tpm to the
140tpm emulator daemon. In order to access the emulator directly (i.e.,
141without using the device driver library or the device dev/tpm) all one
142has to do is to include the header files sys/socket.h and sys/un.h and
143to replace the open("/dev/tpm") call with something like:
144
145struct sockaddr_un addr;
146fh = socket(PF_UNIX, SOCK_STREAM, 0);
147if (fh < 0) { /* handle error */ }
148addr.sun_family = AF_UNIX;
149strncpy(addr.sun_path, "/var/run/tpm/tpmd_socket:0", sizeof(addr.sun_path));
150res = connect(fh, (struct sockaddr*)&addr, sizeof(struct sockaddr_un));
151if (res < 0) { /* handle error */ }
152
153All subsequent calls of read(), write(), and close() should work as
154expected.
155
156
157Usage Examples for TPM/J
158--------------------------------------------------------------------------
159
160=== Linux
161# modprobe tpmd_dev
162# tpmd -d
163
164# cd <path to tpmj>/lib
165# export CLASSPATH=tpmj.jar:bcprov-jdk15-131.jar:$CLASSPATH
166# java edu.mit.csail.tpmj.tools.TPMInfo
167
168
169=== Mac OS X
170# sudo kextload /System/Library/Extensions/tpm_bridge.kext
171# sudo tpmd -d
172
173# cd <path to tpmj>/lib
174# export CLASSPATH=tpmj.jar:bcprov-jdk15-131.jar:$CLASSPATH
175# sudo java edu.mit.csail.tpmj.tools.TPMInfo
176
177
178=== Windows
179# set PATH=%PROGRAMFILES%\TPM_Emulator;%PATH%
180# set PATH=%PROGRAMFILES%\TPM_Emulator\lib;%PATH%
181# control_tpmd.bat start
182
183# cd <path to tpmj>\lib
184# set CLASSPATH=tpmj.jar;bcprov-jdk15-131.jar:%CLASSPATH%
185# java edu.mit.csail.tpmj.tools.TPMInfo
186
187
188Notes
189--------------------------------------------------------------------------
190* Since release 0.7 the emulator also runs on Darwin (Mac OS X) and on
191  Windows; thanks go to Amit Singh and Domenic Schröder. In addition,
192  the emulator now also supports MTM emulation; thanks go to Jan-Erik
193  Ekberg and Markku Kylänpää from Nokia.
194* Since release 0.5.1 the emulator supports Free- and OpenBSD; thanks go
195  to Sebastian Schuetz.
196* Since release 0.5 the kernel-based emulator (tpm_dev) is obsolete.
197* The name and format of the persistent-storage file has changed between
198  release 0.2 and 0.3, 0.4 and 0.4.1., 0.5 and 0.6, and 0.6 and 0.7.
199* The DAA support was tested with the IBM DAA Test Suite and should work
200  now as expected. Thanks go to Roger Zimmermann for his kindly help.
201
202
203Contact
204--------------------------------------------------------------------------
205Any comments, suggestions and bug reports are welcome. Please, mention
206the keyword 'TPM emulator' in the subject.
207Mario Strasser <mast@gmx.net>
208
209