aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/args.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-01-11 19:45:59 -0800
committerDaniel Mueller <deso@posteo.net>2019-01-11 19:45:59 -0800
commit44b8c57a6f8701c50b179e482deca79a9e4e7acb (patch)
tree2631ea33ef6e147f1013ac80e22e26363ecd6dbf /nitrocli/src/args.rs
parent772123f4197aded2a99efc5170978dd0bfbc091f (diff)
downloadnitrocli-44b8c57a6f8701c50b179e482deca79a9e4e7acb.tar.gz
nitrocli-44b8c57a6f8701c50b179e482deca79a9e4e7acb.tar.bz2
Isolate cached PINs for multiple devices from each other
The application supports multiple devices both plugged in at the same time as well as when used after the other. However, the GPG cache ID we use for storing and retrieving the respective PIN is effectively a constant. This constraint can cause problems when devices have different PINs, as the PIN of a previously plugged in device may be reused for an operation on a different one. To resolve this problem this change adds the respective device's model and serial number to the cache ID. As each serial number is supposed to be different, this will ensure that the correct PIN is used for each device. With this change we also show the model and serial number of the currently used device in the pinentry dialog. Note that because we do not store the serial numbers of all previously plugged in devices, the pin clear command will only clear the PIN for the currently plugged in device. If a user wants to make sure that a cached PIN is cleared, the pin clear command should be invoked before unplugging the device.
Diffstat (limited to 'nitrocli/src/args.rs')
-rw-r--r--nitrocli/src/args.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs
index f4e0758..b15ca65 100644
--- a/nitrocli/src/args.rs
+++ b/nitrocli/src/args.rs
@@ -631,7 +631,7 @@ fn pin_clear(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> {
parser.set_description("Clears the cached PINs");
parse(ctx, &parser, args)?;
- commands::pin_clear()
+ commands::pin_clear(ctx)
}
/// Change a PIN.