@@ -13,12 +13,12 @@ interface to Rust to [TSS](https://github.com/tpm2-software/tpm2-tss).
13
13
14
14
This crate exposes an interface for the TSS Enhanced System API and thus
15
15
links to libraries that expose this interface. In order to allow proper use
16
- of the ESAPI, this FFI layer includes bindings to TCTI and MU headers, and
16
+ of the ESAPI, this FFI layer includes bindings to TCTI and MU headers, and
17
17
must therefore link to all of them at build time.
18
18
19
19
The paths to the libraries are discovered using ` pkg-config ` - make sure they
20
- are discoverable in this way on your system. Our build script looks for
21
- ` tss2-esys ` , ` tss2-tctildr ` and ` tss2-mu ` . A minimum version of ` 4.0.1 ` is
20
+ are discoverable in this way on your system. Our build script looks for
21
+ ` tss2-esys ` , ` tss2-tctildr ` and ` tss2-mu ` . A minimum version of ` 4.0.1 ` is
22
22
required for all of them.
23
23
24
24
Having installed the open-source implementation libraries at ` /usr/local/lib ` (by default), it
@@ -41,9 +41,70 @@ available, feel free to raise a Pull Request to add it or to use build-time
41
41
generation of bindings. All the committed bindings ** MUST** be generated from
42
42
the library version found under the ` vendor ` submodule.
43
43
44
+ ## Bundling TPM-TSS
45
+
46
+ tpm-tss is used by this library to communicate with TPMs. If this library
47
+ is not available on your system you may optionally bundle (vendor) tpm-tss
48
+ during builds. tpm-tss can be provided from a local source path with the
49
+ environment variable ` TPM_TSS_SOURCE_PATH ` or it will be retrieved from
50
+ github during the build. The version to retrieve can be controlled by setting
51
+ the ` TPM2_TSS_SOURCE_VERSION ` environment variable.
52
+ N.B. On windows it might be necessary to manually create the VERSION file
53
+ when a local source is being used.
54
+
55
+ To enable this feature:
56
+
57
+ ``` bash
58
+ cargo build --features=bundled
59
+ ```
60
+
61
+ ``` bash
62
+ TPM2_TSS_VERSION=" 4.1.3" cargo build --features=bundled
63
+ ```
64
+
65
+ ``` bash
66
+ TPM_TSS_SOURCE_PATH=/path/to/tpm-tss cargo build --features=bundled
67
+ ```
68
+
69
+ If using this feature from an external project
70
+
71
+ ```
72
+ tss-esapi-sys = { version = "...", features = "bundled" }
73
+ ```
74
+
75
+ ### Windows
76
+
77
+ Compiling for windows requires a bit of setup to work with the bundled feature.
78
+
79
+ * Openssl must be installed to a non-standard location at C:\OpenSSL-v11-Win64
80
+ * Visual studio 2019 must be installed with the Clang/C2 experimental component,
81
+ and windows sdk 10.0 (Other versions of Visual Studio may work but are untested
82
+ at this point).
83
+
84
+ ### MacOS
85
+
86
+ Compiling on MacOS requires the bundling feature. This requires dependencies
87
+ from brew.
88
+
89
+ ``` bashbre
90
+ brew install autoconf autoconf-archive automake json-c libtool m4 pkg-config
91
+ ```
92
+
93
+ Optionally you may require these libraries for certain classes of TPM transport
94
+
95
+ ```
96
+ brew install libftdi
97
+ ```
98
+
99
+ ### OpenSUSE / SUSE
100
+
101
+ ```
102
+ sudo zypper in autoconf autoconf-archive automake libjson-c-devel libtool libtpms-devel gawk make
103
+ ```
104
+
44
105
## Cross compiling
45
106
46
- Cross-compilation can be done as long as you have on your build system the TSS
107
+ Cross-compilation can be done as long as you have on your build system the TSS
47
108
libraries compiled for your target system of choice. We rely on ` pkg-config ` to
48
109
identify the libraries which we link against. Installing ` tpm2-tss ` does yield
49
110
` .pc ` files which can be used for this purpose, but depending on the exact build
0 commit comments