From 07a48a0539b08810937136a822538bf5606e8d4b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 3 Mar 2024 19:03:58 +0200 Subject: chore: upgrade dependency on rpassword Signed-off-by: Lars Wirzenius Sponsored-by: author --- src/cmd/init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cmd/init.rs b/src/cmd/init.rs index 1310f66..5950fbb 100644 --- a/src/cmd/init.rs +++ b/src/cmd/init.rs @@ -20,7 +20,7 @@ impl Init { pub fn run(&self, config: &ClientConfig) -> Result<(), ObnamError> { let passphrase = match &self.insecure_passphrase { Some(x) => x.to_string(), - None => rpassword::read_password_from_tty(Some(PROMPT)).unwrap(), + None => rpassword::prompt_password(PROMPT).unwrap(), }; let passwords = Passwords::new(&passphrase); -- cgit v1.2.1 From 2b2faf5972127635c9f6738861cfcc3ccce50e0b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 3 Mar 2024 19:16:39 +0200 Subject: chore: upgrade dependency on pbkdf2 Signed-off-by: Lars Wirzenius Sponsored-by: author --- src/passwords.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/passwords.rs b/src/passwords.rs index ea476bf..efc3f96 100644 --- a/src/passwords.rs +++ b/src/passwords.rs @@ -76,7 +76,7 @@ fn derive_password(passphrase: &str) -> String { let salt = SaltString::generate(&mut OsRng); Pbkdf2 - .hash_password(passphrase.as_bytes(), salt.as_ref()) + .hash_password(passphrase.as_bytes(), salt.as_salt()) .unwrap() .to_string() } -- cgit v1.2.1 From d8521c5040541f1a9a15e4bed3d9969ca3719cd4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 3 Mar 2024 19:28:57 +0200 Subject: chore: upgrade dependency on indicatif Signed-off-by: Lars Wirzenius Sponsored-by: author --- src/backup_progress.rs | 36 ++++++++++++++++++++++++++---------- src/cmd/restore.rs | 6 +++++- 2 files changed, 31 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/backup_progress.rs b/src/backup_progress.rs index 1e6805c..e3995f0 100644 --- a/src/backup_progress.rs +++ b/src/backup_progress.rs @@ -2,7 +2,7 @@ use crate::generation::GenId; use indicatif::{ProgressBar, ProgressStyle}; -use std::path::Path; +use std::{path::Path, time::Duration}; const SHOW_PROGRESS: bool = true; @@ -29,8 +29,12 @@ impl BackupProgress { "current: {wide_msg}", "{spinner}", ]; - progress.set_style(ProgressStyle::default_bar().template(&parts.join("\n"))); - progress.enable_steady_tick(100); + progress.set_style( + ProgressStyle::default_bar() + .template(&parts.join("\n")) + .expect("create indicatif ProgressStyle value"), + ); + progress.enable_steady_tick(Duration::from_millis(100)); Self { progress } } @@ -50,8 +54,12 @@ impl BackupProgress { "current: {wide_msg}", "{spinner}", ]; - progress.set_style(ProgressStyle::default_bar().template(&parts.join("\n"))); - progress.enable_steady_tick(100); + progress.set_style( + ProgressStyle::default_bar() + .template(&parts.join("\n")) + .expect("create indicatif ProgressStyle value"), + ); + progress.enable_steady_tick(Duration::from_millis(100)); Self { progress } } @@ -64,8 +72,12 @@ impl BackupProgress { "elapsed: {elapsed}", "{spinner}", ]; - progress.set_style(ProgressStyle::default_bar().template(&parts.join("\n"))); - progress.enable_steady_tick(100); + progress.set_style( + ProgressStyle::default_bar() + .template(&parts.join("\n")) + .expect("create indicatif ProgressStyle value"), + ); + progress.enable_steady_tick(Duration::from_millis(100)); Self { progress } } @@ -75,8 +87,12 @@ impl BackupProgress { pub fn download_generation(gen_id: &GenId) -> Self { let progress = ProgressBar::new(0); let parts = ["{msg}", "elapsed: {elapsed}", "{spinner}"]; - progress.set_style(ProgressStyle::default_bar().template(&parts.join("\n"))); - progress.enable_steady_tick(100); + progress.set_style( + ProgressStyle::default_bar() + .template(&parts.join("\n")) + .expect("create indicatif ProgressStyle value"), + ); + progress.enable_steady_tick(Duration::from_millis(100)); progress.set_message(format!( "downloading previous generation metadata: {}", gen_id @@ -102,7 +118,7 @@ impl BackupProgress { /// Update progress bar about number of actual files found. pub fn found_live_file(&self, filename: &Path) { self.progress.inc(1); - if self.progress.length() < self.progress.position() { + if self.progress.length() < Some(self.progress.position()) { self.progress.set_length(self.progress.position()); } self.progress.set_message(format!("{}", filename.display())); diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs index dff72fa..58caf61 100644 --- a/src/cmd/restore.rs +++ b/src/cmd/restore.rs @@ -306,6 +306,10 @@ fn create_progress_bar(file_count: FileId, verbose: bool) -> ProgressBar { "current: {wide_msg}", "{spinner}", ]; - progress.set_style(ProgressStyle::default_bar().template(&parts.join("\n"))); + progress.set_style( + ProgressStyle::default_bar() + .template(&parts.join("\n")) + .expect("create indicatif ProgressStyle value"), + ); progress } -- cgit v1.2.1 From 7e9349a5bb790af47a257204abc9e337c77ea07c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 3 Mar 2024 19:42:21 +0200 Subject: chore: upgrade dependency on aes-gcm Signed-off-by: Lars Wirzenius Sponsored-by: author --- src/cipher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cipher.rs b/src/cipher.rs index 7bd2e84..21785b9 100644 --- a/src/cipher.rs +++ b/src/cipher.rs @@ -4,7 +4,7 @@ use crate::chunk::DataChunk; use crate::chunkmeta::ChunkMeta; use crate::passwords::Passwords; -use aes_gcm::aead::{generic_array::GenericArray, Aead, NewAead, Payload}; +use aes_gcm::aead::{generic_array::GenericArray, Aead, KeyInit, Payload}; use aes_gcm::Aes256Gcm; // Or `Aes128Gcm` use rand::Rng; -- cgit v1.2.1