Skip to content

Split repo into two crates #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ jobs:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check formatting
run: cargo fmt --all -- --check
- uses: actions/checkout@v2
- name: Check formatting
run: cargo fmt --all -- --check

# All in one job as I think it is a big overhead to build and run the Docker
# container?
tests-ubuntu:
name: Ubuntu tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tests/ --file tests/Dockerfile-ubuntu
- name: Run the container
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tests/all-ubuntu.sh
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
- name: Run the container
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

tests-fedora:
name: Fedora tests
# We just build a container... GitHub doesn't like Fedora :(
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t fedoracontainer tests/ --file tests/Dockerfile-fedora
- name: Run the tests
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
- uses: actions/checkout@v2
- name: Build the container
run: docker build -t fedoracontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-fedora
- name: Run the tests
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/target
*target
**/*.rs.bk
Cargo.lock
*Cargo.lock
*.swp
*DS_Store
*.patch
Expand Down
40 changes: 2 additions & 38 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,2 @@
[package]
name = "tss-esapi"
version = "4.0.10-alpha.2"
authors = ["Ionut Mihalcea <[email protected]>",
"Hugues de Valon <[email protected]>"]
edition = "2018"
description = "Wrapper around TSS 2.0 Enhanced System API"
readme = "README.md"
keywords = ["tpm", "tss", "esys", "esapi"]
categories = ["api-bindings", "external-ffi-bindings", "cryptography"]
license = "Apache-2.0"
repository = "https://github.com/parallaxsecond/rust-tss-esapi"
documentation = "https://docs.rs/crate/tss-esapi"

[dependencies]
bitfield = "0.13.2"
serde = { version = "1.0.115", features = ["derive"] }
mbox = "0.5.0"
log = "0.4.11"
enumflags2 = "0.6.4"
num-derive = "0.3.2"
num-traits = "0.2.12"
hostname-validator = "1.0.0"
regex = "1.3.9"
zeroize = { version = "1.1.0", features = ["zeroize_derive"] }

[dev-dependencies]
env_logger = "0.7.1"

[build-dependencies]
bindgen = "0.56.0"
pkg-config = "0.3.18"

[features]
docs = []

[package.metadata.docs.rs]
features = ["docs"]
[workspace]
members = ["tss-esapi", "tss-esapi-sys"]
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,9 @@
-- SPDX-License-Identifier: Apache-2.0
--->

# TSS 2.0 Enhanced System API Rust Wrapper
# TSS 2.0 Enhanced System API Rust Wrapper

<p align="center">
<a href="https://crates.io/crates/tss-esapi"><img alt="Crates.io" src="https://img.shields.io/crates/v/tss-esapi"></a>
<a href="https://docs.rs/tss-esapi"><img src="https://docs.rs/tss-esapi/badge.svg" alt="Code documentation"/></a>
<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>
</p>

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.

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.

## Versioning

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.

## Requirements

This crate has currently only been tested with the TSS 2.0
[open-source implementation](https://github.com/tpm2-software/tpm2-tss).
It uses `pkg-config` to find the include and library files for the `tss2-esys` and `tss2-tctildr`
libraries. A minimum version of `2.3.3` is required for both. `pkg-config` tool is needed to build this crate.

Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it
might happen that `pkg-config` can not find them. Run the following command if that is the
case:
```bash
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
```
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.

## Minimum Supported Rust Version (MSRV)

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

## Community channel

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

## Contributing

Expand Down
68 changes: 0 additions & 68 deletions build.rs

This file was deleted.

20 changes: 20 additions & 0 deletions tss-esapi-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "tss-esapi-sys"
version = "0.1.0"
authors = ["Parsec Project Contributors"]
edition = "2018"
description = "FFI wrapper around TSS 2.0 Enhanced System API"
readme = "README.md"
keywords = ["tpm", "tss", "esys", "esapi"]
categories = ["api-bindings", "external-ffi-bindings", "cryptography"]
license = "Apache-2.0"
repository = "https://github.com/parallaxsecond/rust-tss-esapi"
documentation = "https://docs.rs/crate/tss-esapi-sys"
links = "tss2-esys"

[build-dependencies]
bindgen = { version = "0.56.0", optional = true }
pkg-config = "0.3.18"

[features]
generate-bindings = ["bindgen"]
Loading