forked from stefanberger/libtpms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
165 lines (118 loc) · 4.68 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
This document contains the following sections:
==============================================
- Quick start
- Building libtpms
- Installing libtpms, include files and man pages
- Uninstalling libtpms, include files and man pages
- More on man pages
Quick start:
------------
The libtpms library can be built using the steps (after installing
dependencies):
# ./autogen.sh --with-tpm2 --with-openssl --prefix=/usr
# make
# make check
# sudo make install
Building libtpms:
-----------------
The configure script needs to be run first, and can be done using:
./autogen.sh --with-tpm2 --with-openssl
By default, files will be installed in '/usr/local/lib', etc. If you
would like to have these files installed in '/usr/lib', etc, then run
configure using the following command line. On some distributions it may
be necessary to also pass --libdir=/lib64 (for 64 bit systems).
./autogen.sh --prefix=/usr --with-tpm2 --with-openssl
For more details on configure options, run "./configure -h".
Building libtpms can be done using:
make all
The library is known to build on Linux and Cygwin systems and possible
other Operating Systems that use .so as library extensions.
On Linux systems, libtpms can be built with either one of the following
crypto backends:
- openssl
- freebl (TPM 1.2 support only)
On Cygwin only openssl is available and therefore can only be built with
openssl.
To build for openssl, the following development packages must have been
installed:
Fedora/RedHat:
- automake
- autoconf
- libtool
- make
- gcc
- glibc-headers
- openssl-devel
Ubuntu:
- automake
- autoconf
- libtool
- make
- gcc
- libc-dev
- libssl-dev
To build for freebl (TPM 1.2 support only), the following development
packages must have been installed prior to compilation:
Fedora/RedHat:
- glibc-headers
- nss-softokn-freebl-devel (preferably version 3.12.9-2 or newer)
- nss-softokn-devel (preferably version 3.12.9-2 or newer)
- gmp-devel
Ubuntu:
- libc6-dev
- libgmp-dev
- libnspr4-dev
- libnss3-dev (preferably version 3.17.2; needs to have blapi.h)
By default, libtpms is built with the openssl crypto library, which was
shown above. To build with the freebl crypto library the following command
line can be used (TPM 1.2 support only):
./autogen.sh --prefix=/usr
make all install
To verify that libtpms was built with freebl as the crypto backend, one
can run:
ldd /usr/lib/libtpms.so or ldd /usr/lib64/libtpms.so
linux-vdso.so.1 => (0x00007fff8d5ff000)
libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x00007f5352a13000)
libnspr4.so => /lib64/libnspr4.so (0x00007f53527d6000)
libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007f53525b6000)
libnss3.so => /usr/lib64/libnss3.so (0x00007f535227c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5351ed8000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5351cba000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f5351ab6000)
libplc4.so => /lib64/libplc4.so (0x00007f53518b2000)
libplds4.so => /lib64/libplds4.so (0x00007f53516ae000)
/lib64/ld-linux-x86-64.so.2 (0x0000003a1c000000)
The fact that the libraries libgmp, libnspr4, libnssutil3, libnss3,
libpc4, and libplds4 are linked agaist is an indication that the freebl
library was used for linking.
In case of openssl's libcrypto the output would be the following:
linux-vdso.so.1 => (0x00007fffcbdff000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fdb1d00e000)
libc.so.6 => /lib64/libc.so.6 (0x00007fdb1cc6a000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fdb1ca65000)
libz.so.1 => /lib64/libz.so.1 (0x00007fdb1c84e000)
/lib64/ld-linux-x86-64.so.2 (0x0000003a1c000000)
Installing libtpms, include files and man pages:
------------------------------------------------
The installation of libtpms, the development include files (headers) and
man pages can be achieved through:
make install
This will copy libtpms into the standard library directory on your Linux
system such as /usr/lib or /usr/lib64, depending on whether you built for
a 32 bit or 64 bit machine.
The public include files of libtpms will be copied to /usr/include/libtpms.
The man pages explaining the libtpms API will be copied to /usr/share/man.
Uninstalling libtpms, include files and man pages:
--------------------------------------------------
The libtpms library, its development include files (headers) and man pages
can be uninstalled from their standard locations using
make uninstall
More on man pages
-----------------
All of the libtpms APIs have a man page. The man pages contain explanations
on how to use the APIs as well as examples. Once installed, they can be
viewed as a typical man page:
man TPMLIB_MainInit
Otherwise, if they are not installed, they can then be viewed from the
libtpms root directory using:
man -M ./man TPMLIB_MainInit