8000 WIP: Vault2 by bunnie · Pull Request #652 · betrusted-io/xous-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WIP: Vault2 #652

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions 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 @@ -118,6 +118,7 @@ members = [
"libs/cramium-api",
"services/keystore",
"libs/precursor-hal",
"apps/vault2",
]
resolver = "2"

Expand Down
93 changes: 93 additions & 0 deletions apps/vault2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[package]
name = "vault2"
version = "0.1.0"
edition = "2021"

[dependencies]
log = "0.4.14"
num-derive = { version = "0.4.2", default-features = false }
num-traits = { version = "0.2.14", default-features = false }
xous = "0.9.66"
xous-ipc = "0.10.6"
rkyv = { version = "0.8.8", default-features = false, features = [
"std",
"alloc",
] }
log-server = { package = "xous-api-log", version = "0.1.65" }
xous-names = { package = "xous-api-names", version = "0.9.67" }
locales = { path = "../../locales" }
pddb = { path = "../../services/pddb" }
modals = { path = "../../services/modals", features = ["no-gam"] }
# backup = { path = "libraries/backup" }
byteorder = { version = "1.4.3", default-features = false }
arrayref = "0.3.6"
subtle = { version = "2.5.0", features = ["core_hint_black_box"] }
rand_core = "0.6.3"
ticktimer-server = { package = "xous-api-ticktimer", version = "0.9.65" }
userprefs = { path = "../../libs/userprefs" }
ux-api = { path = "../../libs/ux-api" }
cramium-api = { path = "../../libs/cramium-api" }
cram-hal-service = { path = "../../services/cram-hal-service", optional = true }
cramium-emu = { path = "../../services/cramium-emu", optional = true }
blitstr2 = { path = "../../libs/blitstr2" }
usb-cramium = { path = "../../services/usb-cramium" }

# opensk
# ctap-crypto = { path = "libraries/crypto" }
# cbor = { path = "libraries/cbor" }
# persistent_store = { path = "libraries/persistent_store" }
# ed25519-compact = { version = "1", default-features = false, optional = true }
# rand = { version = "0.8.5", optional = true }

# ux formatting
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
chrono = { version = "0.4.33", default-features = false, features = ["std"] }

# password generation
passwords = "3.1.9"

# totp
sha1 = "0.10.6"
hmac = "0.12.1"
digest = "0.9.0"
base32 = "0.4.0"
sha2 = { version = "0.10.8" }
sntpc = { version = "0.3.1" }
# net = { path = "../../services/net" }
# com_rs = { git = "https://github.com/betrusted-io/com_rs", rev = "891bdd3ca8e41f81510d112483e178aea3e3a921" }

# testing
random-pick = { version = "1.2.15", optional = true }

[dev-dependencies]
enum-iterator = "0.6.0"

[features]
board-baosec = [
"cram-hal-service",
"ux-api/board-baosec",
"blitstr2/board-baosec",
"usb-cramium/board-baosec",
]
hosted-baosec = [
"cramium-emu",
"ux-api/hosted-baosec",
"usb-cramium/hosted-baosec",
]

# with_ctap1 = ["ctap-crypto/with_ctap1"]
vendor_hid = []
std = []
fuzz = []
debug_ctap = []
autotest = []
multireset = [] # allows credential reset more than once per boot
vault-testing = ["random-pick"]
# introduce a slight delay after UX boxes swap, in case of race conditions. Shouldn't be necessary anymore, but kept around in case there's a new edge case we missed.
ux-swap-delay = []
osk-upgrade = [
] # placeholder to select out OpenSK's "vendor upgrade" over HID, which we don't use because we have our own upgrade path.
xous = [
] # marks xous-specific code segments deep inside the CTAP crate. Mostly to help evaluate if a patch is even feasible in the future.
# ed25519 = ["ed25519-compact"]
default = [] # testing removed for release tag
15 changes: 15 additions & 0 deletions apps/vault2/libraries/cbor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "cbor"
version = "0.1.0"
authors = [
"Fabian Kaczmarczyck <kaczmarczyck@google.com>",
"Guillaume Endignoux <guillaumee@google.com>",
"Jean-Michel Picod <jmichel@google.com>",
]
license = "Apache-2.0"
edition = "2018"

[dependencies]

[features]

26 changes: 26 additions & 0 deletions apps/vault2/libraries/cbor/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

[package]
name = "cbor-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.3"

[dependencies.cbor]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "fuzz_target_cbor"
path = "fuzz_targets/fuzz_target_cbor.rs"
test = false
doc = false
11 changes: 11 additions & 0 deletions apps/vault2/libraries/cbor/fuzz/fuzz_targets/fuzz_target_cbor.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_main]
use std::vec::Vec;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
if let Ok(value) = cbor::read(data) {
let mut result = Vec::new();
assert!(cbor::write(value, &mut result));
assert_eq!(result, data);
};
});
23 changes: 23 additions & 0 deletions apps/vault2/libraries/cbor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
// Copyright2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pub mod macros;
pub mod reader;
pub mod values;
pub mod writer;

pub use self::reader::read;
pub use self::values::{SimpleValue, Value};
pub use self::writer::write;
Loading
0