diff --git a/Cargo.toml b/Cargo.toml index 421dcb6..5978c2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ edition = "2018" [dependencies] libtock_core = { path = "third_party/libtock-rs/core" } libtock_drivers = { path = "third_party/libtock-drivers" } -#lang_items = { path = "third_party/lang-items" } +lang_items = { path = "third_party/lang-items" } cbor = { path = "libraries/cbor" } crypto = { path = "libraries/crypto" } byteorder = { version = "1", default-features = false } @@ -20,11 +20,10 @@ arrayref = "0.3.6" subtle = { version = "2.2", default-features = false, features = ["nightly"] } [features] -#debug_allocations = ["lang_items/debug_allocations"] +debug_allocations = ["lang_items/debug_allocations"] debug_ctap = ["crypto/derive_debug", "libtock_drivers/debug_ctap"] -#panic_console = ["lang_items/panic_console"] -std = ["cbor/std", "crypto/std", "crypto/derive_debug"] -#, "lang_items/std"] +panic_console = ["lang_items/panic_console"] +std = ["cbor/std", "crypto/std", "crypto/derive_debug", "lang_items/std"] ram_storage = [] verbose = ["debug_ctap", "libtock_drivers/verbose_usb"] with_ctap1 = ["crypto/with_ctap1"] diff --git a/src/ctap/hid/mod.rs b/src/ctap/hid/mod.rs index addc09c..115bc3a 100644 --- a/src/ctap/hid/mod.rs +++ b/src/ctap/hid/mod.rs @@ -163,6 +163,7 @@ impl CtapHid { Ok(Some(message)) => { #[cfg(feature = "debug_ctap")] writeln!(&mut Console::new(), "Received message: {:02x?}", message).unwrap(); + let cid = message.cid; if !self.has_valid_channel(&message) { #[cfg(feature = "debug_ctap")] diff --git a/src/ctap/storage.rs b/src/ctap/storage.rs index a4dcaf2..f316a0f 100644 --- a/src/ctap/storage.rs +++ b/src/ctap/storage.rs @@ -17,11 +17,14 @@ use crate::ctap::data_formats::{CredentialProtectionPolicy, PublicKeyCredentialS use crate::ctap::pin_protocol_v1::PIN_AUTH_LENGTH; use crate::ctap::status_code::Ctap2StatusCode; use crate::ctap::{key_material, USE_BATCH_ATTESTATION}; +#[cfg(feature = "fuzzing")] use crate::embedded_flash::{self, StoreConfig, StoreEntry, StoreError}; use alloc::string::String; use alloc::vec::Vec; use core::convert::TryInto; use crypto::rng256::Rng256; +#[cfg(not(feature = "fuzzing"))] +use ctap2::embedded_flash::{self, StoreConfig, StoreEntry, StoreError}; #[cfg(any(test, feature = "ram_storage"))] type Storage = embedded_flash::BufferStorage; diff --git a/third_party/lang-items/Cargo.toml b/third_party/lang-items/Cargo.toml index 39ffbf0..eb1fa2e 100644 --- a/third_party/lang-items/Cargo.toml +++ b/third_party/lang-items/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT/Apache-2.0" edition = "2018" [dependencies] -libtock_core = { path = "../../third_party/libtock-rs/core", default-features = false, features = ["alloc_init", "custom_panic_handler", "custom_alloc_error_handler"] } +libtock_core = { path = "../../third_party/libtock-rs/core", default-features = false, features = ["custom_panic_handler", "custom_alloc_error_handler"] } libtock_drivers = { path = "../libtock-drivers" } linked_list_allocator = { version = "0.8.1", default-features = false }