keyfork: `cargo fmt`

This commit is contained in:
Ryan Heywood 2024-01-08 14:26:22 -05:00
parent 9375bc3933
commit 471ff0e972
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
5 changed files with 18 additions and 13 deletions

View File

@ -1,12 +1,17 @@
use super::Keyfork;
use clap::{Parser, Subcommand};
use keyfork_derive_openpgp::openpgp::{
armor::{Kind, Writer},
packet::UserID,
serialize::Marshal,
types::KeyFlags,
};
use keyfork_derive_util::{
request::{DerivationAlgorithm, DerivationRequest, DerivationResponse},
DerivationIndex, DerivationPath,
};
use keyforkd_client::Client;
use keyfork_derive_openpgp::openpgp::{types::KeyFlags, packet::UserID, armor::{Kind, Writer}, serialize::Marshal};
type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
@ -34,7 +39,9 @@ impl DeriveSubcommands {
let subkeys = vec![
KeyFlags::empty().set_certification(),
KeyFlags::empty().set_signing(),
KeyFlags::empty().set_transport_encryption().set_storage_encryption(),
KeyFlags::empty()
.set_transport_encryption()
.set_storage_encryption(),
KeyFlags::empty().set_authentication(),
];
let request = DerivationRequest::new(DerivationAlgorithm::Ed25519, &path);

View File

@ -3,8 +3,8 @@ use clap::{Parser, Subcommand};
mod derive;
mod mnemonic;
mod provision;
mod shard;
mod recover;
mod shard;
mod wizard;
/// The Kitchen Sink of Entropy.

View File

@ -3,7 +3,10 @@ use clap::{Parser, Subcommand};
use std::path::PathBuf;
use keyfork_mnemonic_util::Mnemonic;
use keyfork_shard::{remote_decrypt, openpgp::{combine, discover_certs, parse_messages}};
use keyfork_shard::{
openpgp::{combine, discover_certs, parse_messages},
remote_decrypt,
};
type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
@ -46,7 +49,7 @@ impl RecoverSubcommands {
let mut seed = vec![];
remote_decrypt(&mut seed)?;
Ok(seed)
},
}
}
}
}

View File

@ -112,12 +112,7 @@ fn generate_shard_secret(threshold: u8, max: u8, keys_per_shard: u8) -> Result<(
// prompt_passphrase
let user_pin = pm.prompt_passphrase("Please enter the new smartcard User PIN: ")?;
let admin_pin = pm.prompt_passphrase("Please enter the new smartcard Admin PIN: ")?;
factory_reset_current_card(
&mut seen_cards,
user_pin.trim(),
admin_pin.trim(),
&cert,
)?;
factory_reset_current_card(&mut seen_cards, user_pin.trim(), admin_pin.trim(), &cert)?;
}
certs.push(cert);
}

View File

@ -3,13 +3,13 @@ use std::process::ExitCode;
use clap::Parser;
mod config;
mod cli;
mod config;
fn main() -> ExitCode {
let opts = cli::Keyfork::parse();
if let Err(e) = opts.command .handle(&opts) {
if let Err(e) = opts.command.handle(&opts) {
eprintln!("Unable to run command: {e}");
let mut source = e.source();
while let Some(new_error) = source.take() {