From 59a3bc03701fdbb34908d4aa65d4574e4b7f0be7 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 20 Aug 2022 00:38:21 +0800 Subject: [PATCH] cleanup patches --- Cargo.lock | 20 +++++++------------- services/net/src/main.rs | 2 +- services/shellchat/Cargo.toml | 10 ++++++---- services/shellchat/src/cmds/net_cmd.rs | 9 ++++++++- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d6506c04..763599db6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2995,9 +2995,11 @@ dependencies = [ [[package]] name = "ring" version = "0.16.20" +source = "git+https://github.com/betrusted-io/ring-xous?branch=0.16.20-fiat-rs#87163fbe825eb986e92a34623791ee299967fe09" dependencies = [ "cc", "libc", + "log", "once_cell", "rkyv", "spin 0.5.2", @@ -3134,16 +3136,6 @@ dependencies = [ "semver 1.0.9", ] -[[package]] -name = "rustls" -version = "0.20.6" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.20.6" @@ -3425,9 +3417,10 @@ dependencies = [ "png", "rand 0.8.5", "rand_chacha 0.3.1", + "ring", "rkyv", "root-keys", - "rustls 0.20.6", + "rustls", "sha2", "spectrum-analyzer", "spinor", @@ -4033,7 +4026,7 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.20.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls", "serde", "serde_json", "url", @@ -4477,8 +4470,9 @@ dependencies = [ [[package]] name = "webpki" version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "log", "ring", "untrusted", ] diff --git a/services/net/src/main.rs b/services/net/src/main.rs index 4cc3445af..d5a557c77 100644 --- a/services/net/src/main.rs +++ b/services/net/src/main.rs @@ -193,7 +193,7 @@ fn setup_icmp(iface: &mut Interface::) -> SocketHandle { fn main() -> ! { log_server::init_wait().unwrap(); - log::set_max_level(log::LevelFilter::Debug); + log::set_max_level(log::LevelFilter::Info); log::info!("my PID is {}", xous::process::id()); let xns = xous_names::XousNames::new().unwrap(); diff --git a/services/shellchat/Cargo.toml b/services/shellchat/Cargo.toml index 50408f1a4..037658d3c 100644 --- a/services/shellchat/Cargo.toml +++ b/services/shellchat/Cargo.toml @@ -73,9 +73,10 @@ tracing = {version = "0.1.35", optional = true} tracing-subscriber = {version = "0.3.11", optional = true} # for rustls testing -#rustls = "0.20.6" -rustls = {path="../../../rustls/rustls"} -webpki-roots = "0.22.4" +rustls = {version = "0.20.6", optional = true} +# rustls = {path="../../../rustls/rustls"} +webpki-roots = {version = "0.22.4", optional = true} +ring = {version = "0.16.20", optional = true} # for testing ring math functions # for the curve25519 tests # hardware acceleration adaptations are inserted into a fork of the main branch. @@ -114,4 +115,5 @@ tracking-alloc = ["tracking-allocator", "tracing", "tracing-subscriber"] dbg-ecupdate = [] # for issuing manual commands to initiate an EC update (vs UX). Also need to enable this feature in the status crate. Intended for debug only. test-rekey = [] nettest = [] # batch network tests -default = [] # "debugprint" +tls = ["rustls", "webpki-roots", "ring"] +default = ["tls"] # "debugprint" diff --git a/services/shellchat/src/cmds/net_cmd.rs b/services/shellchat/src/cmds/net_cmd.rs index 24376fbf5..d45c2902b 100644 --- a/services/shellchat/src/cmds/net_cmd.rs +++ b/services/shellchat/src/cmds/net_cmd.rs @@ -385,8 +385,15 @@ impl<'a> ShellCmdApi<'a> for NetCmd { write!(ret, "Usage: image bunniefoo.com/bunnie/bunny.png").unwrap(); } } - "tls" => { + #[cfg(feature="tls")] + "rt" => { log::set_max_level(log::LevelFilter::Trace); + ring::xous_test::p256_elem_add_test(); + log::set_max_level(log::LevelFilter::Info); + } + #[cfg(feature="tls")] + "tls" => { + log::set_max_level(log::LevelFilter::Info); log::info!("starting TLS run"); let mut root_store = rustls::RootCertStore::empty(); log::info!("create root store");