Skip to content

Commit 03031e6

Browse files
authored
Maintenance PR for clippy, license and authors (#601)
* Maintenance PR for clippy, license and authors * remove author from libraries
1 parent 7769e78 commit 03031e6

Some content is hidden

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

42 files changed

+304
-281
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = [
55
"Fabian Kaczmarczyck <[email protected]>",
66
"Guillaume Endignoux <[email protected]>",
77
"Jean-Michel Picod <[email protected]>",
8+
"Julien Cretin <[email protected]>",
89
]
910
license = "Apache-2.0"
1011
edition = "2018"

fuzz/fuzz_helper/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn initialize(ctap: &mut Ctap<TestEnv>) -> ChannelID {
8585
cmd: CtapHidCommand::Init,
8686
payload: nonce,
8787
};
88-
let mut assembler_reply = MessageAssembler::new();
88+
let mut assembler_reply = MessageAssembler::default();
8989
let mut result_cid: ChannelID = Default::default();
9090
for pkt_request in HidPacketIterator::new(message).unwrap() {
9191
for pkt_reply in ctap.process_hid_packet(&pkt_request, Transport::MainHid) {
@@ -124,7 +124,7 @@ fn is_type(data: &[u8], input_type: InputType) -> bool {
124124
fn process_message(data: &[u8], ctap: &mut Ctap<TestEnv>) {
125125
let message = raw_to_message(data);
126126
if let Some(hid_packet_iterator) = HidPacketIterator::new(message) {
127-
let mut assembler_reply = MessageAssembler::new();
127+
let mut assembler_reply = MessageAssembler::default();
128128
for pkt_request in hid_packet_iterator {
129129
for pkt_reply in ctap.process_hid_packet(&pkt_request, Transport::MainHid) {
130130
// Only checks for assembling crashes, not for semantics.
@@ -140,7 +140,7 @@ fn process_message(data: &[u8], ctap: &mut Ctap<TestEnv>) {
140140
pub fn process_ctap_any_type(data: &[u8]) -> arbitrary::Result<()> {
141141
let mut unstructured = Unstructured::new(data);
142142

143-
let mut env = TestEnv::new();
143+
let mut env = TestEnv::default();
144144
env.rng().seed_from_u64(u64::arbitrary(&mut unstructured)?);
145145

146146
let data = unstructured.take_rest();
@@ -187,7 +187,7 @@ fn setup_state(
187187
pub fn process_ctap_specific_type(data: &[u8], input_type: InputType) -> arbitrary::Result<()> {
188188
let mut unstructured = Unstructured::new(data);
189189

190-
let mut env = TestEnv::new();
190+
let mut env = TestEnv::default();
191191
env.rng().seed_from_u64(u64::arbitrary(&mut unstructured)?);
192192

193193
let data = unstructured.take_rest();
@@ -221,7 +221,7 @@ pub fn process_ctap_specific_type(data: &[u8], input_type: InputType) -> arbitra
221221
pub fn process_ctap_structured(data: &[u8], input_type: InputType) -> FuzzResult<()> {
222222
let unstructured = &mut Unstructured::new(data);
223223

224-
let mut env = TestEnv::new();
224+
let mut env = TestEnv::default();
225225
env.rng().seed_from_u64(u64::arbitrary(unstructured)?);
226226
setup_customization(unstructured, env.customization_mut())?;
227227

@@ -258,13 +258,13 @@ pub fn process_ctap_structured(data: &[u8], input_type: InputType) -> FuzzResult
258258
pub fn split_assemble_hid_packets(data: &[u8]) -> arbitrary::Result<()> {
259259
let mut unstructured = Unstructured::new(data);
260260

261-
let mut env = TestEnv::new();
261+
let mut env = TestEnv::default();
262262
env.rng().seed_from_u64(u64::arbitrary(&mut unstructured)?);
263263

264264
let data = unstructured.take_rest();
265265
let message = raw_to_message(data);
266266
if let Some(hid_packet_iterator) = HidPacketIterator::new(message.clone()) {
267-
let mut assembler = MessageAssembler::new();
267+
let mut assembler = MessageAssembler::default();
268268
let packets: Vec<HidPacket> = hid_packet_iterator.collect();
269269
if let Some((last_packet, first_packets)) = packets.split_last() {
270270
for packet in first_packets {

run_desktop_tests.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright 2019 Google LLC
2+
# Copyright 2019-2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -37,9 +37,9 @@ cargo fmt --all -- --check
3737
cd ..
3838

3939
echo "Running Clippy lints..."
40-
cargo clippy --all-targets --features std -- -A clippy::new_without_default -D warnings
41-
cargo clippy --all-targets --features std,with_ctap1,ed25519,vendor_hid -- -A clippy::new_without_default -D warnings
42-
cargo clippy --all-targets --features std,with_ctap1,with_nfc,ed25519,vendor_hid -- -A clippy::new_without_default -D warnings
40+
cargo clippy --all-targets --features std -- -D warnings
41+
cargo clippy --all-targets --features std,with_ctap1,ed25519,vendor_hid -- -D warnings
42+
cargo clippy --all-targets --features std,with_ctap1,with_nfc,ed25519,vendor_hid -- -D warnings
4343

4444
echo "Building sha256sum tool..."
4545
cargo build --manifest-path third_party/tock/tools/sha256sum/Cargo.toml

src/api/attestation_store.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2022-2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
use alloc::vec::Vec;
216
use persistent_store::{StoreError, StoreUpdate};
317

src/api/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

src/api/customization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

src/api/firmware_protection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

src/api/key_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -123,7 +123,7 @@ mod test {
123123

124124
#[test]
125125
fn test_key_store() {
126-
let mut env = crate::env::test::TestEnv::new();
126+
let mut env = crate::env::test::TestEnv::default();
127127
let key_store = env.key_store();
128128

129129
// Master keys are well-defined and stable.

src/api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2022-2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

src/api/upgrade_storage/helper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2021 Google LLC
1+
// Copyright 2019-2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)