@@ -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,63 @@ 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.
51
+
52
+ To enable this feature:
53
+
54
+ ``` bash
55
+ cargo build --features=bundled
56
+ ```
57
+
58
+ ``` bash
59
+ TPM_TSS_SOURCE_PATH=/path/to/tpm-tss cargo build --features=bundled
60
+ ```
61
+
62
+ If using this feature from an external project
63
+
64
+ ```
65
+ tss-esapi-sys = { version = "...", features = "bundled" }
66
+ ```
67
+
68
+ ### Windows
69
+
70
+ Compiling for windows requires a bit of setup to work with the bundled feature.
71
+
72
+ * Openssl must be installed to a non-standard location at C:\OpenSSL-v11-Win64
73
+ * Visual studio 2019 must be installed with the Clang/C2 experimental component,
74
+ and windows sdk 10.0 (Other versions of Visual Studio may work but are untested
75
+ at this point).
76
+
77
+ ### MacOS
78
+
79
+ Compiling on MacOS requires the bundling feature. This requires dependencies
80
+ from brew.
81
+
82
+ ``` bashbre
83
+ brew install autoconf autoconf-archive automake json-c libtool m4 pkg-config
84
+ ```
85
+
86
+ Optionally you may require these libraries for certain classes of TPM transport
87
+
88
+ ```
89
+ brew install libftdi
90
+ ```
91
+
92
+ ### OpenSUSE / SUSE
93
+
94
+ ```
95
+ sudo zypper in autoconf autoconf-archive automake libjson-c-devel libtool libtpms-devel gawk make
96
+ ```
97
+
44
98
## Cross compiling
45
99
46
- Cross-compilation can be done as long as you have on your build system the TSS
100
+ Cross-compilation can be done as long as you have on your build system the TSS
47
101
libraries compiled for your target system of choice. We rely on ` pkg-config ` to
48
102
identify the libraries which we link against. Installing ` tpm2-tss ` does yield
49
103
` .pc ` files which can be used for this purpose, but depending on the exact build
0 commit comments