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:
str4d
2023-02-12 17:18:55 +00:00
committed by GitHub
parent 1e02f135f0
commit 10241230b3
2 changed files with 3 additions and 13 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ num-integer = "0.1"
pbkdf2 = { version = "0.11", default-features = false }
p256 = "0.11"
p384 = "0.11"
pcsc = "2"
pcsc = "2.3.1"
rand_core = { version = "0.6", features = ["std"] }
rsa = "0.7"
secrecy = "0.8"
+2 -12
View File
@@ -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() {