Semi-Automated Prototyping of a TPM v2 Software and Hardware Simulation ... - TRUST 2013 ·...
Transcript of Semi-Automated Prototyping of a TPM v2 Software and Hardware Simulation ... - TRUST 2013 ·...
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
1
TRUST'13 17.Jun.2013
Semi-Automated Prototyping of aTPM v2 Software and Hardware
Simulation Platform
Martin Pirker, Johannes Winter
{mpirker,jwinter}@iaik.tugraz.at
Institute for Applied Information Processing and Communications (IAIK),Graz University of Technology, Austria
rev 20130628, non-interactive
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
2
TRUST'13 17.Jun.2013
2
Trusted Platform Module
Feb'02 TPM v1.1b specification
Oct'03 TPM v1.2 rev. 62
Mar'11 TPM v1.2 rev. 116
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
3
TRUST'13 17.Jun.2013
3
Trusted Software Stack
2 full open-source implementations of TSS specs
TrouSerS / C http://trousers.sourceforge.net/
jTSS / Java http://trustedjava.sourceforge.net/
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
4
TRUST'13 17.Jun.2013
4
jTSS
Developed / started by IAIK within EU OpenTC project
100% Java implementation of every TSS detail
Manual work
Tried automation of implementation process...but gave up on it
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
5
TRUST'13 17.Jun.2013
5
Oct'12
TPM v2first publicdraft
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
6
TRUST'13 17.Jun.2013
6
v2 Specification Promise
“The information in this document is formatted so thatit may be converted to standard computer-language formats by an automated process. The purpose ofthis automated process is to minimize the transcription errors that often occur during the conversion process […]In addition, the conventions and notations in thisclause describe the representation of various dataso that it is both human readable and amenable to automated processing.”
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
7
TRUST'13 17.Jun.2013
7
Specification Text Extraction
*.PDF files, ~1400 pages TPM v2 spec
… run through Libreoffice PDF import ...
→ *.FODG files OpenDocument Graphics (XML based)
… run through custom script ...
→ raw text fragments[x,y,style,text], [x,y,style,text], ...
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
8
TRUST'13 17.Jun.2013
8
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
9
TRUST'13 17.Jun.2013
9
Spec Parts
Part 2Data structures
Part 3Commands
Part 4Support / Runtime environment
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
10
TRUST'13 17.Jun.2013
10
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
11
TRUST'13 17.Jun.2013
11
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
12
TRUST'13 17.Jun.2013
12
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
13
TRUST'13 17.Jun.2013
13
Script Run
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
14
TRUST'13 17.Jun.2013
14
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
15
TRUST'13 17.Jun.2013
15
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
16
TRUST'13 17.Jun.2013
16
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
17
TRUST'13 17.Jun.2013
17
Towards a TPM v2 Simulator
write Makefile / OpenSSL inclusion remove winsock.h / windows.h references socket interface instead of RPC
remove MS-stuff, e.g. fopen_s CFLAGS += -std=C99 -pedantic case sensitive header includes (e.g. Tpm.h vs tpm.h) duplicate / inconsistent s_NvIsAvailable declaration startup / init / self-test code … … ...
→ and obtain a Linux build :-)
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
18
TRUST'13 17.Jun.2013
18
Hardware TPM v2
TPM v2 in software is nice.... and as hardware?
Idea: run SW Simulator on FGPA platform
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
19
TRUST'13 17.Jun.2013
19
Hardware TPM v2
Xilinx XC3S700ANN FGPA board
32-bit Xilinx MicroBlaze soft-core processor
I2C+LPC bus slave controllers
open-source lwIP TCP/IP stack
stripped OpenSSL cryptography
..…fits just in on-chip flash (8Mbit) of FPGA (FPGA bitstream + bootloader + TPM simulator code)
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
20
TRUST'13 17.Jun.2013
20
Net
Power
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
21
TRUST'13 17.Jun.2013
21
Net USB/JTAGPower
LPCSerial
I2C
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
22
TRUST'13 17.Jun.2013
22
SerialConsole
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
23
TRUST'13 17.Jun.2013
23
“Hello World”
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
24
TRUST'13 17.Jun.2013
24
TPM v2 in-system Simulation
Done JTAG debugging of FPGA TPM I2C interface for embedded (e.g. for Arduino) Network interface (similar to IBM SW TPM v1.2)
Ongoing FPGA LPC interface based on previous work, FPGA side
handling of TIS protocol work-in-progress
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
25
TRUST'13 17.Jun.2013
25
Lessons Learned
Is the TPM v2 spec suited for automated processing?Yes, better than v1.2
Is it possible to synthesize a TPM simulator from it?Yes, but quite some work to create/generate missing code
Can we use a SW simulator to fake a HW TPM v2?Port to FPGA board, work-in-progress...
Outlook Cleanup, debug, document… someone with a TSS v2... ? :-)
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
26
TRUST'13 17.Jun.2013
26
Credits
Martin Pirker ([email protected]) Spec parser, extractor, code generation
Johannes Winter ([email protected]) FPGA port
Paper:Proceedings of 6th International Conference onTrust & Trustworthy Computing (TRUST 2013),17-19 Jun 2013, London, UK; LNCS 7904, Springerhttp://trust2013.sba-research.org/
Institute for Applied Information Processing and Communications (IAIK)Secure and Correct Systems Group (SCoS) – Graz University of Technology (TUG)
27
TRUST'13 17.Jun.2013
27
INTRUST'13 conference
5/6 Dec 2013 – Graz, Austria
CFP: 8.Jul !
intrust13.iaik.tugraz.at