diff options
author | Daniel Mueller <deso@posteo.net> | 2019-01-19 18:42:21 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2019-01-19 18:42:21 -0800 |
commit | d0070bfe5da91cd272993a24cc85bf64c38c21c0 (patch) | |
tree | 4edd22c6c757e4f5022e1e4dabfd6bf6eae0ce7f /nitrocli/src/commands.rs | |
parent | 50b4c6bf1bc69ca669593d9d925324e3522651dd (diff) | |
download | nitrocli-d0070bfe5da91cd272993a24cc85bf64c38c21c0.tar.gz nitrocli-d0070bfe5da91cd272993a24cc85bf64c38c21c0.tar.bz2 |
Drop '_pin' suffix from various pinentry functions
Various functions in the pinentry module contain an arguably redundant
'_pin' suffix in their name. Examples include inquire_pin and clear_pin.
This change removes this part from their names.
Diffstat (limited to 'nitrocli/src/commands.rs')
-rw-r--r-- | nitrocli/src/commands.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nitrocli/src/commands.rs b/nitrocli/src/commands.rs index 7d698cc..5af2a44 100644 --- a/nitrocli/src/commands.rs +++ b/nitrocli/src/commands.rs @@ -186,12 +186,12 @@ where let mut retry = 3; let mut error_msg = None; loop { - let pin = pinentry::inquire_pin(pin_entry, pinentry::Mode::Query, error_msg)?; + let pin = pinentry::inquire(pin_entry, pinentry::Mode::Query, error_msg)?; match op(data, &pin) { Ok(result) => return Ok(result), Err((new_data, err)) => match err { nitrokey::CommandError::WrongPassword => { - pinentry::clear_pin(pin_entry)?; + pinentry::clear(pin_entry)?; retry -= 1; if retry > 0 { @@ -582,11 +582,11 @@ pub fn otp_status(ctx: &mut args::ExecCtx<'_>, all: bool) -> Result<()> { pub fn pin_clear(ctx: &mut args::ExecCtx<'_>) -> Result<()> { let device = get_device(ctx)?; - pinentry::clear_pin(&pinentry::PinEntry::from( + pinentry::clear(&pinentry::PinEntry::from( pinentry::PinType::Admin, &device, )?)?; - pinentry::clear_pin(&pinentry::PinEntry::from(pinentry::PinType::User, &device)?)?; + pinentry::clear(&pinentry::PinEntry::from(pinentry::PinType::User, &device)?)?; Ok(()) } @@ -622,7 +622,7 @@ fn choose_pin( .ok_or_else(|| Error::from("Failed to read PIN: invalid Unicode data found")) .map(ToOwned::to_owned) } else { - pinentry::choose_pin(pin_entry) + pinentry::choose(pin_entry) } } |