Tags

This post is written with the help of Henry Kironde.

Most systems these days have the Tpm build on the motherboard. However, it is not usually enabled by default. Therefore, we need to enable the TPM in the BOIS.

For that do the following, as the system starts:

1) Press F2 >> Security >> TPM >>activate

Then, reboot your system

2) Check to see if the models are supported:

ls -la /lib/modules/`uname -r`/kernel/drivers/char/tpm

drwxr-xr-x 2 root root  4096 Aug  8 10:32 .

drwxr-xr-x 8 root root  4096 Aug  8 10:32 ..

-rw-r–r– 1 root root 12852 Jul 14 23:31 tpm_atmel.ko

-rw-r–r– 1 root root 18708 Jul 14 23:31 tpm_i2c_infineon.ko

-rw-r–r– 1 root root 25468 Jul 14 23:31 tpm_infineon.ko

-rw-r–r– 1 root root 14100 Jul 14 23:31 tpm_nsc.ko

-rw-r–r– 1 root root 30948 Jul 14 23:31 tpm_tis.ko


3) To enable the modules for  TPM use the following command.

modprobe tpm_tis.ko

modprobe tpm_bios

modprobe tpm

4) Use the following to see if the models have been loaded

dmesg | grep -i tpm

Communicating with the TPM

1) Download trousers and install it. Use root so that you eliminate most of the installation problems.

sudo apt-get update

sudo apt-get install aptitude

aptitude install trousers tpm-tools


2) Start Trousers:

/etc/intit.d/trousers

root@ubuntu:/home/amini# /etc/init.d/trousers start

You should see this response:

* Starting Trusted Computing daemon tcsd                                [ OK ]

you will be notified if it fails( fail meaning that the daemon is not started)

Once the TPM is enabled, boot of the system creates a /dev/tpm0 device file.

3) Read the TPM version

amini:~$ tpm_version

This is the output on my machine:

TPM 1.2 Version Info:

Chip Version:        1.2.3.91

Spec Level:          2

Errata Revision:     3

TPM Vendor ID:       WEC

TPM Version:         01010000

Manufacturer Info:   57454300

4) Take ownership of the TPM

$tpm_takeownership

 

5) Read PCR values :

cat /sys/class/misc/tpm0/device/pcrs

PCR-00: AD B5 A1 6B F5 42 CA 9D 0F EA 7A 60 94 81 53 F8 E0 42 E6 B6

PCR-01: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75

PCR-02: 0E AA F8 1E 92 C7 84 F9 9C BB C1 D3 72 12 9D DD DA 30 6E 5A

PCR-03: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75

PCR-04: 47 0E D4 44 DE 46 2C FC 17 5E 3C 68 8D 79 A3 2B 97 30 DF 13

PCR-05: 81 96 5F 15 B0 6D 54 56 18 FA E1 51 F1 48 B3 02 D5 08 E9 21

PCR-06: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75

PCR-07: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75

PCR-08: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-09: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-11: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-12: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-13: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-14: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-15: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-16: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

PCR-17: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

PCR-18: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

PCR-19: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

PCR-20: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

PCR-21: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

PCR-22: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

PCR-23: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Advertisements