fixed building on windows
This commit is contained in:
parent
7e9ad7c793
commit
27789f94d2
|
@ -24,7 +24,7 @@ required-features = ["ed25519", "clap", "rpassword", "base64"]
|
|||
|
||||
[dependencies]
|
||||
rand = "0.8.4"
|
||||
clap = {version = "3.0.0-beta.5", optional = true}
|
||||
clap = {version = "3.0.0-beta.5", optional = true, features = ["derive"]}
|
||||
base64 = {version = "0.13.0", optional = true}
|
||||
bytes = {version = "1.1.0", optional = true}
|
||||
osshkeys = {git = "https://github.com/noonebtw/rust-osshkeys.git", branch = "master", optional = true}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use std::{fs::Permissions, io::Write};
|
||||
use std::io::Write;
|
||||
|
||||
#[macro_use]
|
||||
use clap::Parser;
|
||||
use libduralumin::ed25519::{generate_ed25519_keypair, randomart};
|
||||
use osshkeys::{error::OsshResult, PublicParts};
|
||||
|
@ -83,16 +84,15 @@ fn main() -> OsshResult<()> {
|
|||
println!("Using passphrase to encrypt key..");
|
||||
}
|
||||
|
||||
let fingerprint =
|
||||
keypair.fingerprint(osshkeys::keys::FingerprintHash::SHA256)?;
|
||||
let fingerprint = keypair.fingerprint(osshkeys::keys::FingerprintHash::SHA256)?;
|
||||
|
||||
println!(
|
||||
"Your key fingerprint is: Sha256:{}",
|
||||
base64::encode(&fingerprint)
|
||||
);
|
||||
|
||||
let randomart = randomart::RandomArt::from_digest(&fingerprint)
|
||||
.render("ED25519 256", "SHA256")?;
|
||||
let randomart =
|
||||
randomart::RandomArt::from_digest(&fingerprint).render("ED25519 256", "SHA256")?;
|
||||
|
||||
println!("RandomArt:\n{}", randomart);
|
||||
|
||||
|
@ -108,6 +108,9 @@ fn main() -> OsshResult<()> {
|
|||
let public_key = keypair.serialize_publickey()?;
|
||||
std::fs::write(&public_path, public_key)?;
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
use std::fs::Permissions;
|
||||
#[cfg(target_family = "unix")]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#[macro_use]
|
||||
use clap::Parser;
|
||||
use libduralumin::passphrase_gen::{PassPhraseGenerator, Words};
|
||||
|
||||
|
@ -69,12 +70,8 @@ fn main() {
|
|||
.with_length(opts.words_per_passphrase());
|
||||
|
||||
let words = match opts.backend() {
|
||||
Some(Backend::UseAPassPhrase) => {
|
||||
Words::from_str(include_str!("../../useapassphrase.txt"))
|
||||
}
|
||||
Some(Backend::EnglishWords) => {
|
||||
Words::from_str(include_str!("../../words_alpha.txt"))
|
||||
}
|
||||
Some(Backend::UseAPassPhrase) => Words::from_str(include_str!("../../useapassphrase.txt")),
|
||||
Some(Backend::EnglishWords) => Words::from_str(include_str!("../../words_alpha.txt")),
|
||||
None => {
|
||||
panic!("invalid backend.")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue