Skip to content

Commit 5620779

Browse files
committed
Fix clippy warnings
Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
1 parent 9c7d580 commit 5620779

File tree

7 files changed

+70
-66
lines changed

7 files changed

+70
-66
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
- name: Run the tests
8080
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
8181

82+
# SEE #558 : remove use of 1.82 once 1.84 rolls out;
8283
tests-valgrind:
8384
name: Valgrind test run
8485
runs-on: ubuntu-latest
@@ -87,7 +88,7 @@ jobs:
8788
- name: Build the container
8889
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu
8990
- name: Run the tests
90-
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
91+
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
9192

9293
# Check that the documentation builds as well.
9394
docs:

tss-esapi/src/constants/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2020 Contributors to the Parsec project.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
/// This module contains both the constants defined in the TSS specification (tss module)
5-
/// but also the internal representation of the TSS constants.
4+
//! This module contains both the constants defined in the TSS specification (tss module)
5+
//! but also the internal representation of the TSS constants.
66
77
/// Representation of the constants defined in the
88
/// Constants -> TPM_ALG_ID section of the specification

tss-esapi/src/handles/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Copyright 2020 Contributors to the Parsec project.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
/// Module that contains the different types of handles
5-
/// that the ESAPI and the TPM uses in order to provide
6-
/// access to objects that was or has been created.
4+
//! Module that contains the different types of handles
5+
//! that the ESAPI and the TPM uses in order to provide
6+
//! access to objects that was or has been created.
77
8-
/////////////////////////////////////////////////////////
9-
/// ESYS Handles
10-
/////////////////////////////////////////////////////////
8+
// ///////////////////////////////////////////////////////
9+
// ESYS Handles
10+
// ///////////////////////////////////////////////////////
1111
pub use handle::auth::AuthHandle;
1212
pub use handle::key::KeyHandle;
1313
pub use handle::nv_index::NvIndexHandle;
@@ -18,9 +18,9 @@ pub(crate) mod handle_conversion {
1818
pub(crate) use super::handle::conversions::*;
1919
}
2020
mod handle;
21-
/////////////////////////////////////////////////////////
22-
/// TPM Handles
23-
/////////////////////////////////////////////////////////
21+
// ///////////////////////////////////////////////////////
22+
// TPM Handles
23+
// ///////////////////////////////////////////////////////
2424
pub use tpm::attached_component::AttachedComponentTpmHandle;
2525
pub use tpm::hmac_session::HmacSessionTpmHandle;
2626
pub use tpm::loaded_session::LoadedSessionTpmHandle;

tss-esapi/src/interface_types/resource_handles.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ impl TryFrom<TpmHandle> for HierarchyAuth {
206206
}
207207
}
208208
}
209-
//////////////////////////////////////////////////////////////////////////////////
210-
/// TODO: HierarchyPolicy
211-
//////////////////////////////////////////////////////////////////////////////////
209+
// ////////////////////////////////////////////////////////////////////////////////
210+
// TODO: HierarchyPolicy
211+
// ////////////////////////////////////////////////////////////////////////////////
212212

213213
//////////////////////////////////////////////////////////////////////////////////
214214
/// Platform

