From f459982d2c94f2dad97b3d1a105e07581a64ed68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 6 May 2014 16:14:54 +0000 Subject: [PATCH] fixed issue with invalid devices; refs #30 --- src/pcsc.hxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pcsc.hxx b/src/pcsc.hxx index f9d6e29..0f1cb14 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -486,13 +486,20 @@ namespace pcsc { @returns list of readers that contain @c atr in their ATR */ static Strings getReadersWithAtr(const std::string& atr, Scope s=USER, bool exceptions=true) { + CRYPTOLOG("getting all readers with atr: "<status().atr).find(atr)!=string::npos) - res.push_back(*it); + it!=readers.end(); ++it) + try { + if (crypto::hex(c.reader(*it)->status().atr).find(atr) + !=string::npos) + CRYPTOLOG("found reader: "<<*it); + res.push_back(*it); + } catch (std::exception& x) { // ignore unusable readers + CRYPTOLOG("ignored unusable reader: "<