Instructions for building and configuring tpm2-pkcs11.
The project depends on:
- Automake
- Make
- A C compiler. Known working compilers are:
- SQLite3
- tpm2-tss: Requires >= 2.0, recomended >= 2.3.0
- A Resource Manager, one of:
- tpm2-abrmd: Requires version >= 2.1.0
- Linux kernel version >= 4.12 for /dev/tpmrm[0-9]+ nodes.
- Note that the device TCTI must be configured for this.
- openssl: Requires version >= 1.0.2g
- autoconf-archive: Tested with release v2018.03.13 Others may not work, some distros package versions too old. Either install or just copy the contents of the autoconf-archive's m4 directory to the m4 subdirectory of the tpm2-pkcs11 project. If the m4 folder is not present, simply create it with mkdir.
- tpm2-tools: Requires version >= 4.0.1
- Python: Requires version >= 3.7
The tpm2-tss and tpm2-tools projects must be obtained via source. Packaged versions existing in known package managers are likely too old.
- CMocka
- TPM 2.0 Simulator: Tested with version 1563
- tpm2-abrmd
- Dependencies for [tpm2-ptool](# Optional Dependencies for tpm2_ptool)
Run the bootstrap
command.
$ ./bootstrap
For people wanting to just build the library, the command:
./configure
Should be sufficient. However, the following configure options will be useful for those wishing to do more, like testing, or those running into issues to work around. The following are known configure options that can be added that are outside of normal autoconf/automake options, which are documented here.
--enable-unit
- Enables the unit tests when runningmake check
--enable-integration
- Enables the integration tests when runningmake check
- Requires the following items to be found on PATH:
- Example:
Normally only tpm2-tools, IBM TPM Simulator and tpm2-ptool need to be added to
export PATH="/home/wcrobert/workspace/tpm2-tools/tools:/home/wcrobert/workspace/tpm2-pkcs11/tools:$HOME/workspace/ibmtpm974/src:$PATH"
PATH
. Most other things, like CMocka and ss, are already installed and thus onPATH
. Your results will very based on what you build from source and/or install in non-standard locations.
--disable-hardening
- Compiler flag hardening options, this is enabled by default. Disabling hardening is NOT RECOMMENDED FOR PRODUCTION BUILDS, however, is often useful when adding in compiler flags for testing viaCFLAGS
. For example, one would need to disable this if configuring clang with ASAN.--disable-esapi-session-manage-flags
- Disables ESAPI session flag management and causes the pkcs11 library to do it. This is autodetected and overiding it should only be done in specific coditions This can also be configured at run time by setting the environment variableTPM2_PKCS11_ESAPI_MANAGE_FLAGS
to any value. These options may go away in future versions.
The next step after configuring is to compile the source code.
To enable testing, run make check
.
Note: If make check runs 0 tests, you likely need the configure options --enable-unit
and --enable-integration
. See Configure Options
for more details.