Avoid resetting YubiKeys that don't match the desired serial
If multiple YubiKeys were connected, and the one we needed for plugin encryption or decryption was not first in the list of readers, any YubiKeys before it were being reset upon drop. We now explicitly disconnect without resetting, since we only access these YubiKeys as a side-effect of finding the one we need.
This commit is contained in:
@@ -186,6 +186,9 @@ fn open_by_serial(serial: Serial) -> Result<YubiKey, yubikey::Error> {
|
||||
|
||||
if serial == yubikey.serial() {
|
||||
return Ok(yubikey);
|
||||
} else {
|
||||
// We didn't want this YubiKey; don't reset it.
|
||||
disconnect_without_reset(yubikey);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user