From 1879a250c8eb27ddd2addc48adac654ddfa18891 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 5 Feb 2024 20:19:05 -0500 Subject: [PATCH] keyfork-shard: add instructions for sending QR code to operators --- crates/keyfork-shard/src/lib.rs | 32 +++++++++++++++++++++++------ crates/keyfork-shard/src/openpgp.rs | 25 +++++++++++++++------- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/crates/keyfork-shard/src/lib.rs b/crates/keyfork-shard/src/lib.rs index 2b9e26c..496d00c 100644 --- a/crates/keyfork-shard/src/lib.rs +++ b/crates/keyfork-shard/src/lib.rs @@ -46,6 +46,8 @@ pub(crate) const HUNK_OFFSET: usize = 2; const QRCODE_PROMPT: &str = "Press enter, then present QR code to camera."; const QRCODE_TIMEOUT: u64 = 60; // One minute +const QRCODE_COULDNT_READ: &str = "A QR code could not be scanned. Please enter their words: "; +const QRCODE_ERROR: &str = "Unable to scan a QR code. Falling back to text entry."; /// Establish ECDH transport for remote operators, receive transport-encrypted shares, decrypt the /// shares, and combine them. @@ -67,8 +69,10 @@ pub fn remote_decrypt(w: &mut impl Write) -> Result<(), Box 0) { + iter += 1; let nonce = Aes256Gcm::generate_nonce(&mut OsRng); let nonce_mnemonic = unsafe { Mnemonic::from_raw_entropy(nonce.as_slice(), Default::default()) }; @@ -82,12 +86,26 @@ pub fn remote_decrypt(w: &mut impl Write) -> Result<(), Box = None; @@ -103,9 +121,7 @@ pub fn remote_decrypt(w: &mut impl Write) -> Result<(), Box Result<(), Box