summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-04-07 08:37:53 (GMT)
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-04-07 08:37:53 (GMT)
commitac3d1788dfa8db5dd8de5a99764b439dd5ec54db (patch)
tree9dc65bae1994432caf35d0d05b2f08393fc9ff45
parent78728a96af022bae87e4d0d11855f420736d87b7 (diff)
downloadmocca-ac3d1788dfa8db5dd8de5a99764b439dd5ec54db.zip
mocca-ac3d1788dfa8db5dd8de5a99764b439dd5ec54db.tar.gz
mocca-ac3d1788dfa8db5dd8de5a99764b439dd5ec54db.tar.bz2
MOCCA-1.1 final
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@327 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java16
-rw-r--r--BKUOnline/src/main/webapp/applet.jsp5
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/bku/binding/ExpiryRemoverTest.java7
-rw-r--r--nbactions.xml7
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java10
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ccid/CherrySmartBoardXX44.java42
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ccid/DefaultReader.java162
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ccid/GemplusGemPCPinpad.java23
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ccid/OMNIKEYCardMan3621.java11
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ccid/ReaderFactory.java16
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/ccid/SCMMicrosystemsSPRx32.java51
-rw-r--r--smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/PINProviderFactory.java2
12 files changed, 165 insertions, 187 deletions
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java
index 26349f7..24938cd 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java
@@ -18,8 +18,6 @@
package at.gv.egiz.bku.online.webapp;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
@@ -55,14 +53,18 @@ public class AppletDispatcher extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
-// String suffix = (String) request.getSession().getAttribute(RAND_CTX_ATTRIBUTE);
-// log.trace("expecting random suffix " + suffix);
-
String uri = request.getRequestURI();
+// log.trace("request URI " + uri);
+
+ uri = uri.substring(request.getContextPath().length());
+// log.trace("removing contextPath " + uri);
+
uri = ctxPattern.matcher(uri).replaceAll("");
-// uri = uri.replaceAll(suffix, ""); //only the applet jar requests contains the randCtx
- uri = archivePattern.matcher(uri).replaceAll(".jar");
+// log.trace("removing dispatch context " + uri);
+ uri = archivePattern.matcher(uri).replaceAll(".jar");
+// log.trace("removing random suffix " + uri);
+
if (log.isTraceEnabled()) {
log.trace("dispatching request URI " + request.getRequestURI() +
" to " + uri);
diff --git a/BKUOnline/src/main/webapp/applet.jsp b/BKUOnline/src/main/webapp/applet.jsp
index 6af8157..b2e5467 100644
--- a/BKUOnline/src/main/webapp/applet.jsp
+++ b/BKUOnline/src/main/webapp/applet.jsp
@@ -44,7 +44,6 @@
String extension = (String) session.getAttribute("extension");
String rand = AppletDispatcher.RAND_PREFIX +
RandomStringUtils.randomAlphanumeric(16);
- //(String) session.getAttribute(AppletDispatcher.RAND_ATTRIBUTE);
String appletClass, appletArchive;
if ("activation".equals(extension)) {
@@ -64,6 +63,10 @@
document
.write('<b>Diese Anwendung benötigt die Java Platform Version 1.6.0_04 oder höher.</b>' + '<input type="submit" value="Java Platform 1.6.0_02 installieren" onclick="deployJava.installLatestJRE();">');
} else {
+ // to enable applet caching, remove AppletDispatcher servlet,
+ // change codebase to 'applet',
+ // remove random suffix for appletArchive
+ // and remove '../' for all URL applet parameters
var attributes = {
codebase :'<%="applet/" + AppletDispatcher.DISPATCH_CTX %>',
code : '<%=appletClass%>',
diff --git a/bkucommon/src/test/java/at/gv/egiz/bku/binding/ExpiryRemoverTest.java b/bkucommon/src/test/java/at/gv/egiz/bku/binding/ExpiryRemoverTest.java
index 0e64e7a..18ccc11 100644
--- a/bkucommon/src/test/java/at/gv/egiz/bku/binding/ExpiryRemoverTest.java
+++ b/bkucommon/src/test/java/at/gv/egiz/bku/binding/ExpiryRemoverTest.java
@@ -18,14 +18,12 @@ package at.gv.egiz.bku.binding;
import java.net.MalformedURLException;
-import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
public class ExpiryRemoverTest {
@Test
- @Ignore
public void testMe() throws InterruptedException, MalformedURLException {
BindingProcessorManager manager = new BindingProcessorManagerImpl(new DummyStalFactory(),
new SLCommandInvokerImpl());
@@ -37,16 +35,15 @@ public class ExpiryRemoverTest {
remover.execute();
assertTrue(manager.getManagedIds().size() == 1);
remover.setMaxAcceptedAge(1000);
- Thread.sleep(500);
+ Thread.sleep(100);
remover.execute();
assertTrue(manager.getManagedIds().size() == 1);
- Thread.sleep(510);
+ Thread.sleep(910);
remover.execute();
assertTrue(manager.getManagedIds().size() == 0);
}
@Test
- @Ignore
public void testMe2() throws InterruptedException, MalformedURLException {
BindingProcessorManager manager = new BindingProcessorManagerImpl(new DummyStalFactory(),
new SLCommandInvokerImpl());
diff --git a/nbactions.xml b/nbactions.xml
index 4c3d57a..0fbc828 100644
--- a/nbactions.xml
+++ b/nbactions.xml
@@ -10,4 +10,11 @@
<maven.test.skip>true</maven.test.skip>
</properties>
</action>
+ <action>
+ <actionName>CUSTOM-release:prepare</actionName>
+ <displayName>release:prepare</displayName>
+ <goals>
+ <goal>release:prepare</goal>
+ </goals>
+ </action>
</actions>
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
index b9c68b0..e622f65 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
@@ -700,9 +700,9 @@ public class STARCOSCard extends AbstractSignatureCard {
// ^-------- System bit units is bit
// ^^^^--- PIN length is at the 4th position bit
//TODO compare ints, not bytes
- byte wPINMaxExtraDigitL = // Max=12 digits (Gemplus support max 8)
- (reader.getwPINMaxExtraDigitL() < (byte) 0x12) ?
- reader.getwPINMaxExtraDigitL() : (byte) 0x12;
+ byte wPINMaxExtraDigitL = // Max=12 digits
+ (reader.getwPINMaxExtraDigitL() < (byte) 0x0c) ?
+ reader.getwPINMaxExtraDigitL() : (byte) 0x0c;
byte wPINMaxExtraDigitH = // Min=4/6 digits TODO card/ss pin (min: 4/6)
(reader.getwPINMaxExtraDigitH() > (byte) 0x04) ?
reader.getwPINMaxExtraDigitH() : (byte) 0x04;
@@ -757,8 +757,8 @@ public class STARCOSCard extends AbstractSignatureCard {
byte bInsertionOffsetOld = (byte) 0x00; // insertion position offset in bytes
byte bInsertionOffsetNew = (byte) 0x08; // (add 1 from bmFormatString b3)
byte wPINMaxExtraDigitL =
- (reader.getwPINMaxExtraDigitL() < (byte) 0x12) ?
- reader.getwPINMaxExtraDigitL() : (byte) 0x12;
+ (reader.getwPINMaxExtraDigitL() < (byte) 0x0c) ?
+ reader.getwPINMaxExtraDigitL() : (byte) 0x0c;
byte wPINMaxExtraDigitH = // Min=4/6 digits TODO card/ss pin (min: 4/6)
(reader.getwPINMaxExtraDigitH() > (byte) 0x04) ?
reader.getwPINMaxExtraDigitH() : (byte) 0x04;
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ccid/CherrySmartBoardXX44.java b/smcc/src/main/java/at/gv/egiz/smcc/ccid/CherrySmartBoardXX44.java
new file mode 100644
index 0000000..a7e4576
--- /dev/null
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ccid/CherrySmartBoardXX44.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.smcc.ccid;
+
+import javax.smartcardio.Card;
+import javax.smartcardio.CardTerminal;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
+ */
+public class CherrySmartBoardXX44 extends DefaultReader {
+
+ protected static final Log log = LogFactory.getLog(CherrySmartBoardXX44.class);
+
+ public static final byte wPINMaxExtraDigitH = 0x01;
+
+ public CherrySmartBoardXX44(Card icc, CardTerminal ct) {
+ super(icc, ct);
+ }
+
+ @Override
+ public byte getwPINMaxExtraDigitH() {
+ return wPINMaxExtraDigitH;
+ }
+}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ccid/DefaultReader.java b/smcc/src/main/java/at/gv/egiz/smcc/ccid/DefaultReader.java
index 9b1787a..b203ae5 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/ccid/DefaultReader.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ccid/DefaultReader.java
@@ -20,8 +20,6 @@ import at.gv.egiz.smcc.*;
import at.gv.egiz.smcc.util.SMCCHelper;
import java.util.HashMap;
import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.smartcardio.Card;
import javax.smartcardio.CardException;
import javax.smartcardio.CardTerminal;
@@ -34,6 +32,12 @@ import org.apache.commons.logging.LogFactory;
*/
public class DefaultReader implements CCID {
+ public static final byte bEntryValidationCondition = 0x02; // validation key pressed
+ public static final byte bTimeOut = 0x3c; // 60sec (= max on ReinerSCT)
+ public static final byte bTimeOut2 = 0x00; // default (attention with SCM)
+ public static final byte wPINMaxExtraDigitH = 0x00; // min pin length zero digits
+ public static final byte wPINMaxExtraDigitL = 0x0c; // max pin length 12 digits
+
protected final static Log log = LogFactory.getLog(DefaultReader.class);
private static int CTL_CODE(int code) {
@@ -60,9 +64,17 @@ public class DefaultReader implements CCID {
if (icc == null || ct == null) {
throw new NullPointerException("no card or card terminal provided");
}
+ log.info("Initializing " + ct.getName());
+
this.icc = icc;
this.ct = ct;
- features = queryFeatures();
+ features = queryFeatures();
+
+ log.debug("setting pin timeout: " + getbTimeOut());
+ log.debug("setting pin timeout (after key pressed): " + getbTimeOut2());
+ log.debug("setting pin entry validation condition: " + getbEntryValidationCondition());
+ log.debug("setting min pin length: " + getwPINMaxExtraDigitH());
+ log.debug("setting max pin length: " + getwPINMaxExtraDigitL());
}
/**
@@ -103,11 +115,10 @@ public class DefaultReader implements CCID {
// control code value for supported feature (in big endian)
for (int i = 0; i < resp.length; i += 6) {
Byte feature = new Byte(resp[i]);
- int ioctlBigEndian = ((0xff & resp[i + 2]) << 24) |
+ Integer ioctl = new Integer((0xff & resp[i + 2]) << 24) |
((0xff & resp[i + 3]) << 16) |
((0xff & resp[i + 4]) << 8) |
(0xff & resp[i + 5]);
- Integer ioctl = new Integer(ioctlBigEndian);
if (log.isInfoEnabled()) {
log.info("CCID supports " + FEATURES[feature.intValue()] +
": " + Integer.toHexString(ioctl.intValue()));
@@ -131,54 +142,29 @@ public class DefaultReader implements CCID {
return false;
}
-// protected byte[] transmitControlCommand(Byte feature, byte[] ctrlCommand)
-// throws CardException {
-// try {
-// if (!features.containsKey(feature)) {
-// throw new CardException(FEATURES[feature.intValue()] + " not supported");
-// }
-// int ioctl = features.get(feature);
-// if (log.isTraceEnabled()) {
-// log.trace("CtrlCommand (" + Integer.toHexString(ioctl) +
-// ") " + SMCCHelper.toString(ctrlCommand));
-// }
-// byte[] resp = icc.transmitControlCommand(ioctl, ctrlCommand);
-// if (log.isTraceEnabled()) {
-// log.trace("CtrlCommand Response " + SMCCHelper.toString(resp));
-// }
-// return resp;
-// } catch (CardException ex) {
-// log.error(ex.getMessage());
-// throw new SignatureCardException("Failed to transmit CtrlCommand for " +
-// FEATURES[feature.intValue()]);
-// }
-// }
-
-
@Override
public byte getbTimeOut() {
- return (byte) 0x3c; // (max 1min on ReinerSCT),
- // 0x00=default, 0x1e = 30sec
+ return bTimeOut;
}
@Override
public byte getbTimeOut2() {
- return (byte) 0x00; // default
+ return bTimeOut2;
}
@Override
public byte getwPINMaxExtraDigitL() {
- return (byte) 0x12; // signed int
+ return wPINMaxExtraDigitL;
}
@Override
public byte getwPINMaxExtraDigitH() {
- return (byte) 0x00;
+ return wPINMaxExtraDigitH;
}
@Override
public byte getbEntryValidationCondition() {
- return (byte) 0x02; // validation key pressed
+ return bEntryValidationCondition;
}
void verifyPinStart(byte[] PIN_VERIFY) throws CardException {
@@ -275,9 +261,6 @@ public class DefaultReader implements CCID {
throw new CardException("FEATURE_GET_KEY_PRESSED not supported");
}
int ioctl = features.get(FEATURE_GET_KEY_PRESSED);
-// if (log.isTraceEnabled()) {
-// log.trace("GET_KEY_PRESSED (" + Integer.toHexString(ioctl) + ")");
-// }
byte[] resp = icc.transmitControlCommand(ioctl, new byte[0]);
if (resp != null && resp.length == 1) {
// if (log.isTraceEnabled()) {
@@ -349,7 +332,7 @@ public class DefaultReader implements CCID {
throw new CardException("unexpected response to GET_KEY_PRESSED: " +
Integer.toHexString(resp));
}
- } while (true); //resp != (byte) 0x0d);
+ } while (true);
return verifyPinFinish();
}
@@ -404,7 +387,6 @@ public class DefaultReader implements CCID {
}
/**
- * NOT SUPPORTED FOR ACOS ON OMNIKEY CardMan 3621
*
* @param PIN_MODIFY
* @return
@@ -426,104 +408,4 @@ public class DefaultReader implements CCID {
}
return resp;
}
-
-
-//[TRACE] SmartCardIO - terminal 'PC/SC terminal OMNIKEY CardMan 3621 0' card inserted : PC/SC card in OMNIKEY CardMan 3621 0, protocol T=1, state OK
-//[TRACE] DefaultReader - GET_FEATURE_REQUEST 313520 on OMNIKEY CardMan 3621 0
-//[TRACE] DefaultReader - Response TLV [01:04:00:31:30:00:02:04:00:31:2f:d4:03:04:00:31:30:04:04:04:00:31:2f:dc:05:04:00:31:2f:e0:0a:04
-//00:31:30:08]
-//[INFO] DefaultReader - CCID supports FEATURE_VERIFY_PIN_START: 313000
-//[INFO] DefaultReader - CCID supports FEATURE_VERIFY_PIN_FINISH: ffffffd4
-//[INFO] DefaultReader - CCID supports FEATURE_MODIFY_PIN_START: 313004
-//[INFO] DefaultReader - CCID supports FEATURE_MODIFY_PIN_FINISH: ffffffdc
-//[INFO] DefaultReader - CCID supports FEATURE_GET_KEY_PRESSED: ffffffe0
-//[INFO] DefaultReader - CCID supports FEATURE_IFD_PIN_PROPERTIES: 313008
-//[TRACE] AbstractSignatureCard - Setting IFS (information field size) to 254
-
-
- // protected byte ifdGetKeyPressed() throws CardException {
-// if (ifdSupportsFeature(FEATURE_VERIFY_PIN_DIRECT)) {
-//
-// Long controlCode = (Long) IFD_IOCTL.get(new Byte((byte) 0x05));
-//
-// byte key = 0x00;
-// while (key == 0x00) {
-//
-// byte[] resp = card_.transmitControlCommand(controlCode.intValue(), new byte[] {});
-//
-// if (resp != null && resp.length > 0) {
-// key = resp[0];
-// }
-// }
-//
-// System.out.println("Key: " + key);
-//
-// }
-//
-// return 0x00;
-// }
-//
-// protected byte[] ifdVerifyPINFinish() throws CardException {
-// if (ifdSupportsFeature(FEATURE_VERIFY_PIN_DIRECT)) {
-//
-// Long controlCode = (Long) IFD_IOCTL.get(new Byte((byte) 0x02));
-//
-// byte[] resp = card_.transmitControlCommand(controlCode.intValue(), new byte[] {});
-//
-// System.out.println("CommandResp: " + toString(resp));
-//
-// return resp;
-//
-// }
-//
-// return null;
-// }
-
-
- /**
- * assumes ifdSupportsVerifyPIN() == true
- * @param pinVerifyStructure
- * @return
- * @throws javax.smartcardio.CardException
- */
-// protected byte[] ifdVerifyPIN(byte[] pinVerifyStructure) throws CardException {
-//
-//// Long ctrlCode = (Long) ifdFeatures.get(FEATURE_IFD_PIN_PROPERTIES);
-//// if (ctrlCode != null) {
-//// if (log.isTraceEnabled()) {
-//// log.trace("PIN_PROPERTIES CtrlCode " + Integer.toHexString(ctrlCode.intValue()));
-//// }
-//// byte[] resp = card_.transmitControlCommand(ctrlCode.intValue(), new byte[] {});
-////
-//// if (log.isTraceEnabled()) {
-//// log.trace("PIN_PROPERTIES Response " + SMCCHelper.toString(resp));
-//// }
-//// }
-//
-//
-// Long ctrlCode = (Long) ifdFeatures.get(FEATURE_VERIFY_PIN_DIRECT);
-// if (ctrlCode == null) {
-// throw new NullPointerException("no CtrlCode for FEATURE_VERIFY_PIN_DIRECT");
-// }
-//
-// if (log.isTraceEnabled()) {
-// log.trace("VERIFY_PIN_DIRECT CtrlCode " + Integer.toHexString(ctrlCode.intValue()) +
-// ", PIN_VERIFY_STRUCTURE " + SMCCHelper.toString(pinVerifyStructure));
-// }
-// byte[] resp = card_.transmitControlCommand(ctrlCode.intValue(), pinVerifyStructure);
-//
-// if (log.isTraceEnabled()) {
-// log.trace("VERIFY_PIN_DIRECT Response " + SMCCHelper.toString(resp));
-// }
-// return resp;
-// }
-
-// protected Long getControlCode(Byte feature) {
-// if (ifdFeatures != null) {
-// return ifdFeatures.get(feature);
-// }
-// return null;
-// }
-
-
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ccid/GemplusGemPCPinpad.java b/smcc/src/main/java/at/gv/egiz/smcc/ccid/GemplusGemPCPinpad.java
index 903b11f..ff6d004 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/ccid/GemplusGemPCPinpad.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ccid/GemplusGemPCPinpad.java
@@ -22,7 +22,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- *
+ * bTimeOut = 15sec (too short, leave value from DefaultRearder),
+ * however, max is something near 40sec
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class GemplusGemPCPinpad extends DefaultReader {
@@ -31,20 +32,6 @@ public class GemplusGemPCPinpad extends DefaultReader {
public GemplusGemPCPinpad(Card icc, CardTerminal ct) {
super(icc, ct);
- log.info("Initializing Gemplus GemPC Pinpad reader");
- log.info("Gemplus GemPC Pinpad allows PINs to have 4-8 digits");
-
- }
-
- @Override
- public byte getbTimeOut() {
- return (byte) 0x3c; // 0x00 default = 15sec
- // max 40sec (?)
- }
-
- @Override
- public byte getbTimeOut2() {
- return (byte) 0x00; // 0x00 default = 15sec
}
@Override
@@ -56,10 +43,4 @@ public class GemplusGemPCPinpad extends DefaultReader {
public byte getwPINMaxExtraDigitH() {
return (byte) 0x04;
}
-
- @Override
- public byte getbEntryValidationCondition() {
- return (byte) 0x02; // validation key pressed
- }
-
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ccid/OMNIKEYCardMan3621.java b/smcc/src/main/java/at/gv/egiz/smcc/ccid/OMNIKEYCardMan3621.java
index 35dd4f9..d8a6b40 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/ccid/OMNIKEYCardMan3621.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ccid/OMNIKEYCardMan3621.java
@@ -28,12 +28,17 @@ import org.apache.commons.logging.LogFactory;
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class OMNIKEYCardMan3621 extends DefaultReader {
+
+ public static final byte wPINMaxExtraDigitH = 0x01;
protected static final Log log = LogFactory.getLog(OMNIKEYCardMan3621.class);
-
+
public OMNIKEYCardMan3621(Card icc, CardTerminal ct) {
super(icc, ct);
- log.warn("This card reader does not support ACOS cards.");
- log.debug("TODO: fall back to software pin entry");
+ }
+
+ @Override
+ public byte getwPINMaxExtraDigitH() {
+ return wPINMaxExtraDigitH;
}
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ccid/ReaderFactory.java b/smcc/src/main/java/at/gv/egiz/smcc/ccid/ReaderFactory.java
index 07c16c3..1e3bdce 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/ccid/ReaderFactory.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ccid/ReaderFactory.java
@@ -27,10 +27,18 @@ import javax.smartcardio.CardTerminal;
public class ReaderFactory {
public static CCID getReader(Card icc, CardTerminal ct) {
- if ("Gemplus GemPC Pinpad 00 00".equals(ct.getName())) {
- return new GemplusGemPCPinpad(icc, ct);
- } else if ("OmniKey CardMan 3621 00 00".equals(ct.getName())) {
- return new OMNIKEYCardMan3621(icc, ct);
+ String name = ct.getName();
+ if (name != null) {
+ name = name.toLowerCase();
+ if(name.startsWith("gemplus gempc pinpad")) {
+ return new GemplusGemPCPinpad(icc, ct);
+ } else if (name.startsWith("omnikey cardman 3621")) {
+ return new OMNIKEYCardMan3621(icc, ct);
+ } else if (name.startsWith("scm microsystems inc. sprx32 usb smart card reader")) {
+ return new SCMMicrosystemsSPRx32(icc, ct);
+ } else if (name.startsWith("cherry smartboard xx44")) {
+ return new CherrySmartBoardXX44(icc, ct);
+ }
}
return new DefaultReader(icc, ct);
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ccid/SCMMicrosystemsSPRx32.java b/smcc/src/main/java/at/gv/egiz/smcc/ccid/SCMMicrosystemsSPRx32.java
new file mode 100644
index 0000000..133bc35
--- /dev/null
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ccid/SCMMicrosystemsSPRx32.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.smcc.ccid;
+
+import javax.smartcardio.Card;
+import javax.smartcardio.CardTerminal;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * bTimeOut: spr532 (win driver) interprets 0x00 as zero sec
+ * instead of default
+ *
+ * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
+ */
+public class SCMMicrosystemsSPRx32 extends DefaultReader {
+
+ public static final byte bTimeOut = 0x3c;
+ public static final byte bTimeOut2 = 0x0f;
+
+ protected final static Log log = LogFactory.getLog(SCMMicrosystemsSPRx32.class);
+
+ public SCMMicrosystemsSPRx32(Card icc, CardTerminal ct) {
+ super(icc, ct);
+ }
+
+ @Override
+ public byte getbTimeOut() {
+ return bTimeOut;
+ }
+
+ @Override
+ public byte getbTimeOut2() {
+ return bTimeOut2;
+ }
+
+}
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/PINProviderFactory.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/PINProviderFactory.java
index 78ae6c2..543fbb3 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/PINProviderFactory.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/PINProviderFactory.java
@@ -28,7 +28,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- *
+ * don't reuse the instance if the card reader might have changed!
* @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
*/
public class PINProviderFactory {