From b7bbda51748ef47310227ecc772ee901d2614234 Mon Sep 17 00:00:00 2001 From: zo-el Date: Tue, 14 May 2024 07:42:02 -0500 Subject: [PATCH 01/12] wip: v3 --- core/src/config.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/src/config.rs b/core/src/config.rs index 2ebed2e..059926a 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -76,6 +76,22 @@ pub enum Config { /// The pub-key in settings is the holoport key that is used for verifying login signatures settings: Settings, }, + #[serde(rename = "v3")] + V3 { + /// This is the Device Seed Bundle as a base64 string which is compatible with lair-keystore >=v0.0.8 + /// And is encoded with a password that will be needed to be used to decrypt it + device_bundle: String, + // The revocation key is usually the /0 derivation path of the master seed + revocation_pub_key: String, + // /1 derivation path of the device bundle + holoport_id: String, + /// Derivation path of the seed in this config that was generated for a Master Seed + derivation_path: String, + /// Holo registration code is used to identify and authenticate its users + registration_code: String, + /// The pub-key in settings is the holoport key that is used for verifying login signatures + settings: Settings, + }, } impl Config { From 70075dcd8cd29ba252be5da051d2aea88bfb89b5 Mon Sep 17 00:00:00 2001 From: zo-el Date: Tue, 14 May 2024 08:28:15 -0500 Subject: [PATCH 02/12] wip: v3 --- core/src/config.rs | 63 +++++++++-------------- default.nix | 69 -------------------------- gen-cli/src/main.rs | 6 ++- gen-web/src/lib.rs | 30 ++++++++--- into-base36-id/src/main.rs | 3 ++ is-valid/src/main.rs | 1 + seed-bundle-explorer/src/lib.rs | 14 ++++-- seed-bundle-explorer/tests/explorer.rs | 4 +- seed-encoder/src/main.rs | 4 +- 9 files changed, 72 insertions(+), 122 deletions(-) delete mode 100644 default.nix diff --git a/core/src/config.rs b/core/src/config.rs index 059926a..0d44bef 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -1,7 +1,6 @@ use arrayref::array_ref; use ed25519_dalek::{Digest, Sha512, SigningKey, VerifyingKey}; use failure::Error; -use rand::{rngs::OsRng, Rng}; use serde::*; pub const SEED_SIZE: usize = 32; @@ -84,7 +83,7 @@ pub enum Config { // The revocation key is usually the /0 derivation path of the master seed revocation_pub_key: String, // /1 derivation path of the device bundle - holoport_id: String, + holoport_id: PublicKey, /// Derivation path of the seed in this config that was generated for a Master Seed derivation_path: String, /// Holo registration code is used to identify and authenticate its users @@ -96,30 +95,11 @@ pub enum Config { impl Config { pub fn new( - email: String, - password: String, - maybe_seed: Option, - ) -> Result<(Self, VerifyingKey), Error> { - let (seed, admin_keypair, holochain_public_key) = - generate_keypair(email.clone(), password, maybe_seed)?; - let admin = Admin { - email, - public_key: admin_keypair.verifying_key(), - }; - - Ok(( - Config::V1 { - seed, - settings: Settings { admin }, - }, - holochain_public_key, - )) - } - - pub fn new_v2( email: String, password: String, registration_code: String, + revocation_pub_key: String, + holoport_id: PublicKey, derivation_path: String, device_bundle: String, device_pub_key: VerifyingKey, @@ -130,9 +110,11 @@ impl Config { public_key: admin_keypair.verifying_key(), }; Ok(( - Config::V2 { + Config::V3 { device_bundle, derivation_path, + revocation_pub_key, + holoport_id, registration_code, settings: Settings { admin }, }, @@ -142,26 +124,27 @@ impl Config { pub fn admin_public_key(&self) -> VerifyingKey { match self { - Config::V1 { settings, .. } | Config::V2 { settings, .. } => settings.admin.public_key, + Config::V1 { settings, .. } + | Config::V2 { settings, .. } + | Config::V3 { settings, .. } => settings.admin.public_key, } } } -fn generate_keypair( - email: String, - password: String, - maybe_seed: Option, -) -> Result<(Seed, SigningKey, VerifyingKey), Error> { - let master_seed = match maybe_seed { - None => OsRng::new()?.gen::(), - Some(s) => s, - }; - let master_secret_key = SigningKey::from_bytes(&master_seed); - let master_public_key = VerifyingKey::from(&master_secret_key); - - let admin_keypair = admin_keypair_from(master_public_key, &email, &password)?; - Ok((master_seed, admin_keypair, master_public_key)) -} +// fn generate_keypair( +// email: String, +// password: String, +// maybe_seed: Option, +// ) -> Result<(Seed, Keypair, PublicKey), Error> { +// let master_seed = match maybe_seed { +// None => OsRng::new()?.gen::(), +// Some(s) => s, +// }; +// let master_secret_key = SecretKey::from_bytes(&master_seed)?; +// let master_public_key = PublicKey::from(&master_secret_key); +// let admin_keypair = admin_keypair_from(master_public_key, &email, &password)?; +// Ok((master_seed, admin_keypair, master_public_key)) +// } pub fn admin_keypair_from( holochain_public_key: VerifyingKey, diff --git a/default.nix b/default.nix deleted file mode 100644 index adbdcd1..0000000 --- a/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ pkgs ? import ./nixpkgs.nix {} }: - -with pkgs; - -let - inherit (rust.packages.stable) rustPlatform; - inherit (darwin.apple_sdk.frameworks) CoreServices Security; -in - -{ - hpos-config-gen-cli = buildRustPackage rustPlatform { - name = "hpos-config-gen-cli"; - src = gitignoreSource ./.; - cargoDir = "gen-cli"; - - buildInputs = lib.optionals stdenv.isDarwin [ Security ]; - - doCheck = false; - }; - - hpos-config-gen-web = buildRustPackage rustPlatform rec { - name = "hpos-config-gen-web"; - src = gitignoreSource ./.; - cargoDir = "gen-web"; - - nativeBuildInputs = with buildPackages; [ - nodejs-12_x - pkgconfig - (wasm-pack.override { inherit rustPlatform; }) - ]; - - buildInputs = [ openssl ]; - - buildPhase = '' - cp -r ${npmToNix { src = "${src}/${cargoDir}"; }} node_modules - chmod -R +w node_modules - chmod +x node_modules/.bin/webpack - patchShebangs node_modules - - npm run build - ''; - - installPhase = '' - mv dist $out - ''; - - doCheck = false; - }; - - hpos-config-into-base36-id = buildRustPackage rustPlatform { - name = "hpos-config-into-base36-id"; - src = gitignoreSource ./.; - cargoDir = "into-base36-id"; - - buildInputs = lib.optionals stdenv.isDarwin [ Security ]; - - doCheck = false; - }; - - hpos-config-is-valid = buildRustPackage rustPlatform { - name = "hpos-config-is-valid"; - src = gitignoreSource ./.; - cargoDir = "is-valid"; - - buildInputs = lib.optionals stdenv.isDarwin [ Security ]; - - doCheck = false; - }; -} diff --git a/gen-cli/src/main.rs b/gen-cli/src/main.rs index fe642c1..54c3db5 100644 --- a/gen-cli/src/main.rs +++ b/gen-cli/src/main.rs @@ -28,6 +28,8 @@ struct Args { flag_email: String, flag_password: String, flag_registration_code: String, + flag_revocation_pub_key: String, + flag_holoport_id: PublicKey, flag_derivation_path: String, flag_device_bundle: String, flag_seed_from: Option, @@ -52,10 +54,12 @@ fn main() -> Result<(), Error> { let secret_key = SigningKey::from_bytes(&seed); - let (config, public_key) = Config::new_v2( + let (config, public_key) = Config::new( args.flag_email, args.flag_password, args.flag_registration_code, + args.flag_revocation_pub_key, + args.flag_holoport_id, args.flag_derivation_path, args.flag_device_bundle, VerifyingKey::from(&secret_key), diff --git a/gen-web/src/lib.rs b/gen-web/src/lib.rs index 719438f..926521d 100644 --- a/gen-web/src/lib.rs +++ b/gen-web/src/lib.rs @@ -16,22 +16,34 @@ fn config_raw( email: String, password: String, registration_code: String, + revocation_pub_key: String, + holoport_id: Vec, derivation_path: String, device_bundle: String, device_pub_key: String, ) -> Result { - let bytes: [u8; 32] = - match (base64::decode_config(device_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32].try_into() { - Ok(b) => b, - Err(_) => return Err(format_err!("Device pub key is not 32 bytes in size")), - }; + /* + <<<<<<< HEAD + let bytes: [u8; 32] = + match (base64::decode_config(device_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32].try_into() { + Ok(b) => b, + Err(_) => return Err(format_err!("Device pub key is not 32 bytes in size")), + }; - let device_pub_key: VerifyingKey = VerifyingKey::from_bytes(&bytes)?; + let device_pub_key: VerifyingKey = VerifyingKey::from_bytes(&bytes)?; - let (config, public_key) = Config::new_v2( + let (config, public_key) = Config::new_v2( + =======*/ + let device_pub_key: PublicKey = base64::decode_config(&device_pub_key, base64::URL_SAFE_NO_PAD) + .map(|bytes| PublicKey::from_bytes(&bytes))??; + let holoport_id = PublicKey::from_bytes(&holoport_id)?; + let (config, public_key) = Config::new( + //>>>>>>> 1feccc9 (wip: v3) email, password, registration_code, + revocation_pub_key, + holoport_id, derivation_path, device_bundle, device_pub_key, @@ -51,6 +63,8 @@ pub fn config( email: String, password: String, registration_code: String, + revocation_pub_key: String, + holoport_id: Vec, derivation_path: String, device_bundle: String, device_pub_key: String, @@ -59,6 +73,8 @@ pub fn config( email, password, registration_code, + revocation_pub_key, + holoport_id, derivation_path, device_bundle, device_pub_key, diff --git a/into-base36-id/src/main.rs b/into-base36-id/src/main.rs index 17e9906..4e5f925 100644 --- a/into-base36-id/src/main.rs +++ b/into-base36-id/src/main.rs @@ -43,6 +43,9 @@ async fn main() -> Result<()> { ))?; println!("{}", public_key::to_base36_id(&secret.verifying_key())); } + Config::V3 { holoport_id, .. } => { + println!("{}", public_key::to_base36_id(&holoport_id)); + } } Ok(()) diff --git a/is-valid/src/main.rs b/is-valid/src/main.rs index 3bd3e7c..811fc08 100644 --- a/is-valid/src/main.rs +++ b/is-valid/src/main.rs @@ -6,5 +6,6 @@ fn main() -> Result<()> { match serde_json::from_reader(stdin())? { Config::V1 { .. } => Ok(()), Config::V2 { .. } => Ok(()), + Config::V3 { .. } => Ok(()), } } diff --git a/seed-bundle-explorer/src/lib.rs b/seed-bundle-explorer/src/lib.rs index d66709c..4cab58c 100644 --- a/seed-bundle-explorer/src/lib.rs +++ b/seed-bundle-explorer/src/lib.rs @@ -21,6 +21,7 @@ pub async fn holoport_public_key( let secret = unlock(device_bundle, passphrase).await?; Ok(secret.verifying_key()) } + Config::V3 { holoport_id, .. } => Ok(holoport_id.to_owned()), } } @@ -30,8 +31,14 @@ pub async fn holoport_key( passphrase: Option, ) -> SeedExplorerResult { match config { - Config::V1 { seed, .. } => Ok(SigningKey::from_bytes(seed)), - Config::V2 { device_bundle, .. } => { + Config::V1 { seed, .. } => { + let secret = SecretKey::from_bytes(seed)?; + Ok(Keypair { + public: PublicKey::from(&secret), + secret, + }) + } + Config::V2 { device_bundle, .. } | Config::V3 { device_bundle, .. } => { /* decode base64 string to locked device bundle password is pass for now @@ -52,7 +59,7 @@ pub async fn encoded_ed25519_keypair( let secret_key = SigningKey::from_bytes(seed); Ok(encrypt_key(&secret_key, &VerifyingKey::from(&secret_key))) } - Config::V2 { device_bundle, .. } => { + Config::V2 { device_bundle, .. } | Config::V3 { device_bundle, .. } => { /* decode base64 string to locked device bundle password is pass for now @@ -81,6 +88,7 @@ pub fn decoded_to_ed25519_keypair(blob: &String) -> SeedExplorerResult String { let mut encrypted_key = vec![ diff --git a/seed-bundle-explorer/tests/explorer.rs b/seed-bundle-explorer/tests/explorer.rs index ff80684..22341cb 100644 --- a/seed-bundle-explorer/tests/explorer.rs +++ b/seed-bundle-explorer/tests/explorer.rs @@ -20,10 +20,12 @@ mod tests { let registration_code: String = "registration-code".to_string(); let derivation_path: String = "1".to_string(); let device_bundle = "k6VoY3NiMJGWonB3xBCZ0R47aR6ctMScaYsrOLwRzSAAAcQY58NsOmNCDbniGsLgUhj5UoHjBrapiiDGxDGAa5Wqzm0pVuXGN106iyMHRk4dOf0iGWj65oCeB8-ZYXJdeflsVDY-DOuJaadfPZQExCyCrWRldmljZV9udW1iZXIAq2dlbmVyYXRlX2J5r3F1aWNrc3RhcnQtdjIuMA".to_string(); - let (config, _) = Config::new_v2( + let (config, _) = Config::new( email, password, registration_code, + "revocation_pub_key".to_string(), + PublicKey::from_bytes(&vec![0; 32]).unwrap(), derivation_path, device_bundle, get_mock_pub_key()?, diff --git a/seed-encoder/src/main.rs b/seed-encoder/src/main.rs index e2363a8..8b12e8a 100644 --- a/seed-encoder/src/main.rs +++ b/seed-encoder/src/main.rs @@ -3,7 +3,7 @@ //! use anyhow::{Context, Result}; -use ed25519_dalek::SigningKey; +use ed25519_dalek::*; use hpos_config_core::*; use hpos_config_seed_bundle_explorer::{encrypt_key, unlock}; use std::path::PathBuf; @@ -46,6 +46,8 @@ async fn main() -> Result<()> { ))?; println!("{}", encrypt_key(&secret, &secret.verifying_key())); } + // todo!("V3 not implemented"), + Config::V3 { .. } => todo!("V3 not implemented"), } Ok(()) From e8a3e262af3e5fc739da98245000d462f9f5c931 Mon Sep 17 00:00:00 2001 From: zo-el Date: Wed, 29 May 2024 16:06:54 -0500 Subject: [PATCH 03/12] fix tests --- Cargo.lock | 1 + core/src/config.rs | 20 +++++++++++--------- gen-cli/src/main.rs | 4 +--- gen-web/src/lib.rs | 10 +++------- into-base36-id/src/main.rs | 2 +- seed-bundle-explorer/Cargo.toml | 2 ++ seed-bundle-explorer/src/jasd.json | 13 +++++++++++++ seed-bundle-explorer/src/lib.rs | 5 ++++- seed-bundle-explorer/tests/explorer.rs | 3 +-- 9 files changed, 37 insertions(+), 23 deletions(-) create mode 100644 seed-bundle-explorer/src/jasd.json diff --git a/Cargo.lock b/Cargo.lock index 77d99f7..d57553d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -980,6 +980,7 @@ dependencies = [ name = "hpos-config-seed-bundle-explorer" version = "0.2.1" dependencies = [ + "base36", "base64 0.13.1", "ed25519-dalek", "hc_seed_bundle", diff --git a/core/src/config.rs b/core/src/config.rs index 0d44bef..47d4989 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -2,6 +2,8 @@ use arrayref::array_ref; use ed25519_dalek::{Digest, Sha512, SigningKey, VerifyingKey}; use failure::Error; use serde::*; + +use crate::public_key; pub const SEED_SIZE: usize = 32; fn public_key_from_base64<'de, D>(deserializer: D) -> Result @@ -80,12 +82,12 @@ pub enum Config { /// This is the Device Seed Bundle as a base64 string which is compatible with lair-keystore >=v0.0.8 /// And is encoded with a password that will be needed to be used to decrypt it device_bundle: String, - // The revocation key is usually the /0 derivation path of the master seed - revocation_pub_key: String, - // /1 derivation path of the device bundle - holoport_id: PublicKey, /// Derivation path of the seed in this config that was generated for a Master Seed - derivation_path: String, + device_derivation_path: String, + // The revocation key is usually the /0 derivation path of the master seed + revocation_pub_key: PublicKey, + // /1 derivation path of the device bundle base36 encoded + holoport_id: String, /// Holo registration code is used to identify and authenticate its users registration_code: String, /// The pub-key in settings is the holoport key that is used for verifying login signatures @@ -98,9 +100,8 @@ impl Config { email: String, password: String, registration_code: String, - revocation_pub_key: String, - holoport_id: PublicKey, - derivation_path: String, + revocation_pub_key: PublicKey, + device_derivation_path: String, device_bundle: String, device_pub_key: VerifyingKey, ) -> Result<(Self, VerifyingKey), Error> { @@ -109,10 +110,11 @@ impl Config { email, public_key: admin_keypair.verifying_key(), }; + let holoport_id = public_key::to_base36_id(&device_pub_key); Ok(( Config::V3 { device_bundle, - derivation_path, + device_derivation_path, revocation_pub_key, holoport_id, registration_code, diff --git a/gen-cli/src/main.rs b/gen-cli/src/main.rs index 54c3db5..00245f7 100644 --- a/gen-cli/src/main.rs +++ b/gen-cli/src/main.rs @@ -28,8 +28,7 @@ struct Args { flag_email: String, flag_password: String, flag_registration_code: String, - flag_revocation_pub_key: String, - flag_holoport_id: PublicKey, + flag_revocation_pub_key: PublicKey, flag_derivation_path: String, flag_device_bundle: String, flag_seed_from: Option, @@ -59,7 +58,6 @@ fn main() -> Result<(), Error> { args.flag_password, args.flag_registration_code, args.flag_revocation_pub_key, - args.flag_holoport_id, args.flag_derivation_path, args.flag_device_bundle, VerifyingKey::from(&secret_key), diff --git a/gen-web/src/lib.rs b/gen-web/src/lib.rs index 926521d..bbf55b7 100644 --- a/gen-web/src/lib.rs +++ b/gen-web/src/lib.rs @@ -16,8 +16,7 @@ fn config_raw( email: String, password: String, registration_code: String, - revocation_pub_key: String, - holoport_id: Vec, + revocation_pub_key: Vec, derivation_path: String, device_bundle: String, device_pub_key: String, @@ -36,14 +35,13 @@ fn config_raw( =======*/ let device_pub_key: PublicKey = base64::decode_config(&device_pub_key, base64::URL_SAFE_NO_PAD) .map(|bytes| PublicKey::from_bytes(&bytes))??; - let holoport_id = PublicKey::from_bytes(&holoport_id)?; + let revocation_pub_key = PublicKey::from_bytes(&revocation_pub_key)?; let (config, public_key) = Config::new( //>>>>>>> 1feccc9 (wip: v3) email, password, registration_code, revocation_pub_key, - holoport_id, derivation_path, device_bundle, device_pub_key, @@ -63,8 +61,7 @@ pub fn config( email: String, password: String, registration_code: String, - revocation_pub_key: String, - holoport_id: Vec, + revocation_pub_key: Vec, derivation_path: String, device_bundle: String, device_pub_key: String, @@ -74,7 +71,6 @@ pub fn config( password, registration_code, revocation_pub_key, - holoport_id, derivation_path, device_bundle, device_pub_key, diff --git a/into-base36-id/src/main.rs b/into-base36-id/src/main.rs index 4e5f925..cbcd140 100644 --- a/into-base36-id/src/main.rs +++ b/into-base36-id/src/main.rs @@ -44,7 +44,7 @@ async fn main() -> Result<()> { println!("{}", public_key::to_base36_id(&secret.verifying_key())); } Config::V3 { holoport_id, .. } => { - println!("{}", public_key::to_base36_id(&holoport_id)); + println!("{}", holoport_id); } } diff --git a/seed-bundle-explorer/Cargo.toml b/seed-bundle-explorer/Cargo.toml index ae3e5aa..df38207 100644 --- a/seed-bundle-explorer/Cargo.toml +++ b/seed-bundle-explorer/Cargo.toml @@ -20,3 +20,5 @@ one_err = "0.0.8" [dev-dependencies] tokio = { workspace = true, features = [ "full" ] } +hc_seed_bundle = "0.1.5" +base64 = "0.13.0" diff --git a/seed-bundle-explorer/src/jasd.json b/seed-bundle-explorer/src/jasd.json new file mode 100644 index 0000000..8be6e15 --- /dev/null +++ b/seed-bundle-explorer/src/jasd.json @@ -0,0 +1,13 @@ +{ + "device_bundle": "k6VoY3NiMJGWonB3xBCZ0R47aR6ctMScaYsrOLwRzSAAAcQY58NsOmNCDbniGsLgUhj5UoHjBrapiiDGxDGAa5Wqzm0pVuXGN106iyMHRk4dOf0iGWj65oCeB8-ZYXJdeflsVDY-DOuJaadfPZQExCyCrWRldmljZV9udW1iZXIAq2dlbmVyYXRlX2J5r3F1aWNrc3RhcnQtdjIuMA", + "revocation_pub_key": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "holoport_id": "4099r424lmhpjhqsrf253fq8pkuladttqq0k1vkf96bsiy9lnf", + "derivation_path": "1", + "registration_code": "registration-code", + "settings": { + "admin": { + "email": "jack@holo.host", + "public_key": [215, 40, 133, 123, 179, 96, 208, 91, 185, 17, 99, 109, 188, 70, 164, 254, 138, 105, 60, 69, 42, 100, 13, 34, 166, 178, 194, 10, 192, 50, 23, 208] + } + } +} \ No newline at end of file diff --git a/seed-bundle-explorer/src/lib.rs b/seed-bundle-explorer/src/lib.rs index 4cab58c..4d50794 100644 --- a/seed-bundle-explorer/src/lib.rs +++ b/seed-bundle-explorer/src/lib.rs @@ -21,7 +21,10 @@ pub async fn holoport_public_key( let secret = unlock(device_bundle, passphrase).await?; Ok(secret.verifying_key()) } - Config::V3 { holoport_id, .. } => Ok(holoport_id.to_owned()), + Config::V3 { holoport_id, .. } => { + let value = base36::decode(&holoport_id).unwrap(); + Ok(PublicKey::from_bytes(&value)?) + } } } diff --git a/seed-bundle-explorer/tests/explorer.rs b/seed-bundle-explorer/tests/explorer.rs index 22341cb..d743b7e 100644 --- a/seed-bundle-explorer/tests/explorer.rs +++ b/seed-bundle-explorer/tests/explorer.rs @@ -24,8 +24,7 @@ mod tests { email, password, registration_code, - "revocation_pub_key".to_string(), - PublicKey::from_bytes(&vec![0; 32]).unwrap(), + PublicKey::from_bytes([0; 32].as_ref()).unwrap(), derivation_path, device_bundle, get_mock_pub_key()?, From beb45be8a314c45d942449a9c90c20ce5053dc7c Mon Sep 17 00:00:00 2001 From: zo-el Date: Wed, 29 May 2024 16:14:45 -0500 Subject: [PATCH 04/12] added todos --- gen-web/src/index.js | 2 ++ seed-bundle-explorer/src/jasd.json | 13 ------------- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 seed-bundle-explorer/src/jasd.json diff --git a/gen-web/src/index.js b/gen-web/src/index.js index d0e7b43..84aa84d 100644 --- a/gen-web/src/index.js +++ b/gen-web/src/index.js @@ -614,6 +614,8 @@ * @param {Object} seed {derivationPath, deviceRoot, pubKey} */ const generateBlob = (user, seed) => { + // todo: update this fn by passing the revocation_pub_key + // todo: seed pubkey should be derived from the seed, not the deviceRoot pubKey itself const configData = config(user.email, user.password, user.registrationCode, seed.derivationPath.toString(), seed.deviceRoot, seed.pubKey) const configBlob = new Blob([configData.config], { type: 'application/json' }) diff --git a/seed-bundle-explorer/src/jasd.json b/seed-bundle-explorer/src/jasd.json deleted file mode 100644 index 8be6e15..0000000 --- a/seed-bundle-explorer/src/jasd.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "device_bundle": "k6VoY3NiMJGWonB3xBCZ0R47aR6ctMScaYsrOLwRzSAAAcQY58NsOmNCDbniGsLgUhj5UoHjBrapiiDGxDGAa5Wqzm0pVuXGN106iyMHRk4dOf0iGWj65oCeB8-ZYXJdeflsVDY-DOuJaadfPZQExCyCrWRldmljZV9udW1iZXIAq2dlbmVyYXRlX2J5r3F1aWNrc3RhcnQtdjIuMA", - "revocation_pub_key": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - "holoport_id": "4099r424lmhpjhqsrf253fq8pkuladttqq0k1vkf96bsiy9lnf", - "derivation_path": "1", - "registration_code": "registration-code", - "settings": { - "admin": { - "email": "jack@holo.host", - "public_key": [215, 40, 133, 123, 179, 96, 208, 91, 185, 17, 99, 109, 188, 70, 164, 254, 138, 105, 60, 69, 42, 100, 13, 34, 166, 178, 194, 10, 192, 50, 23, 208] - } - } -} \ No newline at end of file From b8855a98911abdb0188c294eebb3874195d6c1cb Mon Sep 17 00:00:00 2001 From: zo-el Date: Mon, 3 Jun 2024 16:30:02 -0500 Subject: [PATCH 05/12] hpos-config: tests --- Cargo.lock | 352 +++++++++++++++++++++++++++++++++++- Cargo.toml | 2 + core/Cargo.toml | 6 + core/src/config.rs | 4 + core/tests/configuration.rs | 76 ++++++++ 5 files changed, 434 insertions(+), 6 deletions(-) create mode 100644 core/tests/configuration.rs diff --git a/Cargo.lock b/Cargo.lock index d57553d..a71aa3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,21 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" version = "0.8.11" +<<<<<<< HEAD +======= +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.0.1" +>>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ @@ -45,6 +60,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "alloc-no-stdlib" version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -60,18 +76,23 @@ dependencies = [ ] [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "allocator-api2" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] +<<<<<<< HEAD name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -104,6 +125,15 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "argon2min" version = "0.3.0" @@ -204,23 +234,29 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" +<<<<<<< HEAD version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" +======= +>>>>>>> 954b405 (hpos-config: tests) version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] +<<<<<<< HEAD name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -414,6 +450,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.12" @@ -463,8 +508,33 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ +<<<<<<< HEAD "generic-array 0.14.7", "typenum", +======= + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2 0.4.9", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.61+curl-8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +>>>>>>> 954b405 (hpos-config: tests) ] [[package]] @@ -485,6 +555,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "curve25519-dalek-derive" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -496,12 +567,15 @@ dependencies = [ ] [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "dary_heap" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" [[package]] +<<<<<<< HEAD name = "der" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -521,6 +595,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "derive_arbitrary" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -561,6 +637,17 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "docopt" version = "1.1.1" @@ -621,6 +708,15 @@ dependencies = [ [[package]] name = "equivalent" version = "1.0.1" +<<<<<<< HEAD +======= +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.1" +>>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" @@ -862,6 +958,19 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" version = "0.14.5" +<<<<<<< HEAD +======= +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hc_seed_bundle" +version = "0.1.6" +>>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ @@ -877,11 +986,26 @@ checksum = "849aaef544dc9a561bcf1af4cbbc02e4cd24904b623aa1d0311f756fc2a96d38" dependencies = [ "futures", "one_err", - "rmp-serde", + "rmp-serde 1.1.1", + "rmpv", + "serde", + "serde_bytes", + "sodoken 0.0.9", +] + +[[package]] +name = "hc_seed_bundle" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1524f81cc7a05bfacd666324692d1cd46c9f8dce68aa524a4c8a993449617f6b" +dependencies = [ + "futures", + "one_err", + "rmp-serde 0.15.5", "rmpv", "serde", "serde_bytes", - "sodoken", + "sodoken 0.0.11", ] [[package]] @@ -904,9 +1028,15 @@ dependencies = [ [[package]] name = "hermit-abi" +<<<<<<< HEAD version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +======= +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +>>>>>>> 954b405 (hpos-config: tests) [[package]] name = "hpos-config-core" @@ -919,9 +1049,13 @@ dependencies = [ "blake2b_simd", "ed25519-dalek", "failure", + "hc_seed_bundle 0.2.3", "lazy_static", "rand 0.6.5", "serde", + "serde_json", + "sodoken 0.0.11", + "tokio", "url", ] @@ -983,12 +1117,12 @@ dependencies = [ "base36", "base64 0.13.1", "ed25519-dalek", - "hc_seed_bundle", + "hc_seed_bundle 0.1.6", "hpos-config-core", "one_err", - "rmp-serde", + "rmp-serde 1.1.1", "serde_json", - "sodoken", + "sodoken 0.0.9", "thiserror", "tokio", ] @@ -1192,8 +1326,23 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ +<<<<<<< HEAD "autocfg 1.3.0", "hashbrown 0.12.3", +======= + "autocfg 1.1.0", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", +>>>>>>> 954b405 (hpos-config: tests) ] [[package]] @@ -1316,9 +1465,24 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" +<<<<<<< HEAD version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +======= +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg 1.1.0", +] +>>>>>>> 954b405 (hpos-config: tests) [[package]] name = "mime" @@ -1358,7 +1522,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", +<<<<<<< HEAD "wasi", +======= + "wasi 0.11.0+wasi-snapshot-preview1", +>>>>>>> 954b405 (hpos-config: tests) "windows-sys 0.48.0", ] @@ -1407,7 +1575,11 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ +<<<<<<< HEAD "hermit-abi 0.3.9", +======= + "hermit-abi 0.3.1", +>>>>>>> 954b405 (hpos-config: tests) "libc", ] @@ -1796,6 +1968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] +<<<<<<< HEAD name = "ring" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1811,6 +1984,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "rle-decode-fast" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1829,7 +2004,22 @@ dependencies = [ [[package]] name = "rmp-serde" +<<<<<<< HEAD version = "1.3.0" +======= +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723ecff9ad04f4ad92fe1c8ca6c20d2196d9286e9c60727c4cb5511629260e9d" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rmp-serde" +version = "1.1.1" +>>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" dependencies = [ @@ -1901,6 +2091,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "rustls" version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1932,6 +2123,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1950,12 +2143,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] +<<<<<<< HEAD name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "serde" version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2050,6 +2246,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "slab" version = "0.4.9" @@ -2075,6 +2277,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "sodoken" version = "0.0.11" @@ -2091,6 +2303,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2111,6 +2324,21 @@ name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +======= +name = "sodoken" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907e0ea9699b846c2586ea5685e9abf5963fca64a5179a406e6ac02b94564e30" +dependencies = [ + "libc", + "libsodium-sys-stable", + "num_cpus", + "once_cell", + "one_err", + "parking_lot", + "tokio", +] +>>>>>>> 954b405 (hpos-config: tests) [[package]] name = "strsim" @@ -2326,7 +2554,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -2391,18 +2619,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] +<<<<<<< HEAD name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] +======= +>>>>>>> 954b405 (hpos-config: tests) name = "ureq" version = "2.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" dependencies = [ "base64 0.22.1", +<<<<<<< HEAD "brotli-decompressor", "flate2", "log", @@ -2412,6 +2644,11 @@ dependencies = [ "rustls-webpki", "url", "webpki-roots", +======= + "log", + "once_cell", + "url", +>>>>>>> 954b405 (hpos-config: tests) ] [[package]] @@ -2654,6 +2891,7 @@ dependencies = [ name = "wasmparser" version = "0.80.2" source = "registry+https://github.com/rust-lang/crates.io-index" +<<<<<<< HEAD checksum = "449167e2832691a1bff24cde28d2804e90e09586a448c8e76984792c44334a6b" [[package]] @@ -2664,6 +2902,9 @@ checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" dependencies = [ "rustls-pki-types", ] +======= +checksum = "5fe3d5405e9ea6c1317a656d6e0820912d8b7b3607823a7596117c8f666daf6f" +>>>>>>> 954b405 (hpos-config: tests) [[package]] name = "winapi" @@ -2723,6 +2964,15 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2754,6 +3004,22 @@ dependencies = [ "windows_x86_64_msvc 0.52.5", ] +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -2766,6 +3032,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -2778,6 +3050,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -2796,6 +3074,18 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -2808,6 +3098,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -2820,6 +3116,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -2832,6 +3134,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -2856,6 +3164,12 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + [[package]] name = "xattr" version = "1.3.1" @@ -2932,6 +3246,26 @@ dependencies = [ "synstructure 0.13.1", ] +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -2962,9 +3296,15 @@ dependencies = [ [[package]] name = "zip" +<<<<<<< HEAD version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775a2b471036342aa69bc5a602bc889cb0a06cda00477d0c69566757d5553d39" +======= +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "098d5d7737fb0b70814faa73c17df84f047d38dd31d13bbf2ec3fb354b5abf45" +>>>>>>> 954b405 (hpos-config: tests) dependencies = [ "arbitrary", "crc32fast", diff --git a/Cargo.toml b/Cargo.toml index b6c19d7..c4d7d39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,8 @@ members = [ "is-valid" ] +resolver = "2" + [workspace.dependencies] ed25519-dalek = "2.1.1" anyhow = "1.0" diff --git a/core/Cargo.toml b/core/Cargo.toml index 35c577f..772ba26 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -28,3 +28,9 @@ rev = "28e765e4369e19bc0126bb46acaacadf1303de22" [features] wasm-bindgen = ["rand/wasm-bindgen"] + +[dev-dependencies] +tokio = { version = "1.12.0", features = [ "full" ] } +hc_seed_bundle = "0.2.3" +sodoken = "=0.0.11" +serde_json = "1.0.117" \ No newline at end of file diff --git a/core/src/config.rs b/core/src/config.rs index 47d4989..516b90e 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -85,6 +85,10 @@ pub enum Config { /// Derivation path of the seed in this config that was generated for a Master Seed device_derivation_path: String, // The revocation key is usually the /0 derivation path of the master seed + #[serde( + deserialize_with = "public_key_from_base64", + serialize_with = "to_base64" + )] revocation_pub_key: PublicKey, // /1 derivation path of the device bundle base36 encoded holoport_id: String, diff --git a/core/tests/configuration.rs b/core/tests/configuration.rs new file mode 100644 index 0000000..b9cd003 --- /dev/null +++ b/core/tests/configuration.rs @@ -0,0 +1,76 @@ +#[cfg(test)] +mod tests { + + use ed25519_dalek::PublicKey; + use hpos_config_core::Config; + + #[tokio::test(flavor = "multi_thread")] + async fn test_hpos_config() -> Result<(), String> { + // emulate the UI + + let master = hc_seed_bundle::UnlockedSeedBundle::new_random() + .await + .unwrap(); + + let passphrase = sodoken::BufRead::from(b"test-passphrase".to_vec()); + let revocation_bundle = master.derive(0).await.unwrap(); + let revocation_pub_key = revocation_bundle.get_sign_pub_key().read_lock().to_vec(); + + let device_derivation_path = 2; + let device_bundle = master.derive(device_derivation_path).await.unwrap(); + let device_bundle_encoded_bytes = device_bundle + .lock() + .add_pwhash_cipher(passphrase) + .lock() + .await + .unwrap(); + let device_bundle_base64 = base64::encode(&device_bundle_encoded_bytes); + + // derive the holoport ID + + let holoport_id = device_bundle.derive(1).await.unwrap(); + + let holoport_id = holoport_id.get_sign_pub_key().read_lock().to_vec(); + + // initialize a new Config struct + let email = "joel@holo.host".to_string(); + let password = "password".to_string(); + let registration_code = "registration-code".to_string(); + let revocation_pub_key = PublicKey::from_bytes(&revocation_pub_key).unwrap(); + let holoport_id = PublicKey::from_bytes(&holoport_id).unwrap(); + let hpos_config = Config::new( + email.clone(), + password, + registration_code, + revocation_pub_key, + device_derivation_path.to_string(), + device_bundle_base64.clone(), + holoport_id, + ) + .unwrap(); + + assert_eq!(hpos_config.1, holoport_id.clone()); + + println!("{}", serde_json::to_string_pretty(&hpos_config.0).unwrap()); + + if let Config::V3 { + device_bundle, + device_derivation_path, + revocation_pub_key, + holoport_id, + registration_code, + settings, + } = hpos_config.0 + { + assert_eq!(device_bundle, device_bundle_base64,); + assert_eq!(device_derivation_path, device_derivation_path.to_string()); + assert_eq!(revocation_pub_key, revocation_pub_key); + assert_eq!(holoport_id, holoport_id); + assert_eq!(registration_code, registration_code); + assert_eq!(settings.admin.email, email); + return Ok(()); + } else { + return Err("Expected V3 variant".to_string()); + } + } +} From 7396ddc7517d915595d13168001797f9e4d8bed3 Mon Sep 17 00:00:00 2001 From: Matthew Geddes Date: Fri, 12 Jul 2024 13:24:02 -0700 Subject: [PATCH 06/12] Interim commit with tests passing --- Cargo.lock | 823 ++++--------------------- core/src/config.rs | 8 +- core/tests/configuration.rs | 8 +- gen-cli/src/main.rs | 2 +- gen-web/src/lib.rs | 29 +- seed-bundle-explorer/Cargo.toml | 4 +- seed-bundle-explorer/src/lib.rs | 24 +- seed-bundle-explorer/tests/explorer.rs | 3 +- 8 files changed, 179 insertions(+), 722 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a71aa3f..bb7fe62 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,21 +26,6 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" version = "0.8.11" -<<<<<<< HEAD -======= -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.0.1" ->>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ @@ -60,7 +45,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "alloc-no-stdlib" version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -76,23 +60,18 @@ dependencies = [ ] [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "allocator-api2" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] -<<<<<<< HEAD name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -125,15 +104,6 @@ dependencies = [ "derive_arbitrary", ] -[[package]] -name = "arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" -dependencies = [ - "derive_arbitrary", -] - [[package]] name = "argon2min" version = "0.3.0" @@ -234,29 +204,23 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -<<<<<<< HEAD version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -======= ->>>>>>> 954b405 (hpos-config: tests) version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -<<<<<<< HEAD name = "base64ct" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -264,9 +228,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake2-rfc" @@ -321,9 +285,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -365,9 +329,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.99" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "907d8581360765417f8f2e0e7d602733bbed60156b4465b7617243689ef9b83d" [[package]] name = "cfg-if" @@ -384,7 +348,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -450,15 +414,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -508,54 +463,27 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ -<<<<<<< HEAD "generic-array 0.14.7", "typenum", -======= - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2 0.4.9", - "winapi", -] - -[[package]] -name = "curl-sys" -version = "0.4.61+curl-8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", - "winapi", ->>>>>>> 954b405 (hpos-config: tests) ] [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", "subtle", "zeroize", ] [[package]] -<<<<<<< HEAD name = "curve25519-dalek-derive" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -563,19 +491,16 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "dary_heap" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" [[package]] -<<<<<<< HEAD name = "der" version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -595,8 +520,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "derive_arbitrary" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -604,7 +527,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -628,24 +551,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -688,9 +600,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "env_logger" @@ -708,15 +620,6 @@ dependencies = [ [[package]] name = "equivalent" version = "1.0.1" -<<<<<<< HEAD -======= -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.1" ->>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" @@ -749,7 +652,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure 0.12.6", + "synstructure", ] [[package]] @@ -869,7 +772,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -958,19 +861,6 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" version = "0.14.5" -<<<<<<< HEAD -======= -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hc_seed_bundle" -version = "0.1.6" ->>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ @@ -986,26 +876,11 @@ checksum = "849aaef544dc9a561bcf1af4cbbc02e4cd24904b623aa1d0311f756fc2a96d38" dependencies = [ "futures", "one_err", - "rmp-serde 1.1.1", + "rmp-serde", "rmpv", "serde", "serde_bytes", - "sodoken 0.0.9", -] - -[[package]] -name = "hc_seed_bundle" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1524f81cc7a05bfacd666324692d1cd46c9f8dce68aa524a4c8a993449617f6b" -dependencies = [ - "futures", - "one_err", - "rmp-serde 0.15.5", - "rmpv", - "serde", - "serde_bytes", - "sodoken 0.0.11", + "sodoken", ] [[package]] @@ -1028,15 +903,9 @@ dependencies = [ [[package]] name = "hermit-abi" -<<<<<<< HEAD version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -======= -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" ->>>>>>> 954b405 (hpos-config: tests) [[package]] name = "hpos-config-core" @@ -1049,12 +918,12 @@ dependencies = [ "blake2b_simd", "ed25519-dalek", "failure", - "hc_seed_bundle 0.2.3", + "hc_seed_bundle", "lazy_static", "rand 0.6.5", "serde", "serde_json", - "sodoken 0.0.11", + "sodoken", "tokio", "url", ] @@ -1117,12 +986,12 @@ dependencies = [ "base36", "base64 0.13.1", "ed25519-dalek", - "hc_seed_bundle 0.1.6", + "hc_seed_bundle", "hpos-config-core", "one_err", - "rmp-serde 1.1.1", + "rmp-serde", "serde_json", - "sodoken 0.0.9", + "sodoken", "thiserror", "tokio", ] @@ -1142,9 +1011,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1181,124 +1050,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "id-arena" version = "2.2.1" @@ -1310,14 +1061,12 @@ dependencies = [ [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1326,23 +1075,8 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ -<<<<<<< HEAD "autocfg 1.3.0", "hashbrown 0.12.3", -======= - "autocfg 1.1.0", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", ->>>>>>> 954b405 (hpos-config: tests) ] [[package]] @@ -1372,9 +1106,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" @@ -1435,12 +1169,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -1459,30 +1187,15 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "memchr" -<<<<<<< HEAD version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -======= -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg 1.1.0", -] ->>>>>>> 954b405 (hpos-config: tests) [[package]] name = "mime" @@ -1492,9 +1205,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -1508,9 +1221,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -1522,11 +1235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", -<<<<<<< HEAD "wasi", -======= - "wasi 0.11.0+wasi-snapshot-preview1", ->>>>>>> 954b405 (hpos-config: tests) "windows-sys 0.48.0", ] @@ -1575,11 +1284,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ -<<<<<<< HEAD "hermit-abi 0.3.9", -======= - "hermit-abi 0.3.1", ->>>>>>> 954b405 (hpos-config: tests) "libc", ] @@ -1594,9 +1299,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -1645,7 +1350,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1688,12 +1393,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "powerfmt" version = "0.2.0" @@ -1732,9 +1431,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1935,7 +1634,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -1968,7 +1667,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] -<<<<<<< HEAD name = "ring" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1984,8 +1682,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "rle-decode-fast" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2004,22 +1700,7 @@ dependencies = [ [[package]] name = "rmp-serde" -<<<<<<< HEAD version = "1.3.0" -======= -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723ecff9ad04f4ad92fe1c8ca6c20d2196d9286e9c60727c4cb5511629260e9d" -dependencies = [ - "byteorder", - "rmp", - "serde", -] - -[[package]] -name = "rmp-serde" -version = "1.1.1" ->>>>>>> 954b405 (hpos-config: tests) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" dependencies = [ @@ -2083,7 +1764,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2091,13 +1772,13 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "rustls" -version = "0.22.4" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ "log", + "once_cell", "ring", "rustls-pki-types", "rustls-webpki", @@ -2113,9 +1794,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring", "rustls-pki-types", @@ -2123,8 +1804,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2143,48 +1822,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -<<<<<<< HEAD name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "indexmap 2.2.6", "itoa", @@ -2246,12 +1922,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - [[package]] name = "slab" version = "0.4.9" @@ -2277,16 +1947,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "sodoken" version = "0.0.11" @@ -2303,7 +1963,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2324,21 +1983,6 @@ name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -======= -name = "sodoken" -version = "0.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907e0ea9699b846c2586ea5685e9abf5963fca64a5179a406e6ac02b94564e30" -dependencies = [ - "libc", - "libsodium-sys-stable", - "num_cpus", - "once_cell", - "one_err", - "parking_lot", - "tokio", -] ->>>>>>> 954b405 (hpos-config: tests) [[package]] name = "strsim" @@ -2378,9 +2022,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2395,9 +2039,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -2416,17 +2060,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "tar" version = "0.4.41" @@ -2470,22 +2103,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2531,15 +2164,20 @@ dependencies = [ ] [[package]] -name = "tinystr" -version = "0.7.6" +name = "tinyvec" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ - "displaydoc", - "zerovec", + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.38.0" @@ -2554,7 +2192,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -2567,7 +2205,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -2594,12 +2232,27 @@ dependencies = [ "version_check", ] +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -2619,61 +2272,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -<<<<<<< HEAD name = "untrusted" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -======= ->>>>>>> 954b405 (hpos-config: tests) name = "ureq" -version = "2.9.7" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" +checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" dependencies = [ "base64 0.22.1", -<<<<<<< HEAD "brotli-decompressor", "flate2", "log", "once_cell", "rustls", "rustls-pki-types", - "rustls-webpki", "url", "webpki-roots", -======= - "log", - "once_cell", - "url", ->>>>>>> 954b405 (hpos-config: tests) ] [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "vcpkg" version = "0.2.15" @@ -2750,7 +2381,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -2824,7 +2455,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2891,20 +2522,16 @@ dependencies = [ name = "wasmparser" version = "0.80.2" source = "registry+https://github.com/rust-lang/crates.io-index" -<<<<<<< HEAD checksum = "449167e2832691a1bff24cde28d2804e90e09586a448c8e76984792c44334a6b" [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] -======= -checksum = "5fe3d5405e9ea6c1317a656d6e0820912d8b7b3607823a7596117c8f666daf6f" ->>>>>>> 954b405 (hpos-config: tests) [[package]] name = "winapi" @@ -2943,7 +2570,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2961,16 +2588,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2990,34 +2608,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3028,15 +2630,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3046,15 +2642,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3064,27 +2654,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3094,15 +2672,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3112,15 +2684,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3130,15 +2696,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3148,27 +2708,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "xattr" @@ -3181,89 +2723,24 @@ dependencies = [ "rustix", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure 0.13.1", -] - -[[package]] -name = "zerocopy" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "synstructure 0.13.1", -] - [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.71", ] [[package]] @@ -3272,39 +2749,11 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "zip" -<<<<<<< HEAD version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775a2b471036342aa69bc5a602bc889cb0a06cda00477d0c69566757d5553d39" -======= -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "098d5d7737fb0b70814faa73c17df84f047d38dd31d13bbf2ec3fb354b5abf45" ->>>>>>> 954b405 (hpos-config: tests) dependencies = [ "arbitrary", "crc32fast", diff --git a/core/src/config.rs b/core/src/config.rs index 516b90e..9a9d030 100644 --- a/core/src/config.rs +++ b/core/src/config.rs @@ -89,7 +89,7 @@ pub enum Config { deserialize_with = "public_key_from_base64", serialize_with = "to_base64" )] - revocation_pub_key: PublicKey, + revocation_pub_key: VerifyingKey, // /1 derivation path of the device bundle base36 encoded holoport_id: String, /// Holo registration code is used to identify and authenticate its users @@ -104,7 +104,7 @@ impl Config { email: String, password: String, registration_code: String, - revocation_pub_key: PublicKey, + revocation_pub_key: VerifyingKey, device_derivation_path: String, device_bundle: String, device_pub_key: VerifyingKey, @@ -141,13 +141,13 @@ impl Config { // email: String, // password: String, // maybe_seed: Option, -// ) -> Result<(Seed, Keypair, PublicKey), Error> { +// ) -> Result<(Seed, Keypair, VerifyingKey), Error> { // let master_seed = match maybe_seed { // None => OsRng::new()?.gen::(), // Some(s) => s, // }; // let master_secret_key = SecretKey::from_bytes(&master_seed)?; -// let master_public_key = PublicKey::from(&master_secret_key); +// let master_public_key = VerifyingKey::from(&master_secret_key); // let admin_keypair = admin_keypair_from(master_public_key, &email, &password)?; // Ok((master_seed, admin_keypair, master_public_key)) // } diff --git a/core/tests/configuration.rs b/core/tests/configuration.rs index b9cd003..09eb101 100644 --- a/core/tests/configuration.rs +++ b/core/tests/configuration.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use ed25519_dalek::PublicKey; + use ed25519_dalek::VerifyingKey; use hpos_config_core::Config; #[tokio::test(flavor = "multi_thread")] @@ -36,8 +36,10 @@ mod tests { let email = "joel@holo.host".to_string(); let password = "password".to_string(); let registration_code = "registration-code".to_string(); - let revocation_pub_key = PublicKey::from_bytes(&revocation_pub_key).unwrap(); - let holoport_id = PublicKey::from_bytes(&holoport_id).unwrap(); + let rev_key_bytes = revocation_pub_key[0..32].try_into().unwrap(); + let revocation_pub_key = VerifyingKey::from_bytes(&rev_key_bytes).unwrap(); + let holoport_id_bytes = holoport_id[0..32].try_into().unwrap(); + let holoport_id = VerifyingKey::from_bytes(&holoport_id_bytes).unwrap(); let hpos_config = Config::new( email.clone(), password, diff --git a/gen-cli/src/main.rs b/gen-cli/src/main.rs index 00245f7..71fe467 100644 --- a/gen-cli/src/main.rs +++ b/gen-cli/src/main.rs @@ -28,7 +28,7 @@ struct Args { flag_email: String, flag_password: String, flag_registration_code: String, - flag_revocation_pub_key: PublicKey, + flag_revocation_pub_key: VerifyingKey, flag_derivation_path: String, flag_device_bundle: String, flag_seed_from: Option, diff --git a/gen-web/src/lib.rs b/gen-web/src/lib.rs index bbf55b7..8026528 100644 --- a/gen-web/src/lib.rs +++ b/gen-web/src/lib.rs @@ -21,23 +21,24 @@ fn config_raw( device_bundle: String, device_pub_key: String, ) -> Result { - /* - <<<<<<< HEAD - let bytes: [u8; 32] = - match (base64::decode_config(device_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32].try_into() { - Ok(b) => b, - Err(_) => return Err(format_err!("Device pub key is not 32 bytes in size")), - }; + let device_pub_key_bytes: [u8; 32] = + match (base64::decode_config(device_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32].try_into() { + Ok(b) => b, + Err(_) => return Err(format_err!("Device pub key is not 32 bytes in length")), + }; - let device_pub_key: VerifyingKey = VerifyingKey::from_bytes(&bytes)?; + let device_pub_key: VerifyingKey = VerifyingKey::from_bytes(&device_pub_key_bytes)?; + + let revocation_pub_key_bytes = + match (base64::decode_config(revocation_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32] + .try_into() + { + Ok(b) => b, + Err(_) => return Err(format_err!("Revocation key not 32 bytes in length")), + }; + let revocation_pub_key = VerifyingKey::from_bytes(&revocation_pub_key_bytes)?; - let (config, public_key) = Config::new_v2( - =======*/ - let device_pub_key: PublicKey = base64::decode_config(&device_pub_key, base64::URL_SAFE_NO_PAD) - .map(|bytes| PublicKey::from_bytes(&bytes))??; - let revocation_pub_key = PublicKey::from_bytes(&revocation_pub_key)?; let (config, public_key) = Config::new( - //>>>>>>> 1feccc9 (wip: v3) email, password, registration_code, diff --git a/seed-bundle-explorer/Cargo.toml b/seed-bundle-explorer/Cargo.toml index df38207..077cecb 100644 --- a/seed-bundle-explorer/Cargo.toml +++ b/seed-bundle-explorer/Cargo.toml @@ -17,8 +17,8 @@ sodoken = "0.0.11" rmp-serde = "1.1.0" thiserror = "1.0" one_err = "0.0.8" +base36 = "0.0.1" [dev-dependencies] tokio = { workspace = true, features = [ "full" ] } -hc_seed_bundle = "0.1.5" -base64 = "0.13.0" +base64 = { workspace = true } diff --git a/seed-bundle-explorer/src/lib.rs b/seed-bundle-explorer/src/lib.rs index 4d50794..37eacba 100644 --- a/seed-bundle-explorer/src/lib.rs +++ b/seed-bundle-explorer/src/lib.rs @@ -22,8 +22,18 @@ pub async fn holoport_public_key( Ok(secret.verifying_key()) } Config::V3 { holoport_id, .. } => { - let value = base36::decode(&holoport_id).unwrap(); - Ok(PublicKey::from_bytes(&value)?) + let value = match (base36::decode(&holoport_id) + .map_err(|err| SeedExplorerError::Generic(err.to_string()))?)[0..32] + .try_into() + { + Ok(b) => b, + Err(_) => { + return Err(SeedExplorerError::Generic( + "Holoport host public key is not 32 bytes in length".into(), + )) + } + }; + Ok(VerifyingKey::from_bytes(&value)?) } } } @@ -34,13 +44,7 @@ pub async fn holoport_key( passphrase: Option, ) -> SeedExplorerResult { match config { - Config::V1 { seed, .. } => { - let secret = SecretKey::from_bytes(seed)?; - Ok(Keypair { - public: PublicKey::from(&secret), - secret, - }) - } + Config::V1 { seed, .. } => Ok(SigningKey::from_bytes(seed)), Config::V2 { device_bundle, .. } | Config::V3 { device_bundle, .. } => { /* decode base64 string to locked device bundle @@ -67,7 +71,7 @@ pub async fn encoded_ed25519_keypair( decode base64 string to locked device bundle password is pass for now unlock it and get the signPubKey - Pass the Seed and PublicKey into `encrypt_key(seed, pubKey)` + Pass the Seed and VerifyingKey into `encrypt_key(seed, pubKey)` */ let secret = unlock(device_bundle, passphrase).await?; Ok(encrypt_key(&secret, &secret.verifying_key())) diff --git a/seed-bundle-explorer/tests/explorer.rs b/seed-bundle-explorer/tests/explorer.rs index d743b7e..d62dda3 100644 --- a/seed-bundle-explorer/tests/explorer.rs +++ b/seed-bundle-explorer/tests/explorer.rs @@ -20,11 +20,12 @@ mod tests { let registration_code: String = "registration-code".to_string(); let derivation_path: String = "1".to_string(); let device_bundle = "k6VoY3NiMJGWonB3xBCZ0R47aR6ctMScaYsrOLwRzSAAAcQY58NsOmNCDbniGsLgUhj5UoHjBrapiiDGxDGAa5Wqzm0pVuXGN106iyMHRk4dOf0iGWj65oCeB8-ZYXJdeflsVDY-DOuJaadfPZQExCyCrWRldmljZV9udW1iZXIAq2dlbmVyYXRlX2J5r3F1aWNrc3RhcnQtdjIuMA".to_string(); + let rev_key: [u8; 32] = [0 as u8; 32]; // TODO: Fill this in with something let (config, _) = Config::new( email, password, registration_code, - PublicKey::from_bytes([0; 32].as_ref()).unwrap(), + VerifyingKey::from_bytes(&rev_key).unwrap(), derivation_path, device_bundle, get_mock_pub_key()?, From d1c7a788406619307409ee72a78a557a5f39bc27 Mon Sep 17 00:00:00 2001 From: Patrick Winfield Date: Thu, 18 Jul 2024 12:32:01 -0600 Subject: [PATCH 07/12] ui tweaks and v3 updates --- gen-web/package.json | 2 +- gen-web/res/index.html | 33 +++++--------- gen-web/res/style.css | 21 ++++++++- gen-web/src/index.js | 100 ++++++++++++++++++++++++++++++++--------- gen-web/src/lib.rs | 4 +- gen-web/src/utils.js | 3 +- gen-web/yarn.lock | 34 +++++++++----- 7 files changed, 137 insertions(+), 60 deletions(-) diff --git a/gen-web/package.json b/gen-web/package.json index 6aee3e6..4873f92 100644 --- a/gen-web/package.json +++ b/gen-web/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@babel/runtime": "^7.15.4", - "@holochain/hc-seed-bundle": "0.0.3", + "@holochain/hc-seed-bundle": "0.1.1", "core-js": "^3.18.3", "crypto-browserify": "^3.12.0", "file-saver": "^2.0.2", diff --git a/gen-web/res/index.html b/gen-web/res/index.html index d258ca7..4557006 100644 --- a/gen-web/res/index.html +++ b/gen-web/res/index.html @@ -21,21 +21,9 @@ src="assets/images/holo-banner-white.svg" />

Time for Liftoff!

You’re all set!

-
+

Context: -

- A registration code can be used to register either one HoloPort or many HoloPorts during Quickstart. If you don’t have your registration code, please register at https://register.holo.host/holo -

-

- Your passphrase is an important thing to remember since it will decrypt your seed file—keep it somewhere very safe! -

-

- Remember, you will need BOTH the seed and your passphrase to restore any keys that are created from this seed. -

-

- Host Console is a web interface where you can manage your HoloPort and hosting settings. -

This is where your public and private keys for your HoloPorts are generated. The keys are the basis of the cryptography in Holochain and Holo. Your private key is stored on an encrypted keystore your HoloPort, and your public key is your address on the Holo network and the first part of your web address for reaching your HoloPort. We also call that your HoloPort ID.

@@ -112,7 +100,7 @@

- Connecting your HoloPort to the Holo network + Registering your HoloPort Step 1: Registration Code @@ -121,7 +109,7 @@

Step 2: Enter a passphrase - Step 3: Generate a seed file + Step 3: Generate your master seed file and revocation key Step 4: Create Host Console credentials @@ -139,10 +127,10 @@

If you do not have a registration code you need to begin at https://register.holo.host/holo. Otherwise, click the “next” button and enter the registration code you received in your email.

Enter your email address and the registration code you received.

-

Make your passphrase as strong as possible. It should be long, include a mix of many different types of characters, and be hard to guess.

+

Make your passphrase as strong as possible. It should be long, include a mix of many different types of characters, and be hard to guess. Save it somewhere safe.

You can optionally turn off your internet while doing this for added security.

-

Click the button below to generate and save your seed file. You will need to save it to your hard drive or to a USB drive that is NOT the same USB drive used for your HoloPort.

-

Create a Host Console password for your primary HoloPort.

+

Click the button below to generate and save your master seed file and revocation key. You will need to save it to your hard drive or to a USB drive that is NOT the same USB drive used for your HoloPort.

+

Host Console is where you can manage your HoloPort and hosting settings. Create a Host Console password for your HoloPort.

Click the button below to download the configuration file, and then move the file to the HoloPort USB drive. The filename must be for your HoloPort to read it.

Safely eject the USB from your computer, power on your HoloPort, and insert the USB into the associated HoloPort when the LED light is solid blue.

Do you have additional HoloPorts that you’d like to register at this time?

@@ -281,8 +269,7 @@

Generating Your Keys

-
The next two steps are where you create and save your seed file, which is the basis of your identity.
-
It is super important for you to save the seed file and the passphrase you create here somewhere safe—and somewhere you will remember. It will be used in the future if you need to regenerate passwords or if you need to register additional HoloPorts. You can disconnect from the Internet now if you would like, and continue using Quickstart.
+
The next two steps are where you create and save your master seed file and revocation key. It is super important for you to save the downloaded file and the passphrase you create here somewhere safe. It will be used in the future if you need to regenerate passwords or if you need to register additional HoloPorts.
@@ -297,11 +284,11 @@

Generating Your Keys

-
Did you remember to write down your passphrase in a safe and memorable place?
+
Did you remember to write down your passphrase?
-
- +
+ Go back

diff --git a/gen-web/res/style.css b/gen-web/res/style.css index d349801..09ec2d6 100644 --- a/gen-web/res/style.css +++ b/gen-web/res/style.css @@ -579,6 +579,17 @@ body.step6 .image-block-item { align-items: self-end; } +.modal-body div.vert-buttons { + display: flex; + flex-direction: column; + width: 320px; + height: 105px; + justify-content: space-between; + align-items: center; + margin-top: 16px; + margin-bottom: 0px; +} + .lower-right { margin-top: auto; margin-left: auto; @@ -633,8 +644,14 @@ button { } .modal-button { - color: #5C4DA6; - border-color: #5C4DA6; + color: #313C59; + cursor: pointer; + text-decoration: underline; + font-size: 16px; + background-color: #ffffff; + width: 151px; + height: 42px; + box-sizing: border-box; } .action-button, diff --git a/gen-web/src/index.js b/gen-web/src/index.js index 84aa84d..e388574 100644 --- a/gen-web/src/index.js +++ b/gen-web/src/index.js @@ -11,9 +11,13 @@ validatePassphrae } = await import('./validation') const { genConfigFileName, toBase64 } = await import('./utils') const SEED_FILE_NAME = 'master-seed' + const REVOCATION_KEY_FILE_NAME = 'revocation-key' const MEMBRANE_PROOF_SERVICE_URL = process.env.MEMBRANE_PROOF_SERVICE_URL + const REVOCATION_KEY_DEVICE_NUMBER = 0 + const HOLO_PORT_STARTING_DEVICE_NUMBER = 1 + let stepTracker = 0 let signalKeyGen = false let resetUserConfig = false @@ -21,7 +25,8 @@ let downloadSeedTracker = false let configFileBlob = '' let master - let deviceNumber = 0 + let revocation + let deviceNumber = HOLO_PORT_STARTING_DEVICE_NUMBER let deviceID let genSeedStartingHtml let downloadStartingHtml @@ -187,16 +192,10 @@ master = hcSeedBundle.UnlockedSeedBundle.newRandom({ bundleType: 'master' }) - master.setAppData({ - generate_by: "quickstart-v2.0" - }) - // we need the passphrase as a Uint8Array + // we need the passphrase as a Uint8Array const pw = (new TextEncoder()).encode(seedPassphrase) - // clear passphrase from memory - seedPassphrase = null - const encodedBytes = master.lock([ new hcSeedBundle.SeedCipherPwHash( hcSeedBundle.parseSecret(pw), 'minimum') @@ -206,18 +205,52 @@ console.log("Created master seed: ", master.signPubKey) const seedBlob = new Blob([toBase64(encodedBytes)], { type: 'text/plain' }) + filesaver.saveAs(seedBlob, SEED_FILE_NAME) } catch (e) { throw new Error(`Error saving config. Error: ${e}`) } + }, 1000) + + setTimeout(async () => { + try { + // setup bundler + await hcSeedBundle.seedBundleReady + + // we need the passphrase as a Uint8Array + const pw = (new TextEncoder()).encode(seedPassphrase) + + // clear passphrase from memory + seedPassphrase = null + + revocation = master.derive(REVOCATION_KEY_DEVICE_NUMBER, { + bundleType: 'revocation' + }) + + const revocationBytes = revocation.lock([ + new hcSeedBundle.SeedCipherPwHash( + hcSeedBundle.parseSecret(pw), 'minimum') + ]) + + // DEV MODE - check pub key for devices: + console.log("Created revocation seed: ", revocation.signPubKey) + + const revocationBlob = new Blob([toBase64(revocationBytes)], { type: 'text/plain' }) + + filesaver.saveAs(revocationBlob, REVOCATION_KEY_FILE_NAME) + + } catch (e) { + throw new Error(`Error saving revocation key. Error: ${e}`) + } + /* Clean State */ downloadSeedTracker = true buttons.genSeed.disabled = true - buttons.genSeed.innerHTML = 'Saved Seed File' + buttons.genSeed.innerHTML = 'Saved Seed File and revocation key' verifySeedDownloadComplete(downloadSeedTracker) - }, 1000) + }, 2000) }, download: async () => { /* Communicate visually that something is happening in the background */ @@ -226,7 +259,7 @@ setTimeout(() => { try { - filesaver.saveAs(configFileBlob, genConfigFileName(deviceNumber, deviceID)) + filesaver.saveAs(configFileBlob, genConfigFileName(HOLO_PORT_STARTING_DEVICE_NUMBER, deviceID)) } catch (e) { throw new Error(`Error saving config. Error: ${e}`) } @@ -297,7 +330,7 @@ downloadSeedTracker = false configFileBlob = '' master = undefined - deviceNumber = 0 + deviceNumber = HOLO_PORT_STARTING_DEVICE_NUMBER deviceID = undefined updateProgressBar(3, rewind) updateUiStep(2) @@ -416,7 +449,7 @@ verifySeedDownloadComplete() } else if (stepTracker === 4) { inlineVariables.emailReadOnly.value = inputs.email.value.toLowerCase() - if (deviceNumber > 0) { + if (deviceNumber > HOLO_PORT_STARTING_DEVICE_NUMBER) { buttons.prevStep.disabled = true } } else if (stepTracker === 5) { @@ -452,7 +485,7 @@ document.body.className = 'step1a' break case -1: - if (deviceNumber === 0) { + if (deviceNumber === HOLO_PORT_STARTING_DEVICE_NUMBER) { document.body.className = 'step-exit-single' } else { document.body.className = 'step-exit-multiple' @@ -517,6 +550,7 @@ // with an invalid registration code. The purpose is simply to prevent users from wasting time setting up a // HoloPort with the wrong code. const verifyRegistrationCode = async ({ registration_code, email }) => { + return true const response = await fetch(`${MEMBRANE_PROOF_SERVICE_URL}/registration/api/v1/verify-registration-code`, { method: 'POST', @@ -564,10 +598,7 @@ const deviceRoot = master.derive(deviceNumber, { bundleType: 'deviceRoot' }) - deviceRoot.setAppData({ - device_number: deviceNumber, - generate_by: "quickstart-v2.0" - }) + // encrypts it with password: pass let pubKey = deviceRoot.signPubKey const pw = (new TextEncoder()).encode('pass') @@ -577,7 +608,9 @@ ]) // DEV MODE - check pub key for devices: + console.log(`PW: [${pw}]`) console.log("Created from master seed: ", master.signPubKey) + console.log("Revocation pub key: ", revocation.signPubKey) console.log(`Device ${deviceNumber}: ${toBase64(encodedBytes)}`) console.log(`Device signPubkey: ${pubKey}`) @@ -616,8 +649,35 @@ const generateBlob = (user, seed) => { // todo: update this fn by passing the revocation_pub_key // todo: seed pubkey should be derived from the seed, not the deviceRoot pubKey itself - const configData = config(user.email, user.password, user.registrationCode, seed.derivationPath.toString(), seed.deviceRoot, seed.pubKey) - const configBlob = new Blob([configData.config], { type: 'application/json' }) + + let configData + try { + const seedPubkey = seed.pubKey.toString() + const deviceRoot = seed.deviceRoot.toString() + const derivationPath = seed.derivationPath.toString() + const revocationPubKey = revocation.signPubKey.toString() + + console.log(`user email: ${user.email} type: ${typeof user.email}`) + console.log(`user password: ${user.password} type: ${typeof user.password}`) + console.log(`user registrationCode: ${user.registrationCode} type: ${typeof user.registrationCode}`) + console.log(`revocation signPubKey: ${revocationPubKey} type: ${typeof revocationPubKey}`) + console.log(`seed derivationPath: ${derivationPath} type: ${typeof derivationPath}`) + console.log(`seed deviceRoot: ${deviceRoot} type: ${typeof deviceRoot}`) + console.log(`seed pubKey: ${seedPubkey} type: ${typeof seedPubkey}`) + + configData = config(user.email, user.password, user.registrationCode, revocationPubKey, derivationPath, deviceRoot, seedPubkey) + } catch (e) { + inlineVariables.formErrorMessage.innerHTML = errorMessages.generateConfig + throw new Error(`Error generating config data. Error: ${e}`) + } + + let configBlob + try { + configBlob = new Blob([configData.config], { type: 'application/json' }) + } catch (e) { + inlineVariables.formErrorMessage.innerHTML = errorMessages.generateConfig + throw new Error(`Error executing generateBlob with an error. Error: ${e}`) + } /* NB: Do not delete! Keep the below in case we decide to use the HoloPort url it is available right here */ // console.log('Optional HoloPort url : ', configData.url) diff --git a/gen-web/src/lib.rs b/gen-web/src/lib.rs index 8026528..16fc69d 100644 --- a/gen-web/src/lib.rs +++ b/gen-web/src/lib.rs @@ -16,7 +16,7 @@ fn config_raw( email: String, password: String, registration_code: String, - revocation_pub_key: Vec, + revocation_pub_key: String, derivation_path: String, device_bundle: String, device_pub_key: String, @@ -62,7 +62,7 @@ pub fn config( email: String, password: String, registration_code: String, - revocation_pub_key: Vec, + revocation_pub_key: String, derivation_path: String, device_bundle: String, device_pub_key: String, diff --git a/gen-web/src/utils.js b/gen-web/src/utils.js index 4134b8f..b67282e 100644 --- a/gen-web/src/utils.js +++ b/gen-web/src/utils.js @@ -17,6 +17,7 @@ export const toBase64 = (encodedBytes) => { const FILE_PREFIX = "hp" const FILE_TYPE = ".json" +const HOLO_PORT_STARTING_DEVICE_NUMBER = 1 /** * generate file name based on the device number @@ -24,7 +25,7 @@ const FILE_TYPE = ".json" * @param {string} pubKey */ export const genConfigFileName = (deviceNumber, pubKey) => { - if (deviceNumber == 0) { + if (deviceNumber == HOLO_PORT_STARTING_DEVICE_NUMBER) { return `${FILE_PREFIX}-primary-${pubKey.substring(0, 5)}${FILE_TYPE}` } else { return `${FILE_PREFIX}-secondary-${pubKey.substring(0, 5)}${FILE_TYPE}` diff --git a/gen-web/yarn.lock b/gen-web/yarn.lock index aa8fde6..dba7465 100644 --- a/gen-web/yarn.lock +++ b/gen-web/yarn.lock @@ -893,13 +893,18 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f" integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA== -"@holochain/hc-seed-bundle@0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@holochain/hc-seed-bundle/-/hc-seed-bundle-0.0.3.tgz#34adaa8fcedf255eebdf29960b913e72cab35d69" - integrity sha512-cXLfbBMsqO1aQg/RBl66cOOhGZZObXeZ1sVhqBr1Ly/HPXoJDbQJ77BdSz/r8fn3fJE114ch8JK1ekrwAWLM3A== +"@holochain/hc-seed-bundle@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@holochain/hc-seed-bundle/-/hc-seed-bundle-0.1.1.tgz#b6fbfd0abaa2da7888ad7fdfaf54771d2423bb4f" + integrity sha512-ghHIndoNrhnzYCuN7THGVBHq5RnjNqypmjXK+LJYJ69W9tIAEuzPUymlHfK42sW4jh/LNQ83iqjVPHdJycjV1Q== dependencies: - libsodium-wrappers "^0.7.9" - tiny-msgpack "^1.0.2" + "@msgpack/msgpack" "^3.0.0-beta2" + libsodium-wrappers-sumo "^0.7.13" + +"@msgpack/msgpack@^3.0.0-beta2": + version "3.0.0-beta2" + resolved "https://registry.yarnpkg.com/@msgpack/msgpack/-/msgpack-3.0.0-beta2.tgz#5bccee30f84df220b33905e3d8249ba96deca0b7" + integrity sha512-y+l1PNV0XDyY8sM3YtuMLK5vE3/hkfId+Do8pLo/OPxfxuFAUwcGz3oiiUuV46/aBpwTzZ+mRWVMtlSKbradhw== "@types/eslint-scope@^3.7.0": version "3.7.3" @@ -3293,6 +3298,18 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +libsodium-sumo@^0.7.14: + version "0.7.14" + resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.14.tgz#9a53e09944f092f603a1e1d4446414de0b3fb0fc" + integrity sha512-2nDge6qlAjcwyslAhWfVumlkeSNK5+WCfKa2/VEq9prvlT5vP2FR0m0o5hmKaYqfsZ4TQVj5czQsimZvXDB1CQ== + +libsodium-wrappers-sumo@^0.7.13: + version "0.7.14" + resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.14.tgz#86301f14b37a77d847eb0396f2b83cdb1c47c480" + integrity sha512-0lm7ZwN5a95J2yUi8R1rgQeeaVDIWnvNzgVmXmZswis4mC+bQtbDrB+QpJlL4qklaKx3hVpJjoc6ubzJFiv64Q== + dependencies: + libsodium-sumo "^0.7.14" + libsodium-wrappers@^0.7.9: version "0.7.9" resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.9.tgz#4ffc2b69b8f7c7c7c5594a93a4803f80f6d0f346" @@ -4800,11 +4817,6 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -tiny-msgpack@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/tiny-msgpack/-/tiny-msgpack-1.0.2.tgz#78cb189e9d27b30de168284555548e298858edb3" - integrity sha1-eMsYnp0nsw3haChFVVSOKYhY7bM= - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" From 01a6d91a54fb290512e3c52702b3741410e0c602 Mon Sep 17 00:00:00 2001 From: Patrick Winfield Date: Thu, 18 Jul 2024 12:32:34 -0600 Subject: [PATCH 08/12] git ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fcca1e4..0c4f19f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ pkg/ result target/ worker/ +.cargo/ From 526188a2257cc5168fccc31cd917203201124d37 Mon Sep 17 00:00:00 2001 From: zo-el Date: Thu, 18 Jul 2024 15:15:58 -0500 Subject: [PATCH 09/12] pass pubkeys as bytes --- gen-web/src/index.js | 22 +++++++++++----------- gen-web/src/lib.rs | 33 ++++++++++++++------------------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/gen-web/src/index.js b/gen-web/src/index.js index e388574..a531512 100644 --- a/gen-web/src/index.js +++ b/gen-web/src/index.js @@ -652,20 +652,20 @@ let configData try { - const seedPubkey = seed.pubKey.toString() - const deviceRoot = seed.deviceRoot.toString() + // const seedPubkey = seed.pubKey.toString() + // const deviceRoot = seed.deviceRoot.toString() const derivationPath = seed.derivationPath.toString() - const revocationPubKey = revocation.signPubKey.toString() + // const revocationPubKey = revocation.signPubKey.toString() - console.log(`user email: ${user.email} type: ${typeof user.email}`) - console.log(`user password: ${user.password} type: ${typeof user.password}`) - console.log(`user registrationCode: ${user.registrationCode} type: ${typeof user.registrationCode}`) - console.log(`revocation signPubKey: ${revocationPubKey} type: ${typeof revocationPubKey}`) - console.log(`seed derivationPath: ${derivationPath} type: ${typeof derivationPath}`) - console.log(`seed deviceRoot: ${deviceRoot} type: ${typeof deviceRoot}`) - console.log(`seed pubKey: ${seedPubkey} type: ${typeof seedPubkey}`) + // console.log(`user email: ${user.email} type: ${typeof user.email}`) + // console.log(`user password: ${user.password} type: ${typeof user.password}`) + // console.log(`user registrationCode: ${user.registrationCode} type: ${typeof user.registrationCode}`) + // console.log(`revocation signPubKey: ${revocationPubKey} type: ${typeof revocationPubKey}`) + // console.log(`seed derivationPath: ${derivationPath} type: ${typeof derivationPath}`) + // console.log(`seed deviceRoot: ${deviceRoot} type: ${typeof deviceRoot}`) + // console.log(`seed pubKey: ${seedPubkey} type: ${typeof seedPubkey}`) - configData = config(user.email, user.password, user.registrationCode, revocationPubKey, derivationPath, deviceRoot, seedPubkey) + configData = config(user.email, user.password, user.registrationCode, revocation.signPubKey, derivationPath, seed.deviceRoot, seed.pubKey) } catch (e) { inlineVariables.formErrorMessage.innerHTML = errorMessages.generateConfig throw new Error(`Error generating config data. Error: ${e}`) diff --git a/gen-web/src/lib.rs b/gen-web/src/lib.rs index 16fc69d..d4b8e49 100644 --- a/gen-web/src/lib.rs +++ b/gen-web/src/lib.rs @@ -1,5 +1,5 @@ use ed25519_dalek::VerifyingKey; -use failure::{format_err, Error}; +use failure::Error; use hpos_config_core::{public_key, Config}; use serde::*; use wasm_bindgen::prelude::*; @@ -16,27 +16,22 @@ fn config_raw( email: String, password: String, registration_code: String, - revocation_pub_key: String, + revocation_pub_key: Vec, derivation_path: String, device_bundle: String, - device_pub_key: String, + device_pub_key: Vec, ) -> Result { - let device_pub_key_bytes: [u8; 32] = - match (base64::decode_config(device_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32].try_into() { - Ok(b) => b, - Err(_) => return Err(format_err!("Device pub key is not 32 bytes in length")), - }; - - let device_pub_key: VerifyingKey = VerifyingKey::from_bytes(&device_pub_key_bytes)?; + let device_pub_key: VerifyingKey = VerifyingKey::from_bytes( + &device_pub_key + .try_into() + .expect("Expected a Vec of length 32"), + )?; - let revocation_pub_key_bytes = - match (base64::decode_config(revocation_pub_key, base64::URL_SAFE_NO_PAD)?)[0..32] + let revocation_pub_key = VerifyingKey::from_bytes( + &revocation_pub_key .try_into() - { - Ok(b) => b, - Err(_) => return Err(format_err!("Revocation key not 32 bytes in length")), - }; - let revocation_pub_key = VerifyingKey::from_bytes(&revocation_pub_key_bytes)?; + .expect("Expected a Vec of length 32"), + )?; let (config, public_key) = Config::new( email, @@ -62,10 +57,10 @@ pub fn config( email: String, password: String, registration_code: String, - revocation_pub_key: String, + revocation_pub_key: Vec, derivation_path: String, device_bundle: String, - device_pub_key: String, + device_pub_key: Vec, ) -> Result { match config_raw( email, From 557d5bbea14fae57198c0f2e6089ce881793c494 Mon Sep 17 00:00:00 2001 From: Patrick Winfield Date: Wed, 24 Jul 2024 14:31:00 -0600 Subject: [PATCH 10/12] fix error on multiple hps, ui tweaks, and re-enable memproof check --- gen-web/res/index.html | 8 ++------ gen-web/src/index.js | 40 +++++++--------------------------------- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/gen-web/res/index.html b/gen-web/res/index.html index 4557006..b316cf3 100644 --- a/gen-web/res/index.html +++ b/gen-web/res/index.html @@ -21,15 +21,12 @@ src="assets/images/holo-banner-white.svg" />

Time for Liftoff!

You’re all set!

-
+

Context:

This is where your public and private keys for your HoloPorts are generated. The keys are the basis of the cryptography in Holochain and Holo. Your private key is stored on an encrypted keystore your HoloPort, and your public key is your address on the Holo network and the first part of your web address for reaching your HoloPort. We also call that your HoloPort ID.

-

- When you insert the USB drive into your HoloPort, it will begin connecting to the Holo network. -

Click the button below to generate and save your master seed file and revocation key. You will need to save it to your hard drive or to a USB drive that is NOT the same USB drive used for your HoloPort.

Host Console is where you can manage your HoloPort and hosting settings. Create a Host Console password for your HoloPort.

Click the button below to download the configuration file, and then move the file to the HoloPort USB drive. The filename must be for your HoloPort to read it.

-

Safely eject the USB from your computer, power on your HoloPort, and insert the USB into the associated HoloPort when the LED light is solid blue.

+

Safely eject the USB from your computer, power on your HoloPort, and insert the USB into the associated HoloPort when the LED light is solid blue. Your HoloPort is now connecting to the Holo network.

Do you have additional HoloPorts that you’d like to register at this time?

@@ -199,7 +196,6 @@

-

Note: If you have an additional HoloPort to register, you must continue to the next page to add it.

diff --git a/gen-web/src/index.js b/gen-web/src/index.js index a531512..59a6854 100644 --- a/gen-web/src/index.js +++ b/gen-web/src/index.js @@ -66,7 +66,6 @@ passwordCheckInputArea: document.querySelector('#password-check-form-item'), formErrorMessage: document.querySelector('#form-error-message'), downloadFileName: document.querySelector('#download-file'), - currentHoloportDescriptor: document.querySelector('#current-holoport-descriptor') } const nextButtonLoaderColumn = document.querySelector('#next-button-loader-column') @@ -181,7 +180,7 @@ /* Communicate visually that something is happening in the background */ buttons.genSeed.classList.add('disabled') buttons.genSeed.disabled = true - buttons.genSeed.innerHTML = 'Saving Seed File...' + buttons.genSeed.innerHTML = 'Saving Seed and Revocation Key Files...' setTimeout(async () => { try { @@ -248,7 +247,7 @@ /* Clean State */ downloadSeedTracker = true buttons.genSeed.disabled = true - buttons.genSeed.innerHTML = 'Saved Seed File and revocation key' + buttons.genSeed.innerHTML = 'Saved Seed and Revocation Key Files' verifySeedDownloadComplete(downloadSeedTracker) }, 2000) }, @@ -343,7 +342,6 @@ loop: () => { deviceNumber++ downloadConfigTracker = false - inlineVariables.currentHoloportDescriptor.innerHTML = 'additional' updateProgressBar(6, true) updateProgressBar(5, true) updateUiStep(4) @@ -550,7 +548,7 @@ // with an invalid registration code. The purpose is simply to prevent users from wasting time setting up a // HoloPort with the wrong code. const verifyRegistrationCode = async ({ registration_code, email }) => { - return true + const response = await fetch(`${MEMBRANE_PROOF_SERVICE_URL}/registration/api/v1/verify-registration-code`, { method: 'POST', @@ -607,13 +605,6 @@ hcSeedBundle.parseSecret(pw), 'minimum') ]) - // DEV MODE - check pub key for devices: - console.log(`PW: [${pw}]`) - console.log("Created from master seed: ", master.signPubKey) - console.log("Revocation pub key: ", revocation.signPubKey) - console.log(`Device ${deviceNumber}: ${toBase64(encodedBytes)}`) - console.log(`Device signPubkey: ${pubKey}`) - // pass seed into the blob let seed = { derivationPath: deviceNumber, @@ -647,36 +638,19 @@ * @param {Object} seed {derivationPath, deviceRoot, pubKey} */ const generateBlob = (user, seed) => { - // todo: update this fn by passing the revocation_pub_key - // todo: seed pubkey should be derived from the seed, not the deviceRoot pubKey itself - + + let configBlob let configData + try { - // const seedPubkey = seed.pubKey.toString() - // const deviceRoot = seed.deviceRoot.toString() const derivationPath = seed.derivationPath.toString() - // const revocationPubKey = revocation.signPubKey.toString() - // console.log(`user email: ${user.email} type: ${typeof user.email}`) - // console.log(`user password: ${user.password} type: ${typeof user.password}`) - // console.log(`user registrationCode: ${user.registrationCode} type: ${typeof user.registrationCode}`) - // console.log(`revocation signPubKey: ${revocationPubKey} type: ${typeof revocationPubKey}`) - // console.log(`seed derivationPath: ${derivationPath} type: ${typeof derivationPath}`) - // console.log(`seed deviceRoot: ${deviceRoot} type: ${typeof deviceRoot}`) - // console.log(`seed pubKey: ${seedPubkey} type: ${typeof seedPubkey}`) configData = config(user.email, user.password, user.registrationCode, revocation.signPubKey, derivationPath, seed.deviceRoot, seed.pubKey) - } catch (e) { - inlineVariables.formErrorMessage.innerHTML = errorMessages.generateConfig - throw new Error(`Error generating config data. Error: ${e}`) - } - - let configBlob - try { configBlob = new Blob([configData.config], { type: 'application/json' }) } catch (e) { inlineVariables.formErrorMessage.innerHTML = errorMessages.generateConfig - throw new Error(`Error executing generateBlob with an error. Error: ${e}`) + throw new Error(`Error executing generateBlob with an error. Error: ${e}`) } /* NB: Do not delete! Keep the below in case we decide to use the HoloPort url it is available right here */ From 0a2a37ac542084ff706c3fe6f5f0cdd4b96895fb Mon Sep 17 00:00:00 2001 From: Patrick Winfield Date: Thu, 25 Jul 2024 14:12:03 -0600 Subject: [PATCH 11/12] design review changes --- gen-web/res/index.html | 25 +++---------------------- gen-web/res/style.css | 2 +- gen-web/src/index.js | 26 +++----------------------- 3 files changed, 7 insertions(+), 46 deletions(-) diff --git a/gen-web/res/index.html b/gen-web/res/index.html index b316cf3..7763780 100644 --- a/gen-web/res/index.html +++ b/gen-web/res/index.html @@ -112,7 +112,7 @@

Step 4: Create Host Console credentials - Step 5: Create your keys and save them + Step 5: Generate the HoloPort configuration file Step 6: Connect to the Holo Network @@ -128,7 +128,7 @@

You can optionally turn off your internet while doing this for added security.

Click the button below to generate and save your master seed file and revocation key. You will need to save it to your hard drive or to a USB drive that is NOT the same USB drive used for your HoloPort.

Host Console is where you can manage your HoloPort and hosting settings. Create a Host Console password for your HoloPort.

-

Click the button below to download the configuration file, and then move the file to the HoloPort USB drive. The filename must be for your HoloPort to read it.

+

Click the button below to download the configuration file that contains your device seed, and then move the file to the HoloPort USB drive. The filename must be for your HoloPort to read it.

Safely eject the USB from your computer, power on your HoloPort, and insert the USB into the associated HoloPort when the LED light is solid blue. Your HoloPort is now connecting to the Holo network.

Do you have additional HoloPorts that you’d like to register at this time?

@@ -154,13 +154,12 @@

-

Tip: Write down or store your passphrase in a password manager.

@@ -272,24 +271,6 @@

Generating Your Keys

- - diff --git a/gen-web/res/style.css b/gen-web/res/style.css index 09ec2d6..868b410 100644 --- a/gen-web/res/style.css +++ b/gen-web/res/style.css @@ -912,7 +912,7 @@ a { display: flex; } -#modal-passphrase-intro, #modal-passphrase-outro, #change-seed-modal { +#modal-passphrase-intro, #change-seed-modal { display: none; } diff --git a/gen-web/src/index.js b/gen-web/src/index.js index 59a6854..1d08d26 100644 --- a/gen-web/src/index.js +++ b/gen-web/src/index.js @@ -124,9 +124,7 @@ return } seedPassphrase = inputs.seedPassphrase.value - if (!await confirmPassphraseWritten()) { - return - } + updateUiStep(3) updateProgressBar(2) break @@ -180,7 +178,7 @@ /* Communicate visually that something is happening in the background */ buttons.genSeed.classList.add('disabled') buttons.genSeed.disabled = true - buttons.genSeed.innerHTML = 'Saving Seed and Revocation Key Files...' + buttons.genSeed.innerHTML = 'Saving Seed & Key Files...' setTimeout(async () => { try { @@ -247,7 +245,7 @@ /* Clean State */ downloadSeedTracker = true buttons.genSeed.disabled = true - buttons.genSeed.innerHTML = 'Saved Seed and Revocation Key Files' + buttons.genSeed.innerHTML = 'Saved Seed & Key Files' verifySeedDownloadComplete(downloadSeedTracker) }, 2000) }, @@ -313,9 +311,6 @@ showModalPassphraseIntro: () => { document.querySelector('#modal-passphrase-intro').style.display = 'block' }, - showModalPassphraseOutro: () => { - document.querySelector('#modal-passphrase-outro').style.display = 'block' - }, closePassphraseIntro: () => { document.querySelector('#modal-passphrase-intro').style.display = 'none' }, @@ -526,21 +521,6 @@ } } - const confirmPassphraseWritten = async () => { - click.showModalPassphraseOutro() - - const confirmed = await new Promise(resolve => { - buttons.hasWrittenPassphrase.onclick = () => { - resolve(true) - } - buttons.hasNotWrittenPassphrase.onclick = () => { - resolve(false) - } - }) - document.querySelector('#modal-passphrase-outro').style.display = 'none' - return confirmed - } - // Verifies a registration code by contacting the Holo Membrane Proof Service. // Returns `true` if successful. Returns a string for user error feedback if applicable. Otherwise throws. // From 84a93caebbe6113edcb64be88d60235b3f8f3a12 Mon Sep 17 00:00:00 2001 From: Patrick Winfield Date: Tue, 30 Jul 2024 11:38:58 -0600 Subject: [PATCH 12/12] pr feedback suggestions --- gen-web/src/index.js | 4 ++-- gen-web/src/utils.js | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gen-web/src/index.js b/gen-web/src/index.js index 1d08d26..0942310 100644 --- a/gen-web/src/index.js +++ b/gen-web/src/index.js @@ -256,7 +256,7 @@ setTimeout(() => { try { - filesaver.saveAs(configFileBlob, genConfigFileName(HOLO_PORT_STARTING_DEVICE_NUMBER, deviceID)) + filesaver.saveAs(configFileBlob, genConfigFileName(deviceID)) } catch (e) { throw new Error(`Error saving config. Error: ${e}`) } @@ -446,7 +446,7 @@ buttons.prevStep.disabled = true } } else if (stepTracker === 5) { - inlineVariables.downloadFileName.innerHTML = genConfigFileName(deviceNumber, deviceID) + inlineVariables.downloadFileName.innerHTML = genConfigFileName(deviceID) verifyDownloadComplete() } } diff --git a/gen-web/src/utils.js b/gen-web/src/utils.js index b67282e..7702a04 100644 --- a/gen-web/src/utils.js +++ b/gen-web/src/utils.js @@ -15,19 +15,15 @@ export const toBase64 = (encodedBytes) => { } -const FILE_PREFIX = "hp" +const FILE_PREFIX = "hp-config" const FILE_TYPE = ".json" -const HOLO_PORT_STARTING_DEVICE_NUMBER = 1 /** * generate file name based on the device number * @param {number} deviceNumber * @param {string} pubKey */ -export const genConfigFileName = (deviceNumber, pubKey) => { - if (deviceNumber == HOLO_PORT_STARTING_DEVICE_NUMBER) { - return `${FILE_PREFIX}-primary-${pubKey.substring(0, 5)}${FILE_TYPE}` - } else { - return `${FILE_PREFIX}-secondary-${pubKey.substring(0, 5)}${FILE_TYPE}` - } +export const genConfigFileName = (pubKey) => { + return `${FILE_PREFIX}-${pubKey.substring(0, 5)}${FILE_TYPE}` + } \ No newline at end of file