Skip to content

Commit

Permalink
Merge pull request #559 from ionut-arm/fix-clippy-v7
Browse files Browse the repository at this point in the history
Fix clippy warnings in v7
  • Loading branch information
Superhepper authored Dec 2, 2024
2 parents 9c7d580 + 5620779 commit 22b5862
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 66 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- name: Run the tests
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --security-opt seccomp=unconfined fedoracontainer dbus-run-session -- /tmp/rust-tss-esapi/tss-esapi/tests/all-fedora.sh

# SEE #558 : remove use of 1.82 once 1.84 rolls out;
tests-valgrind:
name: Valgrind test run
runs-on: ubuntu-latest
Expand All @@ -87,7 +88,7 @@ jobs:
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
- name: Run the tests
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi -e RUST_TOOLCHAIN_VERSION="1.82" ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh

# Check that the documentation builds as well.
docs:
Expand Down
4 changes: 2 additions & 2 deletions tss-esapi/src/constants/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2020 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0

/// This module contains both the constants defined in the TSS specification (tss module)
/// but also the internal representation of the TSS constants.
//! This module contains both the constants defined in the TSS specification (tss module)
//! but also the internal representation of the TSS constants.
/// Representation of the constants defined in the
/// Constants -> TPM_ALG_ID section of the specification
Expand Down
18 changes: 9 additions & 9 deletions tss-esapi/src/handles/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2020 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0

