Skip to content

Commit 1991748

Browse files
committed
Split repo into two crates
This commit splits the repository into two crates: `tss-esapi` for the Rust-native, idiomatic interface, and `tss-esapi-sys` for the FFI bindings. This is the first step in the process and probably multiple other PRs will be needed to clean up. Signed-off-by: Ionut Mihalcea <[email protected]>
1 parent 3830b8f commit 1991748

File tree

92 files changed

+2979
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2979
-222
lines changed

.github/workflows/ci.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ jobs:
77
name: Check formatting
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- name: Check formatting
12-
run: cargo fmt --all -- --check
10+
- uses: actions/checkout@v2
11+
- name: Check formatting
12+
run: cargo fmt --all -- --check
1313

1414
# All in one job as I think it is a big overhead to build and run the Docker
1515
# container?
1616
tests-ubuntu:
1717
name: Ubuntu tests
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
21-
- name: Build the container
22-
run: docker build -t ubuntucontainer tests/ --file tests/Dockerfile-ubuntu
23-
- name: Run the container
24-
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tests/all-ubuntu.sh
20+
- uses: actions/checkout@v2
21+
- name: Build the container
22+
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
23+
- name: Run the container
24+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
2525

2626
tests-fedora:
2727
name: Fedora tests
2828
# We just build a container... GitHub doesn't like Fedora :(
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
32-
- name: Build the container
33-
run: docker build -t fedoracontainer tests/ --file tests/Dockerfile-fedora
34-
- name: Run the tests
35-
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tests/all-fedora.sh
31+
- uses: actions/checkout@v2
32+
- name: Build the container
33+
run: docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora
34+
- name: Run the tests
35+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/target
1+
*target
22
**/*.rs.bk
3-
Cargo.lock
3+
*Cargo.lock
44
*.swp
55
*DS_Store
66
*.patch

Cargo.toml

+2-38
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,2 @@
1-
[package]
2-
name = "tss-esapi"
3-
version = "4.0.10-alpha.2"
4-
authors = ["Ionut Mihalcea <[email protected]>",
5-
"Hugues de Valon <[email protected]>"]
6-
edition = "2018"
7-
description = "Wrapper around TSS 2.0 Enhanced System API"
8-
readme = "README.md"
9-
keywords = ["tpm", "tss", "esys", "esapi"]
10-
categories = ["api-bindings", "external-ffi-bindings", "cryptography"]
11-
license = "Apache-2.0"
12-
repository = "https://github.com/parallaxsecond/rust-tss-esapi"
13-
documentation = "https://docs.rs/crate/tss-esapi"
14-
15-
[dependencies]
16-
bitfield = "0.13.2"
17-
serde = { version = "1.0.115", features = ["derive"] }
18-
mbox = "0.5.0"
19-
log = "0.4.11"
20-
enumflags2 = "0.6.4"
21-
num-derive = "0.3.2"
22-
num-traits = "0.2.12"
23-
hostname-validator = "1.0.0"
24-
regex = "1.3.9"
25-
zeroize = { version = "1.1.0", features = ["zeroize_derive"] }
26-
27-
[dev-dependencies]
28-
env_logger = "0.7.1"
29-
30-
[build-dependencies]
31-
bindgen = "0.56.0"
32-
pkg-config = "0.3.18"
33-
34-
[features]
35-
docs = []
36-
37-
[package.metadata.docs.rs]
38-
features = ["docs"]
1+
[workspace]
2+
members = ["tss-esapi", "tss-esapi-sys"]

README.md

+4-30
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,9 @@
33
-- SPDX-License-Identifier: Apache-2.0
44
--->
55

6-
# TSS 2.0 Enhanced System API Rust Wrapper
6+
# TSS 2.0 Enhanced System API Rust Wrapper
77

8-
<p align="center">
9-
<a href="https://crates.io/crates/tss-esapi"><img alt="Crates.io" src="https://img.shields.io/crates/v/tss-esapi"></a>
10-
<a href="https://docs.rs/tss-esapi"><img src="https://docs.rs/tss-esapi/badge.svg" alt="Code documentation"/></a>
11-
<a href="https://github.com/parallaxsecond/rust-tss-esapi/actions?query=workflow%3A%22Continuous+Integration%22"><img src="https://github.com/parallaxsecond/rust-tss-esapi/workflows/Continuous%20Integration/badge.svg" alt="CI tests"/></a>
12-
</p>
13-
14-
The `tss-esapi` Rust crate provides an idiomatic interface to the TCG TSS 2.0 Enhanced System API. We expose both direct FFI bindings and abstracted versions, aimed at improved convenience of using the API.
15-
16-
Our end-goal is to achieve a fully Rust-native interface that offers strong safety and security guarantees. Check out our [documentation](https://docs.rs/tss-esapi/*/tss_esapi/#notes-on-code-safety) for an overview of our code safety approach.
17-
18-
## Versioning
19-
20-
The crate is still under development and thus the interface is not stable (despite the version number). As a rule of thumb, all versions marked `alpha` are expected to be short-lived and superseded by a better, more complete interface that relies on breaking changes.
21-
22-
## Requirements
23-
24-
This crate has currently only been tested with the TSS 2.0
25-
[open-source implementation](https://github.com/tpm2-software/tpm2-tss).
26-
It uses `pkg-config` to find the include and library files for the `tss2-esys` and `tss2-tctildr`
27-
libraries. A minimum version of `2.3.3` is required for both. `pkg-config` tool is needed to build this crate.
28-
29-
Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it
30-
might happen that `pkg-config` can not find them. Run the following command if that is the
31-
case:
32-
```bash
33-
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
34-
```
8+
The `tss-esapi` Rust crate provides an idiomatic interface to the TCG TSS 2.0 Enhanced System API. We expose both direct FFI bindings (under the `tss-esapi-sys` crate) and abstracted versions, aimed at improved convenience of using the API.
359

3610
## Minimum Supported Rust Version (MSRV)
3711

@@ -44,8 +18,8 @@ If you need support for other versions of the compiler, get in touch with us to
4418

4519
## Community channel
4620

47-
Come and talk to us in [our Slack channel](https://app.slack.com/client/T0JK1PCN6/CPMQ9D4H1)!
48-
[Here](http://dockr.ly/slack) is how to join the workspace.
21+
Come and talk to us in [our Slack channel](https://cloud-native.slack.com/archives/C01EARH2ZB3)!
22+
[Here](https://slack.cncf.io/) is where you can join the workspace.
4923

5024
## Contributing
5125

build.rs

-68
This file was deleted.

tss-esapi-sys/Cargo.toml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "tss-esapi-sys"
3+
version = "0.1.0"
4+
authors = ["Parsec Project Contributors"]
5+
edition = "2018"
6+
description = "FFI wrapper around TSS 2.0 Enhanced System API"
7+
readme = "README.md"
8+
keywords = ["tpm", "tss", "esys", "esapi"]
9+
categories = ["api-bindings", "external-ffi-bindings", "cryptography"]
10+
license = "Apache-2.0"
11+
repository = "https://github.com/parallaxsecond/rust-tss-esapi"
12+
documentation = "https://docs.rs/crate/tss-esapi-sys"
13+
links = "tss2-esys"
14+
15+
[build-dependencies]
16+
bindgen = { version = "0.56.0", optional = true }
17+
pkg-config = "0.3.18"
18+
19+
[features]
20+
generate-bindings = ["bindgen"]

0 commit comments

Comments
 (0)