Update to rpassword 6
This commit is contained in:
parent
fee95b6b36
commit
9edd459d86
3 changed files with 5 additions and 5 deletions
|
@ -17,7 +17,7 @@ openpgp-card = { path = "../openpgp-card", version = "0.2.3" }
|
||||||
openpgp-card-pcsc = { path = "../pcsc", version = "0.2" }
|
openpgp-card-pcsc = { path = "../pcsc", version = "0.2" }
|
||||||
openpgp-card-sequoia = { path = "../openpgp-card-sequoia", version = "0.0.10" }
|
openpgp-card-sequoia = { path = "../openpgp-card-sequoia", version = "0.0.10" }
|
||||||
sshkeys = "0.3.2"
|
sshkeys = "0.3.2"
|
||||||
rpassword = "5"
|
rpassword = "6"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
clap = { version = "3.1", features = ["derive"] }
|
clap = { version = "3.1", features = ["derive"] }
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
|
|
|
@ -321,7 +321,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
load_pin(&path)?
|
load_pin(&path)?
|
||||||
} else {
|
} else {
|
||||||
// input resetting code
|
// input resetting code
|
||||||
rpassword::read_password_from_tty(Some("Enter resetting code: "))?
|
rpassword::prompt_password("Enter resetting code: ")?
|
||||||
.as_bytes()
|
.as_bytes()
|
||||||
.to_vec()
|
.to_vec()
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub(crate) fn get_pin(open: &mut Open, pin_file: Option<PathBuf>, msg: &str) ->
|
||||||
Some(load_pin(&path).ok()?)
|
Some(load_pin(&path).ok()?)
|
||||||
} else if !open.feature_pinpad_verify() {
|
} else if !open.feature_pinpad_verify() {
|
||||||
// we have no pin file and no pinpad
|
// we have no pin file and no pinpad
|
||||||
let pin = rpassword::read_password_from_tty(Some(msg)).ok()?;
|
let pin = rpassword::prompt_password(msg).ok()?;
|
||||||
Some(pin.into_bytes())
|
Some(pin.into_bytes())
|
||||||
} else {
|
} else {
|
||||||
// we have a pinpad
|
// we have a pinpad
|
||||||
|
@ -40,8 +40,8 @@ pub(crate) fn get_pin(open: &mut Open, pin_file: Option<PathBuf>, msg: &str) ->
|
||||||
/// Let the user input a PIN twice, return PIN if both entries match, error otherwise
|
/// Let the user input a PIN twice, return PIN if both entries match, error otherwise
|
||||||
pub(crate) fn input_pin_twice(msg1: &str, msg2: &str) -> Result<Vec<u8>> {
|
pub(crate) fn input_pin_twice(msg1: &str, msg2: &str) -> Result<Vec<u8>> {
|
||||||
// get new user pin
|
// get new user pin
|
||||||
let newpin1 = rpassword::read_password_from_tty(Some(msg1))?;
|
let newpin1 = rpassword::prompt_password(msg1)?;
|
||||||
let newpin2 = rpassword::read_password_from_tty(Some(msg2))?;
|
let newpin2 = rpassword::prompt_password(msg2)?;
|
||||||
|
|
||||||
if newpin1 != newpin2 {
|
if newpin1 != newpin2 {
|
||||||
Err(anyhow::anyhow!("PINs do not match."))
|
Err(anyhow::anyhow!("PINs do not match."))
|
||||||
|
|
Loading…
Reference in a new issue