Raise minimum pcsc version to remove workaround (#478)
In iqlusioninc/yubikey.rs#88 we added a workaround for what turned out to be a bug in `pcsc`, where an error was returned if no readers were available, instead of returning an empty iterator. `pcsc 2.3.1` was published in 2019, so we can safely rely on it.
This commit is contained in:
+2
-12
@@ -190,12 +190,7 @@ impl YubiKey {
|
||||
/// [`yubikey::reader::Context`][`Context`] to select from the available
|
||||
/// PC/SC readers.
|
||||
pub fn open() -> Result<Self> {
|
||||
let mut readers = Context::open().map_err(|e| match e {
|
||||
Error::PcscError {
|
||||
inner: Some(pcsc::Error::NoReadersAvailable),
|
||||
} => Error::NotFound,
|
||||
other => other,
|
||||
})?;
|
||||
let mut readers = Context::open()?;
|
||||
let mut reader_iter = readers.iter()?;
|
||||
|
||||
if let Some(reader) = reader_iter.next() {
|
||||
@@ -213,12 +208,7 @@ impl YubiKey {
|
||||
|
||||
/// Open a YubiKey with a specific serial number.
|
||||
pub fn open_by_serial(serial: Serial) -> Result<Self> {
|
||||
let mut readers = Context::open().map_err(|e| match e {
|
||||
Error::PcscError {
|
||||
inner: Some(pcsc::Error::NoReadersAvailable),
|
||||
} => Error::NotFound,
|
||||
other => other,
|
||||
})?;
|
||||
let mut readers = Context::open()?;
|
||||
|
||||
for reader in readers.iter()? {
|
||||
let yubikey = match reader.open() {
|
||||
|
||||
Reference in New Issue
Block a user