tss-esapi/src/structures/mod.rs

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,25 @@
1313
/// Published
1414
///
1515
/// Chapter 10: Structure Definitions
16-
17-
/////////////////////////////////////////////////////////
18-
/// The capabilitydata section
19-
/////////////////////////////////////////////////////////
16+
// ///////////////////////////////////////////////////////
17+
// The capabilitydata section
18+
// ///////////////////////////////////////////////////////
2019
mod capability_data;
2120
pub use self::capability_data::CapabilityData;
22-
/////////////////////////////////////////////////////////
23-
/// The names section
24-
/////////////////////////////////////////////////////////
21+
// ///////////////////////////////////////////////////////
22+
// The names section
23+
// ///////////////////////////////////////////////////////
2524
mod names;
2625
pub use names::name::Name;
27-
/////////////////////////////////////////////////////////
28-
/// The result section
29-
/////////////////////////////////////////////////////////
26+
// ///////////////////////////////////////////////////////
27+
// The result section
28+
// ///////////////////////////////////////////////////////
3029
mod result;
3130
pub use result::CreateKeyResult;
3231
pub use result::CreatePrimaryKeyResult;
33-
/////////////////////////////////////////////////////////
34-
/// The sized buffers section
35-
/////////////////////////////////////////////////////////
32+
// ///////////////////////////////////////////////////////
33+
// The sized buffers section
34+
// ///////////////////////////////////////////////////////
3635
mod buffers;
3736
pub use self::buffers::{
3837
attest::AttestBuffer, auth::Auth, data::Data, digest::Digest, ecc_parameter::EccParameter,
@@ -42,19 +41,19 @@ pub use self::buffers::{
4241
public::PublicBuffer, public_key_rsa::PublicKeyRsa, sensitive::SensitiveBuffer,
4342
sensitive_data::SensitiveData, symmetric_key::SymmetricKey, timeout::Timeout,
4443
};
45-
/////////////////////////////////////////////////////////
46-
/// The creation section
47-
/////////////////////////////////////////////////////////
44+
// ///////////////////////////////////////////////////////
45+
// The creation section
46+
// ///////////////////////////////////////////////////////
4847
mod creation;
4948
pub use self::creation::CreationData;
50-
/////////////////////////////////////////////////////////
51-
/// The hash section
52-
/////////////////////////////////////////////////////////
49+
// ///////////////////////////////////////////////////////
50+
// The hash section
51+
// ///////////////////////////////////////////////////////
5352
mod hash;
5453
pub use self::hash::agile::HashAgile;
55-
/////////////////////////////////////////////////////////
56-
/// The pcr section
57-
/////////////////////////////////////////////////////////
54+
// ///////////////////////////////////////////////////////
55+
// The pcr section
56+
// ///////////////////////////////////////////////////////
5857
mod pcr;
5958

6059
pub use self::pcr_slot::PcrSlot;
@@ -76,9 +75,9 @@ pub use self::pcr_select_size::PcrSelectSize;
7675
pub mod pcr_select_size {
7776
pub use super::pcr::select_size::*;
7877
}
79-
/////////////////////////////////////////////////////////
80-
/// The lists section
81-
/////////////////////////////////////////////////////////
78+
// ///////////////////////////////////////////////////////
79+
// The lists section
80+
// ///////////////////////////////////////////////////////
8281
mod lists;
8382
pub use self::digest_list::DigestList;
8483
pub mod digest_list {
@@ -132,14 +131,14 @@ pub mod command_code_attributes_list {
132131
}
133132

134133
pub(crate) use pcr::slot_collection::PcrSlotCollection;
135-
/////////////////////////////////////////////////////////
136-
/// The parameters section
137-
/////////////////////////////////////////////////////////
134+
// ///////////////////////////////////////////////////////
135+
// The parameters section
136+
// ///////////////////////////////////////////////////////
138137
mod parameters;
139138
pub use self::parameters::SymmetricCipherParameters;
140-
/////////////////////////////////////////////////////////
141-
/// The tickets section
142-
/////////////////////////////////////////////////////////
139+
// ///////////////////////////////////////////////////////
140+
// The tickets section
141+
// ///////////////////////////////////////////////////////
143142
mod tickets;
144143
pub use tickets::AuthTicket;
145144
pub use tickets::CreationTicket;
@@ -167,42 +166,42 @@ pub use tagged::{
167166
signature::Signature,
168167
symmetric::{SymmetricDefinition, SymmetricDefinitionObject},
169168
};
170-
/////////////////////////////////////////////////////////
171-
/// ECC structures
172-
/////////////////////////////////////////////////////////
169+
// ///////////////////////////////////////////////////////
170+
// ECC structures
171+
// ///////////////////////////////////////////////////////
173172
mod ecc;
174173
pub use ecc::point::EccPoint;
175-
/////////////////////////////////////////////////////////
176-
/// Signatures structures
177-
/////////////////////////////////////////////////////////
174+
// ///////////////////////////////////////////////////////
175+
// Signatures structures
176+
// ///////////////////////////////////////////////////////
178177
mod signatures;
179178
pub use signatures::{EccSignature, RsaSignature};
180-
/////////////////////////////////////////////////////////
181-
/// Attestation Structures
182-
/////////////////////////////////////////////////////////
179+
// ///////////////////////////////////////////////////////
180+
// Attestation Structures
181+
// ///////////////////////////////////////////////////////
183182
mod attestation;
184183
pub use attestation::{
185184
attest::Attest, attest_info::AttestInfo, certify_info::CertifyInfo,
186185
command_audit_info::CommandAuditInfo, creation_info::CreationInfo,
187186
nv_certify_info::NvCertifyInfo, nv_digest_certify_info::NvDigestCertifyInfo,
188187
quote_info::QuoteInfo, session_audit_info::SessionAuditInfo, time_attest_info::TimeAttestInfo,
189188
};
190-
/////////////////////////////////////////////////////////
191-
/// Clock/Time Structures
192-
/////////////////////////////////////////////////////////
189+
// ///////////////////////////////////////////////////////
190+
// Clock/Time Structures
191+
// ///////////////////////////////////////////////////////
193192
mod clock;
194193
pub use clock::{clock_info::ClockInfo, time_info::TimeInfo};
195-
/////////////////////////////////////////////////////////
196-
/// Property Structures
197-
/////////////////////////////////////////////////////////
194+
// ///////////////////////////////////////////////////////
195+
// Property Structures
196+
// ///////////////////////////////////////////////////////
198197
mod property;
199198
pub use property::{
200199
algorithm_property::AlgorithmProperty, tagged_pcr_select::TaggedPcrSelect,
201200
tagged_property::TaggedProperty,
202201
};
203202

204-
/////////////////////////////////////////////////////////
205-
/// NV structures
206-
/////////////////////////////////////////////////////////
203+
// ///////////////////////////////////////////////////////
204+
// NV structures
205+
// ///////////////////////////////////////////////////////
207206
mod nv;
208207
pub use nv::storage::{NvPublic, NvPublicBuilder};

tss-esapi/src/structures/nv/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2020 Contributors to the Parsec project.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
/// This module contains code that deals with the non volatile
5-
/// parts of the tpm.
4+
//! This module contains code that deals with the non volatile
5+
//! parts of the tpm.
66
77
/// Non volatile storage module.
88
pub mod storage;

tss-esapi/tests/valgrind.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
set -euf -o pipefail
1010

11+
if [[ ! -z ${RUST_TOOLCHAIN_VERSION:+x} ]]; then
12+
rustup override set ${RUST_TOOLCHAIN_VERSION}
13+
fi
14+
1115
#################################
1216
# Run the TPM simulation server #
1317
#################################

0 commit comments

Comments
 (0)