/// Module that contains the different types of handles
/// that the ESAPI and the TPM uses in order to provide
/// access to objects that was or has been created.
//! Module that contains the different types of handles
//! that the ESAPI and the TPM uses in order to provide
//! access to objects that was or has been created.
/////////////////////////////////////////////////////////
/// ESYS Handles
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// ESYS Handles
// ///////////////////////////////////////////////////////
pub use handle::auth::AuthHandle;
pub use handle::key::KeyHandle;
pub use handle::nv_index::NvIndexHandle;
Expand All @@ -18,9 +18,9 @@ pub(crate) mod handle_conversion {
pub(crate) use super::handle::conversions::*;
}
mod handle;
/////////////////////////////////////////////////////////
/// TPM Handles
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// TPM Handles
// ///////////////////////////////////////////////////////
pub use tpm::attached_component::AttachedComponentTpmHandle;
pub use tpm::hmac_session::HmacSessionTpmHandle;
pub use tpm::loaded_session::LoadedSessionTpmHandle;
Expand Down
6 changes: 3 additions & 3 deletions tss-esapi/src/interface_types/resource_handles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ impl TryFrom<TpmHandle> for HierarchyAuth {
}
}
}
//////////////////////////////////////////////////////////////////////////////////
/// TODO: HierarchyPolicy
//////////////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////////////
// TODO: HierarchyPolicy
// ////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
/// Platform
Expand Down
97 changes: 48 additions & 49 deletions tss-esapi/src/structures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@
/// Published
///
/// Chapter 10: Structure Definitions
/////////////////////////////////////////////////////////
/// The capabilitydata section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The capabilitydata section
// ///////////////////////////////////////////////////////
mod capability_data;
pub use self::capability_data::CapabilityData;
/////////////////////////////////////////////////////////
/// The names section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The names section
// ///////////////////////////////////////////////////////
mod names;
pub use names::name::Name;
/////////////////////////////////////////////////////////
/// The result section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The result section
// ///////////////////////////////////////////////////////
mod result;
pub use result::CreateKeyResult;
pub use result::CreatePrimaryKeyResult;
/////////////////////////////////////////////////////////
/// The sized buffers section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The sized buffers section
// ///////////////////////////////////////////////////////
mod buffers;
pub use self::buffers::{
attest::AttestBuffer, auth::Auth, data::Data, digest::Digest, ecc_parameter::EccParameter,
Expand All @@ -42,19 +41,19 @@ pub use self::buffers::{
public::PublicBuffer, public_key_rsa::PublicKeyRsa, sensitive::SensitiveBuffer,
sensitive_data::SensitiveData, symmetric_key::SymmetricKey, timeout::Timeout,
};
/////////////////////////////////////////////////////////
/// The creation section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The creation section
// ///////////////////////////////////////////////////////
mod creation;
pub use self::creation::CreationData;
/////////////////////////////////////////////////////////
/// The hash section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The hash section
// ///////////////////////////////////////////////////////
mod hash;
pub use self::hash::agile::HashAgile;
/////////////////////////////////////////////////////////
/// The pcr section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The pcr section
// ///////////////////////////////////////////////////////
mod pcr;

pub use self::pcr_slot::PcrSlot;
Expand All @@ -76,9 +75,9 @@ pub use self::pcr_select_size::PcrSelectSize;
pub mod pcr_select_size {
pub use super::pcr::select_size::*;
}
/////////////////////////////////////////////////////////
/// The lists section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The lists section
// ///////////////////////////////////////////////////////
mod lists;
pub use self::digest_list::DigestList;
pub mod digest_list {
Expand Down Expand Up @@ -132,14 +131,14 @@ pub mod command_code_attributes_list {
}

pub(crate) use pcr::slot_collection::PcrSlotCollection;
/////////////////////////////////////////////////////////
/// The parameters section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The parameters section
// ///////////////////////////////////////////////////////
mod parameters;
pub use self::parameters::SymmetricCipherParameters;
/////////////////////////////////////////////////////////
/// The tickets section
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// The tickets section
// ///////////////////////////////////////////////////////
mod tickets;
pub use tickets::AuthTicket;
pub use tickets::CreationTicket;
Expand Down Expand Up @@ -167,42 +166,42 @@ pub use tagged::{
signature::Signature,
symmetric::{SymmetricDefinition, SymmetricDefinitionObject},
};
/////////////////////////////////////////////////////////
/// ECC structures
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// ECC structures
// ///////////////////////////////////////////////////////
mod ecc;
pub use ecc::point::EccPoint;
/////////////////////////////////////////////////////////
/// Signatures structures
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// Signatures structures
// ///////////////////////////////////////////////////////
mod signatures;
pub use signatures::{EccSignature, RsaSignature};
/////////////////////////////////////////////////////////
/// Attestation Structures
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// Attestation Structures
// ///////////////////////////////////////////////////////
mod attestation;
pub use attestation::{
attest::Attest, attest_info::AttestInfo, certify_info::CertifyInfo,
command_audit_info::CommandAuditInfo, creation_info::CreationInfo,
nv_certify_info::NvCertifyInfo, nv_digest_certify_info::NvDigestCertifyInfo,
quote_info::QuoteInfo, session_audit_info::SessionAuditInfo, time_attest_info::TimeAttestInfo,
};
/////////////////////////////////////////////////////////
/// Clock/Time Structures
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// Clock/Time Structures
// ///////////////////////////////////////////////////////
mod clock;
pub use clock::{clock_info::ClockInfo, time_info::TimeInfo};
/////////////////////////////////////////////////////////
/// Property Structures
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// Property Structures
// ///////////////////////////////////////////////////////
mod property;
pub use property::{
algorithm_property::AlgorithmProperty, tagged_pcr_select::TaggedPcrSelect,
tagged_property::TaggedProperty,
};

/////////////////////////////////////////////////////////
/// NV structures
/////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
// NV structures
// ///////////////////////////////////////////////////////
mod nv;
pub use nv::storage::{NvPublic, NvPublicBuilder};
4 changes: 2 additions & 2 deletions tss-esapi/src/structures/nv/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2020 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0

/// This module contains code that deals with the non volatile
/// parts of the tpm.
//! This module contains code that deals with the non volatile
//! parts of the tpm.
/// Non volatile storage module.
pub mod storage;
4 changes: 4 additions & 0 deletions tss-esapi/tests/valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

set -euf -o pipefail

if [[ ! -z ${RUST_TOOLCHAIN_VERSION:+x} ]]; then
rustup override set ${RUST_TOOLCHAIN_VERSION}
fi

#################################
# Run the TPM simulation server #
#################################
Expand Down

0 comments on commit 22b5862

Please sign in to comment.