keyfork: `cargo fmt`
This commit is contained in:
parent
9375bc3933
commit
471ff0e972
|
@ -1,12 +1,17 @@
|
||||||
use super::Keyfork;
|
use super::Keyfork;
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
|
use keyfork_derive_openpgp::openpgp::{
|
||||||
|
armor::{Kind, Writer},
|
||||||
|
packet::UserID,
|
||||||
|
serialize::Marshal,
|
||||||
|
types::KeyFlags,
|
||||||
|
};
|
||||||
use keyfork_derive_util::{
|
use keyfork_derive_util::{
|
||||||
request::{DerivationAlgorithm, DerivationRequest, DerivationResponse},
|
request::{DerivationAlgorithm, DerivationRequest, DerivationResponse},
|
||||||
DerivationIndex, DerivationPath,
|
DerivationIndex, DerivationPath,
|
||||||
};
|
};
|
||||||
use keyforkd_client::Client;
|
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>;
|
type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
|
||||||
|
|
||||||
|
@ -34,7 +39,9 @@ impl DeriveSubcommands {
|
||||||
let subkeys = vec![
|
let subkeys = vec![
|
||||||
KeyFlags::empty().set_certification(),
|
KeyFlags::empty().set_certification(),
|
||||||
KeyFlags::empty().set_signing(),
|
KeyFlags::empty().set_signing(),
|
||||||
KeyFlags::empty().set_transport_encryption().set_storage_encryption(),
|
KeyFlags::empty()
|
||||||
|
.set_transport_encryption()
|
||||||
|
.set_storage_encryption(),
|
||||||
KeyFlags::empty().set_authentication(),
|
KeyFlags::empty().set_authentication(),
|
||||||
];
|
];
|
||||||
let request = DerivationRequest::new(DerivationAlgorithm::Ed25519, &path);
|
let request = DerivationRequest::new(DerivationAlgorithm::Ed25519, &path);
|
||||||
|
|
|
@ -3,8 +3,8 @@ use clap::{Parser, Subcommand};
|
||||||
mod derive;
|
mod derive;
|
||||||
mod mnemonic;
|
mod mnemonic;
|
||||||
mod provision;
|
mod provision;
|
||||||
mod shard;
|
|
||||||
mod recover;
|
mod recover;
|
||||||
|
mod shard;
|
||||||
mod wizard;
|
mod wizard;
|
||||||
|
|
||||||
/// The Kitchen Sink of Entropy.
|
/// The Kitchen Sink of Entropy.
|
||||||
|
|
|
@ -3,7 +3,10 @@ use clap::{Parser, Subcommand};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use keyfork_mnemonic_util::Mnemonic;
|
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>;
|
type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
|
||||||
|
|
||||||
|
@ -46,7 +49,7 @@ impl RecoverSubcommands {
|
||||||
let mut seed = vec![];
|
let mut seed = vec![];
|
||||||
remote_decrypt(&mut seed)?;
|
remote_decrypt(&mut seed)?;
|
||||||
Ok(seed)
|
Ok(seed)
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,12 +112,7 @@ fn generate_shard_secret(threshold: u8, max: u8, keys_per_shard: u8) -> Result<(
|
||||||
// prompt_passphrase
|
// prompt_passphrase
|
||||||
let user_pin = pm.prompt_passphrase("Please enter the new smartcard User PIN: ")?;
|
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: ")?;
|
let admin_pin = pm.prompt_passphrase("Please enter the new smartcard Admin PIN: ")?;
|
||||||
factory_reset_current_card(
|
factory_reset_current_card(&mut seen_cards, user_pin.trim(), admin_pin.trim(), &cert)?;
|
||||||
&mut seen_cards,
|
|
||||||
user_pin.trim(),
|
|
||||||
admin_pin.trim(),
|
|
||||||
&cert,
|
|
||||||
)?;
|
|
||||||
}
|
}
|
||||||
certs.push(cert);
|
certs.push(cert);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ use std::process::ExitCode;
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
mod config;
|
|
||||||
mod cli;
|
mod cli;
|
||||||
|
mod config;
|
||||||
|
|
||||||
fn main() -> ExitCode {
|
fn main() -> ExitCode {
|
||||||
let opts = cli::Keyfork::parse();
|
let opts = cli::Keyfork::parse();
|
||||||
|
|
Loading…
Reference in New Issue