Skip to content

Commit 17316f8

Browse files
authored
Changes the persistent store code location (#765)
The code is now maintained in Wasefire. A compatble version is on crates.io, so we rename all occurances. This also means we don't have to fuzz it here anymore, and fix the latest issues from OSS-Fuzz indirectly. And we resolve the TODO around fixing clippy. It is fixed in Wasefire.
1 parent e7b0e4d commit 17316f8

41 files changed

Lines changed: 43 additions & 7759 deletions

Some content is hidden

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

Cargo.lock

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ libtock_console = { path = "third_party/libtock-rs/apis/console" }
2424
libtock_leds = { path = "third_party/libtock-rs/apis/leds" }
2525
lang_items = { path = "third_party/lang-items" }
2626
sk-cbor = { path = "libraries/cbor" }
27-
persistent_store = { path = "libraries/persistent_store" }
2827
libtock_unittest = { path = "third_party/libtock-rs/unittest", optional = true }
2928
byteorder = { version = "1", default-features = false }
3029
arrayref = "0.3.6"
3130
rand_core = "0.6.4"
31+
wasefire-store = "=0.2.4"
3232

3333
[dependencies.p256]
3434
version = "0.13.0"
@@ -38,14 +38,14 @@ features = ["ecdsa"]
3838
[dependencies.opensk]
3939
path = "libraries/opensk"
4040
default-features = false
41-
features = ["persistent_store", "software_crypto"]
41+
features = ["software_crypto", "wasefire-store"]
4242

4343
[features]
4444
config_command = ["opensk/config_command"]
4545
debug_allocations = ["lang_items/debug_allocations"]
4646
debug_ctap = ["libtock_drivers/debug_ctap", "opensk/debug_ctap"]
4747
panic_console = ["lang_items/panic_console"]
48-
std = ["lang_items/std", "persistent_store/std", "opensk/std", "libtock_unittest"]
48+
std = ["lang_items/std", "wasefire-store/std", "opensk/std", "libtock_unittest"]
4949
verbose = ["debug_ctap", "libtock_drivers/verbose_usb"]
5050
with_ctap1 = ["opensk/with_ctap1"]
5151
with_nfc = ["libtock_drivers/with_nfc"]

examples/erase_storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use libtock_drivers::result::FlexUnwrap;
2424
use libtock_leds::Leds;
2525
use libtock_platform as platform;
2626
use libtock_runtime::{set_main, stack_size, TockSyscalls};
27-
use persistent_store::{Storage, StorageIndex};
2827
use platform::DefaultConfig;
28+
use wasefire_store::{Storage, StorageIndex};
2929

3030
stack_size! {0x800}
3131
set_main! {main}

examples/store_latency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use libtock_drivers::result::FlexUnwrap;
2828
use libtock_drivers::timer::{self, Duration, Timer, Timestamp};
2929
use libtock_platform::DefaultConfig;
3030
use libtock_runtime::{set_main, stack_size, TockSyscalls};
31-
use persistent_store::{Storage as _, Store};
31+
use wasefire_store::{Storage as _, Store};
3232

3333
stack_size! {0x800}
3434
set_main! {main}

libraries/opensk/Cargo.lock

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libraries/opensk/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ rust-version = "1.80"
1313

1414
[dependencies]
1515
sk-cbor = { path = "../cbor" }
16-
persistent_store = { path = "../persistent_store", optional = true }
1716
byteorder = { version = "1", default-features = false }
1817
arrayref = "0.3.6"
1918
subtle = { version = "2.2", default-features = false, features = ["nightly"] }
@@ -27,6 +26,7 @@ hkdf = { version = "0.12.3", default-features = false, optional = true }
2726
aes = { version = "0.8.2", default-features = false, optional = true }
2827
cbc = { version = "0.1.2", default-features = false, optional = true }
2928
zeroize = { version = "1.5.7", features = ["derive"] }
29+
wasefire-store = { version = "=0.2.4", optional = true }
3030

3131
[dependencies.p256]
3232
version = "0.13.0"
@@ -38,7 +38,7 @@ optional = true
3838
default = ["config_command", "with_ctap1"]
3939
config_command = []
4040
debug_ctap = []
41-
std = ["persistent_store/std", "rand?/std_rng", "config_command", "software_crypto"]
41+
std = ["wasefire-store/std", "rand?/std_rng", "config_command", "software_crypto"]
4242
with_ctap1 = []
4343
vendor_hid = []
4444
fuzz = ["arbitrary", "std"]

libraries/opensk/fuzz/Cargo.lock

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libraries/opensk/src/ctap/status_code.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ impl From<Ctap2StatusCode> for key_store::Error {
109109
}
110110
}
111111

112-
#[cfg(feature = "persistent_store")]
113-
impl From<persistent_store::StoreError> for Ctap2StatusCode {
114-
fn from(error: persistent_store::StoreError) -> Ctap2StatusCode {
115-
use persistent_store::StoreError;
112+
#[cfg(feature = "wasefire-store")]
113+
impl From<wasefire_store::StoreError> for Ctap2StatusCode {
114+
fn from(error: wasefire_store::StoreError) -> Ctap2StatusCode {
115+
use wasefire_store::StoreError;
116116
match error {
117117
// This error is expected. The store is full.
118118
StoreError::NoCapacity => Ctap2StatusCode::CTAP2_ERR_KEY_STORE_FULL,

libraries/opensk/src/env/test/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ use crate::ctap::status_code::Ctap2StatusCode;
2929
use crate::ctap::status_code::CtapResult;
3030
use crate::env::Env;
3131
use customization::TestCustomization;
32-
use persistent_store::{BufferOptions, BufferStorage, Store};
3332
use rand::rngs::StdRng;
3433
use rand::SeedableRng;
3534
use std::sync::{Arc, Mutex};
35+
use wasefire_store::{BufferOptions, BufferStorage, Store};
3636

3737
pub mod customization;
3838

0 commit comments

Comments
 (0)