Move verify_pin after Stub::connect

If all we want is to determine the recipient, we don't need to verify
the PIN.

Closes str4d/age-plugin-yubikey#30.
This commit is contained in:
Jack Grigg
2021-08-20 15:03:25 +01:00
parent 7f43d15942
commit 30f4d00902
2 changed files with 35 additions and 19 deletions
+5
View File
@@ -213,6 +213,11 @@ impl IdentityPluginV1 for IdentityPlugin {
}
};
if let Err(e) = conn.request_pin(&mut callbacks)? {
callbacks.error(e)?.unwrap();
continue;
}
for (&file_index, stanzas) in files {
if file_keys.contains_key(&file_index) {
// We decrypted this file with an earlier YubiKey.