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:
+1
-1
@@ -35,7 +35,7 @@ num-integer = "0.1"
|
|||||||
pbkdf2 = { version = "0.11", default-features = false }
|
pbkdf2 = { version = "0.11", default-features = false }
|
||||||
p256 = "0.11"
|
p256 = "0.11"
|
||||||
p384 = "0.11"
|
p384 = "0.11"
|
||||||
pcsc = "2"
|
pcsc = "2.3.1"
|
||||||
rand_core = { version = "0.6", features = ["std"] }
|
rand_core = { version = "0.6", features = ["std"] }
|
||||||
rsa = "0.7"
|
rsa = "0.7"
|
||||||
secrecy = "0.8"
|
secrecy = "0.8"
|
||||||
|
|||||||
+2
-12
@@ -190,12 +190,7 @@ impl YubiKey {
|
|||||||
/// [`yubikey::reader::Context`][`Context`] to select from the available
|
/// [`yubikey::reader::Context`][`Context`] to select from the available
|
||||||
/// PC/SC readers.
|
/// PC/SC readers.
|
||||||
pub fn open() -> Result<Self> {
|
pub fn open() -> Result<Self> {
|
||||||
let mut readers = Context::open().map_err(|e| match e {
|
let mut readers = Context::open()?;
|
||||||
Error::PcscError {
|
|
||||||
inner: Some(pcsc::Error::NoReadersAvailable),
|
|
||||||
} => Error::NotFound,
|
|
||||||
other => other,
|
|
||||||
})?;
|
|
||||||
let mut reader_iter = readers.iter()?;
|
let mut reader_iter = readers.iter()?;
|
||||||
|
|
||||||
if let Some(reader) = reader_iter.next() {
|
if let Some(reader) = reader_iter.next() {
|
||||||
@@ -213,12 +208,7 @@ impl YubiKey {
|
|||||||
|
|
||||||
/// Open a YubiKey with a specific serial number.
|
/// Open a YubiKey with a specific serial number.
|
||||||
pub fn open_by_serial(serial: Serial) -> Result<Self> {
|
pub fn open_by_serial(serial: Serial) -> Result<Self> {
|
||||||
let mut readers = Context::open().map_err(|e| match e {
|
let mut readers = Context::open()?;
|
||||||
Error::PcscError {
|
|
||||||
inner: Some(pcsc::Error::NoReadersAvailable),
|
|
||||||
} => Error::NotFound,
|
|
||||||
other => other,
|
|
||||||
})?;
|
|
||||||
|
|
||||||
for reader in readers.iter()? {
|
for reader in readers.iter()? {
|
||||||
let yubikey = match reader.open() {
|
let yubikey = match reader.open() {
|
||||||
|
|||||||
Reference in New Issue
Block a user