requires pcsclite; refs #37

master
Marc Wäckerlin 13 years ago
parent 36884583cb
commit 1024b04489
  1. 4
      swisssurfer/src/pinentry.ui
  2. 5
      swisssurfer/src/qmake.pro.in
  3. 18
      swisssurfer/src/smartcardauth.hxx

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>435</width>
<height>412</height>
<width>309</width>
<height>381</height>
</rect>
</property>
<property name="windowTitle">

@ -7,12 +7,15 @@ unix {
CONFIG += debug
QMAKE_INCDIR += /usr/include/PCSC
QMAKE_INCDIR += /usr/local/include/PCSC
QMAKE_LIBS += -lpcsclite
}
QMAKE_LIBS += -lpcsclite
}
macx {
QMAKE_INCDIR += /opt/local/include
QMAKE_LIBDIR += /opt/local/lib
QMAKE_LFLAGS += -F/System/Library/Frameworks/PCSC.framework
LIBS += -framework PCSC
QMAKE_INCDIR += /System/Library/Frameworks/PCSC.framework/Headers
CONFIG += x86
}
win32 {

@ -234,11 +234,21 @@ class SmartCardAuth: public QObject {
#endif
// first try to read version info
if (reader.transmit(0x00, 0xA4, 0x08, 0x0C, "\x3f\x00\x56\x49", 4)
!= std::string("\x90\x00", 2) || !reader) return -2;
!= std::string("\x90\x00", 2) || !reader) {
qDebug()<<"Select File failed";
return -2;
}
std::string res(reader.transmit(0x00, 0xB0, 0x00, 0x00));
qDebug()<<" T E X T I S : "<<res.substr(6, res[5]).c_str();
if (res.substr(0, 2)!=std::string("\x90\x00", 2) ||
res.substr(6, res[5]) == "PZ2007") return -2;
if (res.substr(res.size()-2)!=std::string("\x90\x00", 2)) {
qDebug()<<"read error";
return -2;
}
qDebug()<<"version text is: "<<res.substr(4, res[3]).c_str();
// if (res.substr(4, res[3]) != "RAPost 2009" &&
// res.substr(4, res[3]) != "RAPost 2010") {
// qDebug()<<"unsupported card";
// return -2;
// }
if (retCode(reader.transmit(0x00, 0xA4, 0x00, 0x0C)) == 0x9000) {
int value(retCode(reader.transmit(0x00, 0x20, 0x00, 0x81)));
if ((value&0x63C0)==0x63C0) return value&0x0F;

Loading…
Cancel
Save