Skip to content
Draft
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
9 changes: 7 additions & 2 deletions tss-esapi/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2021 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
use semver::{Version, VersionReq};
use semver::{Version, VersionReq, Prerelease};

const TPM2_TSS_MINIMUM_VERSION: Version = Version::new(4, 1, 3);

Expand All @@ -13,7 +13,7 @@ fn main() {

// If documentation for Docs.rs is being built then the version is set
// to the minimum supported tpm2-tss version.
let tss_version = if std::env::var("DOCS_RS").is_ok() {
let mut tss_version = if std::env::var("DOCS_RS").is_ok() {
TPM2_TSS_MINIMUM_VERSION
} else {
let tss_version_string = std::env::var("DEP_TSS2_ESYS_VERSION")
Expand All @@ -23,9 +23,14 @@ fn main() {
.expect("Failed to parse the DEP_TSS2_ESYS_VERSION variable as a semver version")
};

// nuke any prerelease info, which probably is just a git repo/dirty flag
// like: 4.0.1-67-gb7bad346
tss_version.pre = Prerelease::EMPTY;

let supported_tss_version =
VersionReq::parse("<5.0.0, >=2.3.3").expect("Failed to parse supported TSS version");

//eprintln!("tss version: {} / {:?}", supported_tss_version, tss_version);
assert!(
supported_tss_version.matches(&tss_version),
"Unsupported TSS version {tss_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ impl TryFrom<CreateCommandOutputHandler> for CreateKeyResult {

let creation_ticket_owned =
unsafe { take_from_esys(ffi_data_handler.ffi_creation_ticket_ptr)? };
ffi_data_handler.ffi_creation_ticket_ptr = null_mut();
//#[allow(unused_assignments)]
//ffi_data_handler.ffi_creation_ticket_ptr = null_mut();

Ok(CreateKeyResult {
out_private: Private::try_from(out_private_owned)?,
Expand Down
1 change: 1 addition & 0 deletions tss-esapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
missing_copy_implementations,
rustdoc::broken_intra_doc_links,
)]
#![feature(stmt_expr_attributes)]

//! # TSS 2.0 Rust Wrapper over Enhanced System API
//! This crate exposes the functionality of the TCG Software Stack Enhanced System API to
Expand Down
1 change: 1 addition & 0 deletions tss-esapi/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ macro_rules! impl_mu_complex {

// Make the macros usable outside of the module.
pub(crate) use impl_marshall_trait;
#[allow(unused_imports)]
pub(crate) use impl_mu_aliases;
pub(crate) use impl_mu_complex;
pub(crate) use impl_mu_simple;
Expand Down