The IAIK/OpenTC jTpmTools are a set of command line tools demonstrating basic
interaction with the Trusted Platform Module (TPM) and the
Trusted Software Stack (TSS).
This includes tools for taking/clearing ownership and reading/extending PCRs.
Further, a command demonstrating creating Attestation Identity Keys (AIKs)
is included.
Development of the IAIK/OpenTC jTpmTools is supported by the European Commission
as part of the OpenTC project (Ref. Nr. 027635). For more information
about the OpenTC project please refer to the OpenTC Project
section below.
The IAIK/OpenTC jTpmTools package is developed and maintained at the Institute
for Applied Information Processing and Communication (Institut fuer
Angewandte Informationsverarbeitung und Kommunikation,
IAIK), at Graz University of Technology (TU Graz).
1.1. OpenTC Project
The Open Trusted Computing (OpenTC) consortium is an R&D project
focusing on the development of trusted and secure computing systems
based on open source software. The project targets traditional computer
platforms as well as embedded systems such as mobile phones.
The goal of OpenTC is to reduce system-related threats, errors and
malfunctions. The lack of platform security in today's computers has
given rise to waves of successful attacks, resulting in severe damages
to enterprises and potential failure of critical infrastructures.
The OpenTC consortium will define and implement an open Trusted
Computing framework. The architecture is based on security mechanisms
provided by low level operating system layers with isolation properties
and interfaces to Trusted Computing hardware. These layers make it
possible to leverage enhanced trust and security properties of the
platform for standard operating systems, middleware, and applications.
For more information about the OpenTC project please refer to the
OpenTC website.
1.2. A Word of Caution
Please note that all certificates created using the PKI commands
are intended to be used for testing and experimentation purposes
only. Moreover it has to be stressed that this is experimental software.
Its main purpose currently is research and education.
1.3. License
The copyright for contents of the IAIK/OpenTC jTpmTools package, including all
related documentation, is owned by IAIK,
Graz University of Technology (TU Graz).
jTpmTools is using a dual licensing model:
-
For Open Source development, IAIK/OpenTC jTpmTools is licensed under
the terms of the GNU GPL version 2. The full text of the GNU GPL v2
is shipped with the product or can be found online at the
Free Software Foundation website.
-
In all other cases, the "Stiftung SIC Java Crypto-Software
Development Kit Licence Agreement" applies. The full license
text can be found online at SICLIC.
For pricing and further information please contact jce-sales@iaik.at.
The following sections outline requirements, commands and usage
examples for jTpmTools.
2.1. Requirements
jTpmTools require hardware as well as software support components
to achieve full functionality. For some of the components there are several
options. This section lists these options and provides some background
information that helps to pick a suitable component.
Naturally, a hardware TPM or a TPM emulator is a "must" requirement. Additionally,
administrative (i.e. root) permissions are usually required to directly access
the TPM device.
2.1.1. Java
To use the jTpmTools you need to have a Sun Java (tm) Environment
of version 5 or later. Earlier Java versions do not provide the
required cryptographic functionality. Compatibility with other Java vendors
is unknown and untested.
2.1.2. TSS
All commands require a TCG compliant Trusted Software Stack (TSS) to be running
on the system. There are two options to choose from:
IAIK jTSS:
IAIK jTSS provides the toplevel Java TSP interfaces as well as a
full TSS core implementation completely written in Java.
It therefore has modest external requirements and may be the easiest to set up.
To make use of IAIK jTSS the two libraries iaik_jtss_tcs.jar and
iaik_jtss_tsp.jar have to be copied into the ext_libs subfolder.
IAIK jTSS can be downloaded from Trusted Java.
IAIK/OpenTC jTSS Wrapper:
Alternatively, you can also use the IAIK/OpenTC jTSS Wrapper
as an add-on to the IAIK jTSS. In this combination all calls to the
TPM are routed via Java native interface (JNI) calls to the TrouSerS C level
implementation.
jTpmTools originated in the IAIK/OpenTC jTSS Wrapper code which means
that both have almost the same basic requirements. For a detailed list of
requirements please consult the requirements of IAIK/OpenTC jTSS Wrapper
(available at Trusted Java).
The jTpmTools expect the additional IAIK/OpenTC jTSS Wrapper libraries to
be located in the ext_libs subfolder.
jTpmTools requires a IAIK/OpenTC jTSS Wrapper of the 0.3.x series,
the 0.2.x series is not compatible!
If a running TrouSerS process is detected on your system, the jTpmTools
will try to use TrouSerS together with the IAIK/OpenTC jTSS Wrapper. If no
running TrouSerS is available the pure IAIK jTSS variant will be used.
2.1.3. Libraries
IAIK/OpenTC TCcert:
For certificate related operations, IAIK/OpenTC TCcert is required.
It can be downloaded from Trusted Java. The package includes a readme
file with further details. This library also requires the IAIK JCE
library. How to obtain it is described in the readme of the
IAIK/OpenTC TCcert. Certificate related commands expect the
IAIK/OpenTC TCcert libraries as well as the IAIK JCE
libraries to be located in the ext_libs subfolder.
2.1.4. Summary
As reference, for maximum functionality of jTpmTools
the content of the ext_libs directory should be:
-
jTSS
-
ext_libs/iaik_jtss_tsp.jar
ext_libs/iaik_jtss_tcs.jar
-
JTss Wrapper
-
ext_libs/iaik_jtss_wrapper.jar
ext_libs/iaik_jtss_wrapper_swig.jar
ext_libs/libtspiwrapper.so
-
IAIK JCE
-
ext_libs/iaik_jce.jar
-
IAIK TCcert
-
ext_libs/iaik_tccert.jar
2.2. Command Overview
This build of jTpmTools offers the following operations:
2.3. Usage
There is no special installation procedure required to use the
IAIK/OpenTC jTpmTools. After unpacking the archive, the only precondition is
that the required libraries are obtained and placed in the ext_libs
folder (see Requirements section).
The main executables (jtt.sh) is located in the main folder. To get an
overview of the individual sub-commands simply call jtt.sh without
passing any further arguments. A list of available sub-commands is
printed to the screen. To get an overview of the parameters that can be
passed to a sub-command simply type jtt.sh <sub-command>.
|
Note:
|
If you already took ownership on your TPM with another tool you can
load your SRK to jTSS's persistent storage by simply calling the take_owner
command. In this case the take_owner command won't alter your TPM's owner state
but read out the public part of the SRK and store it to persistent storage.
|
2.3.1. Example
By means of the aik_create sub-command, which is one of the more
sophisticated ones, a call example is shown in more detail:
The aik_create command offers the following switches:
required parameters:
-a aikSecret ... password for the new AIK
-l aikLabel ... AIK label
-o ownerSecret ... TPM owner password
optional parameters:
--aikfile aikFileName ... name file to write AIK certificate to (default: aik.cert)
--ekfile filename ... specify file to import EK certificate from
--keyfile keyFileName ... name file to write the AIK key blob to (default: aik.tpmkey)
--noek ... EK certificate is already known by TSS (e.g. via tcsd.conf
of TrouSerS)
-e encoding ... encoding for password strings (legal values: ASCII, UTF-16,
UTF-16BE, UTF-16LE) (default: UTF-16LE)
-n ... append null termination to password strings
-s srkSecret ... SRK password (default: TSS_WELL_KNOWN_SECRET)
-
aikSecret is the password that protects the new AIK key pair
-
aikLabel can be freely chosen and helps users to identify a specific AIK
-
ownerSecret is the TPM owner password
-
aikFile allows users to select the file name the AIK certificate is written to
-
ekFile allows to externally provide the EK certificate. By default, the aik_create command
tries to read the EK certificate directly from the TPM chip (IFX TPMs).
-
noek instructs the aik_create command to neither read the EK certificate from the
TPM nor to expect the EK to be supplied as an external file. This is useful if the EK
certificate is managed by the underlying TSS stack (e.g. TrouSerS via its tcsd.conf).
-
The e and n parameters allow to configure the password encoding and null termination.
-
The s option allows to set SRK passwords other than TSS_WELL_KNOWN_SECRET.
2.3.2. Commands for TXT and TBoot setup
jTpmTools comes with a set of commands to manage the NV storage of the TPM.
This allows to create and write policies for Intel Trusted eXecution Technology (TXT)
enabled machines and for the Trusted Boot (TBoot) tool.
These commands are EXPERIMENTAL!
These commands MAY PERMANENTLY DAMAGE YOUR HARDWARE!
Use of these commands is AT YOUR OWN RISK - so don't blame us if you brick your hardware!
The following example calls show approximately how to setup TXT with TBoot.
Modify according to your setup and your specific TPM. Study the specifications first!
If your TPM is already locked, you can't do/need steps 1 and 2.
-
define defined spaces in NV RAM
-
Intel TXT INDEX_LCP_DEF
./jtt.sh nv_definespace --index 0x50000001 --size 34 --permission 0x00002000 -o password
|
Note:
|
This permission is TPM_NV_PER_WRITEDEFINE (see TPM_NV_ATTRIBUTES datastructure in TPM specification as reference)
|
|
Note:
|
The size is the default size of a LCP
|
-
Intel TXT INDEX_AUX
./jtt.sh nv_definespace --index 0x50000002 --size 64 --permission 0x0 --writelocality 3,4 -o password
|
Note:
|
Write protection is established by restricting localities, not by setting a permission
|
-
lock TPM
|
Note:
|
This will PERMANENTLY set the lock of your TPM NV storage
|
-
define spaces in NV RAM
-
tboot launch error index
./jtt.sh nv_definespace --index 0x20000002 --size 8 --permission 0x0 --readlocality 0x07 --writelocality 0x07 -o password
-
Intel TXT INDEX_LCP_OWN
./jtt.sh nv_definespace --index 0x40000001 --size 34 -o password
-
tboot's Verified Launch Policy
./jtt.sh nv_definespace --index 0x20000001 --size 256 -o password
-
create policies
-
LCP
./jtt.sh txt_policy --file lcp.pol --mle /boot/tboot.gz --type hashonly --mle-cmd 'logging=serial,vga,memory'
-
VLP
./jtt.sh tboot_policy --create --type halt --file vl.pol
./jtt.sh tboot_policy --add --num 0 --pcr none --hash image --cmdline [KERNEL COMMANDLINE] \
--image [KERNEL IMAGE] --file vl.pol
./jtt.sh tboot_policy --add --num 1 --pcr 19 --hash image --cmdline '' --image [INITRD] --file vl.pol
./jtt.sh tboot_policy --add --num 2 --pcr none --hash any --file vl.pol
-
write policies to NV RAM
-
If you have done step 1, you have to create default LCP too and write it to index 0x50000001
-
write user's LCP
./jtt.sh nv_write --index 0x40000001 --file lcp.pol -o password
-
write VLP
./jtt.sh nv_write --index 0x20000001 --file vl.pol -o password
For questions, bug reports, feature requests, patches, criticism or
suggestions please use the following mailing list: trustedjava-support@lists.sourceforge.net.
Java (tm) and all Java based marks are a trademark or registered
trademark of Sun Microsystems, Inc, in the United States and other countries.
All other trademarks and copyrights are property of their respective owners.