Skip to content
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

Correct increased memory usage #7

Merged
merged 47 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9e0f0da
move to serde bytes
szszszsz Jul 5, 2023
6278cb7
quick warnings fix
szszszsz Jul 5, 2023
5d91024
Update serde_bytes to latest
szszszsz Jul 5, 2023
2218f70
Get rid of the extra clone call
szszszsz Jul 5, 2023
10be743
cleanup
szszszsz Jul 5, 2023
90883bf
wip move parsing one level up
szszszsz Jul 5, 2023
8585019
wip refactor cmds routing
szszszsz Jul 5, 2023
c11ebec
fix remaining
szszszsz Jul 5, 2023
2ff4020
remove commented code
szszszsz Jul 5, 2023
0a6946c
Handle parsing errors
szszszsz Jul 5, 2023
c5da480
Reduce clone() use
szszszsz Jul 5, 2023
953607b
Reduce clone() use (2)
szszszsz Jul 5, 2023
feffdcd
Change error to suit tests
szszszsz Jul 5, 2023
38bc12d
Cargo fmt
szszszsz Jul 5, 2023
8a8c330
auto clippy
szszszsz Jul 5, 2023
d924f4a
auto clippy for usbip
szszszsz Jul 5, 2023
e30aad3
clear the right buffer
szszszsz Jul 5, 2023
49e7ab2
cargo fmt and cleanup
szszszsz Jul 5, 2023
f3c3469
Routing refactor
szszszsz Jul 5, 2023
1eabe15
use refrence directly
szszszsz Jul 5, 2023
52ee05f
cleanup
szszszsz Jul 5, 2023
2ee0ce3
Move to slices cont.
szszszsz Jul 6, 2023
4508248
Go back to bigger buffer
szszszsz Jul 6, 2023
c55c0dd
Correct error handling after routing
szszszsz Jul 6, 2023
92f1a35
Another inline
szszszsz Jul 6, 2023
9791997
Remove unnecessairy conversions
szszszsz Jul 6, 2023
c447cca
Decrease max PIN to 32 bytes
szszszsz Jul 6, 2023
18f2753
Handle serialization errors and decrease buffer
szszszsz Jul 6, 2023
c8b0faa
Inline wcstate serialization
szszszsz Jul 6, 2023
0386795
precommit: make only fmt check
szszszsz Jul 6, 2023
098ab60
cargo fmt
szszszsz Jul 6, 2023
4717d71
Clippy autofix
szszszsz Jul 6, 2023
0000bb1
Fix more warnings
szszszsz Jul 6, 2023
218d55a
cleanup
szszszsz Jul 6, 2023
8928843
Update src/lib/commands.rs
szszszsz Jul 31, 2023
59d5186
fixup
szszszsz Jul 31, 2023
bdf3695
Fix clippy warnings
szszszsz Jul 31, 2023
a3503dc
Review feedback
szszszsz Jul 31, 2023
2f0461d
Review feedback
szszszsz Jul 31, 2023
8dc2d71
Todo comments
szszszsz Jul 31, 2023
cc2d1db
Correct some udp sim example errors
szszszsz Jul 31, 2023
09a394c
CI: remove cargo tests, build and run usbip example
szszszsz Jul 31, 2023
4ebbcd4
Remove git_version dep
szszszsz Jul 31, 2023
f314426
Remove commented code
szszszsz Jul 31, 2023
19e14af
Cargo lock update
szszszsz Jul 31, 2023
6a48acb
Restore log calls
szszszsz Jul 31, 2023
101095b
Cleanup. Remove commented code
szszszsz Jul 31, 2023
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
12 changes: 11 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ heapless-bytes = { version = "0.3.0", features = ["cbor"] }
heapless = "0.7"
serde = { version = "1.0", default-features = false }
serde-indexed = "0.1.0"
serde_bytes = { version = "0.11.10", default-features = false, features=["alloc"] }
generic-array = "0.14.3"
ctap-types = "0.1"
ctaphid-dispatch = "0.1"
Expand Down
9 changes: 4 additions & 5 deletions examples/usbip/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod dispatch {
platform::Platform,
serde_extensions::{ExtensionDispatch, ExtensionId, ExtensionImpl as _},
service::ServiceResources,
types::{Bytes, Context, Location},
types::{Bytes, Context},
};
use trussed_auth::{AuthBackend, AuthContext, AuthExtension, MAX_HW_KEY_LEN};

Expand Down Expand Up @@ -180,12 +180,11 @@ use clap::Parser;
use clap_num::maybe_hex;
use trussed::backend::BackendId;
use trussed::platform::{consent, reboot, ui};
use trussed::serde_extensions::ExtensionId;

use trussed::types::Location;
use trussed::{virt, ClientImplementation, Platform};
use trussed_usbip::ClientBuilder;

use crate::dispatch::Extension;
use usbd_ctaphid::constants::MESSAGE_SIZE;
use webcrypt::{debug, info, try_debug, try_info, try_warn, warn};
use webcrypt::{Options, PeekingBypass};
Expand Down Expand Up @@ -311,7 +310,7 @@ impl trussed::platform::UserInterface for UserInterface {
fn set_status(&mut self, status: ui::Status) {
debug!("Set status: {:?}", status);
if let ui::Status::Custom(s) = status {
let cs: CustomStatus = CustomStatus::try_from(s).unwrap_or_else(|_| {
let _cs: CustomStatus = CustomStatus::try_from(s).unwrap_or_else(|_| {
warn!("Unsupported status value: {:?}", status);
CustomStatus::Unknown
});
Expand All @@ -332,7 +331,7 @@ impl trussed::platform::UserInterface for UserInterface {
self.start_time.elapsed()
}

fn reboot(&mut self, to: reboot::To) -> ! {
fn reboot(&mut self, _to: reboot::To) -> ! {
info!("Restart! ({:?})", to);
std::process::exit(25);
}
Expand Down
Loading
Loading