Skip to content

Commit c08c13f

Browse files
committed
build(deps): use tpm2-tss version 4.1.3 instead of nightly
Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
1 parent e155f6e commit c08c13f

5 files changed

Lines changed: 33 additions & 28 deletions

File tree

.github/actions/install-tpm2-tss/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
name: Install tpm2-tss latest
2+
description: "Install tpm2-tss from source"
3+
4+
inputs:
5+
version:
6+
description: "The version (tag, branch or commit SHA) of tpm2-tss to install"
7+
required: false
8+
default: "4.1.3"
29

310
runs:
411
using: "composite"
@@ -14,9 +21,9 @@ runs:
1421
- name: Build and Install tpm2-tss
1522
shell: bash
1623
run: |
17-
git clone --depth 1 https://github.com/tpm2-software/tpm2-tss
24+
git clone https://github.com/tpm2-software/tpm2-tss
1825
cd tpm2-tss
19-
git tag "4.1.999" # Fake version
26+
git checkout ${{ inputs.version }}
2027
./bootstrap
2128
./configure --prefix=/usr \
2229
--disable-fapi --disable-weakcrypto --disable-integration

.github/workflows/build.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ jobs:
5050
toolchain: ${{ matrix.toolchain }}
5151
target: ${{ matrix.target }}
5252
- uses: ./.github/actions/install-tpm2-tss
53+
with:
54+
version: "30e6057722058cb85c292dcb7b77760ad6410d4e" # version 4.1.3
5355
# - run: sudo apt-get update && sudo apt-get install -y libtss2-dev pkg-config
54-
- name: Build
55-
env:
56-
TSS2_ESYS_STATIC: 1
57-
TSS2_SYS_STATIC: 1
58-
TSS2_MU_STATIC: 1
59-
TSS2_TCTILDR_STATIC: 1
60-
run: cargo build --workspace --all-targets --all-features --target ${{ matrix.target }}
56+
- run: cargo build --workspace --all-targets --all-features --target ${{ matrix.target }}

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ jobs:
4444
toolchain: stable
4545
components: clippy
4646
- uses: ./.github/actions/install-tpm2-tss
47+
with:
48+
version: "30e6057722058cb85c292dcb7b77760ad6410d4e" # version 4.1.3
4749
# - run: sudo apt-get update && sudo apt-get install -y libtss2-dev pkg-config
4850
- run: cargo clippy --workspace --all-targets --all-features -- -D warnings

.github/workflows/test.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,8 @@ jobs:
5555
toolchain: ${{ matrix.toolchain }}
5656
target: ${{ matrix.target }}
5757
- uses: ./.github/actions/install-tpm2-tss
58+
with:
59+
version: "30e6057722058cb85c292dcb7b77760ad6410d4e" # version 4.1.3
5860
# - run: sudo apt-get update && sudo apt-get install -y libtss2-dev pkg-config
59-
- name: Install swtpm
60-
run: sudo apt-get install -y swtpm
61-
- name: Run cargo test --all-targets
62-
env:
63-
TSS2_ESYS_STATIC: 1
64-
TSS2_SYS_STATIC: 1
65-
TSS2_MU_STATIC: 1
66-
TSS2_TCTILDR_STATIC: 1
67-
run: cargo test --all-targets
61+
- run: sudo apt-get update && sudo apt-get install -y swtpm
62+
- run: cargo test --all-targets

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,23 @@ The `rust-tpm2-cli` crate provides a suite of Rust-based command-line tools for
1717

1818
### Install dependencies
1919

20-
```bash
20+
- [Rust](https://rust-lang.org/): v1.88.0 or later
21+
- [tpm2-tss](https://github.com/tpm2-software/tpm2-tss): v4.1.3 or later (C library)
22+
23+
Install the latest Rust toolchain:
24+
25+
```sh
2126
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2227
source "$HOME/.cargo/env"
2328
```
2429

25-
`rust-tpm2-cli` targets the unreleased nightly version [tpm2-tss](https://github.com/tpm2-software/tpm2-tss), which includes significant updates beyond the 4.1.3 release (e.g. Unix domain socket support for the swtpm TCTI).
26-
To build `tpm2-tss` from source:
30+
Install `tpm2-tss` from package manager (may be outdated):
31+
32+
```sh
33+
sudo apt install -y libtss2-dev pkg-config
34+
```
2735

28-
> [!WARNING]
29-
> The steps below install a locally-built nightly snapshot under `/usr` with a **fake version tag** (`4.1.999`).
30-
> This may conflict with a distro-packaged `tpm2-tss` or with future upstream releases, as a package manager may refuse to downgrade from the fake version `4.1.999` to an official but lower version number (e.g., v4.1.4).
31-
> Once an official release with these features is available in your distribution's packages, you can simply install `tpm2-tss` by running `sudo apt install -y libtss2-dev`.
36+
If the version of `tpm2-tss` available from the package manager is too old, build `tpm2-tss` from source:
3237

3338
```bash
3439
# Install build dependencies
@@ -39,9 +44,9 @@ sudo apt install -y \
3944
libjson-c-dev libltdl-dev libssl-dev libusb-1.0-0-dev uthash-dev uuid-dev
4045

4146
# Clone latest main and build
42-
git clone --depth 1 https://github.com/tpm2-software/tpm2-tss
47+
git clone https://github.com/tpm2-software/tpm2-tss
4348
cd tpm2-tss
44-
git tag "4.1.999" # Fake version
49+
git checkout 30e6057722058cb85c292dcb7b77760ad6410d4e # tag: 4.1.3
4550
./bootstrap
4651
./configure --prefix=/usr \
4752
--disable-fapi --disable-weakcrypto --disable-integration
@@ -57,7 +62,7 @@ See also [Installation instructions for tpm2-tss](https://github.com/tpm2-softwa
5762
```bash
5863
git clone https://github.com/hyperfinitism/rust-tpm2-cli
5964
cd rust-tpm2-cli
60-
TSS2_ESYS_STATIC=1 TSS2_SYS_STATIC=1 TSS2_MU_STATIC=1 TSS2_TCTILDR_STATIC=1 cargo build --release
65+
cargo build --release
6166
# => ./target/release/tpm2
6267
```
6368

0 commit comments

Comments
 (0)