From 2be4c7f179bb50c1b9103f16912310afd4be2686 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 7 Apr 2009 09:13:14 +0000 Subject: [maven-release-plugin] copy for tag mocca-1.1.0 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/tags/mocca-1.1.0@330 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- BKUApplet/pom.xml | 14 +- BKUAppletExt/pom.xml | 14 +- BKUCommonGUI/pom.xml | 8 +- BKULocal/pom.xml | 22 +-- BKULocalApp/pom.xml | 8 +- BKUOnline/nbactions.xml | 13 ++ BKUOnline/pom.xml | 24 +-- .../egiz/bku/online/webapp/AppletDispatcher.java | 16 +- BKUOnline/src/main/webapp/applet.jsp | 5 +- BKUViewer/pom.xml | 6 +- STAL/pom.xml | 4 +- STALExt/pom.xml | 6 +- STALService/pom.xml | 6 +- STALXService/pom.xml | 10 +- bkucommon/pom.xml | 17 +-- .../at/gv/egiz/bku/binding/ExpiryRemoverTest.java | 7 +- nbactions.xml | 7 + pom.xml | 8 +- smcc/pom.xml | 4 +- .../src/main/java/at/gv/egiz/smcc/STARCOSCard.java | 10 +- .../at/gv/egiz/smcc/ccid/CherrySmartBoardXX44.java | 42 ++++++ .../java/at/gv/egiz/smcc/ccid/DefaultReader.java | 162 +++------------------ .../at/gv/egiz/smcc/ccid/GemplusGemPCPinpad.java | 23 +-- .../at/gv/egiz/smcc/ccid/OMNIKEYCardMan3621.java | 11 +- .../java/at/gv/egiz/smcc/ccid/ReaderFactory.java | 16 +- .../gv/egiz/smcc/ccid/SCMMicrosystemsSPRx32.java | 51 +++++++ smccSTAL/pom.xml | 10 +- .../gv/egiz/bku/smccstal/PINProviderFactory.java | 2 +- utils/pom.xml | 4 +- 29 files changed, 259 insertions(+), 271 deletions(-) create mode 100644 BKUOnline/nbactions.xml create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/ccid/CherrySmartBoardXX44.java create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/ccid/SCMMicrosystemsSPRx32.java diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml index da5dbc6f..a0777ee6 100644 --- a/BKUApplet/pom.xml +++ b/BKUApplet/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKUApplet BKU Applet - 1.0.5-SNAPSHOT + 1.1.0 @@ -74,27 +74,27 @@ at.gv.egiz smcc - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz STAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz STALService - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz smccSTAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz BKUCommonGUI - 1.0.5-SNAPSHOT + 1.1.0 \ No newline at end of file diff --git a/BKUAppletExt/pom.xml b/BKUAppletExt/pom.xml index 3ff88ed8..69daa021 100644 --- a/BKUAppletExt/pom.xml +++ b/BKUAppletExt/pom.xml @@ -3,34 +3,34 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKUAppletExt BKU Applet Extension - 1.0.2-SNAPSHOT - + 1.1.0 + at.gv.egiz STALExt - 1.0.2-SNAPSHOT + 1.1.0 at.gv.egiz STALXService - 1.0.2-SNAPSHOT + 1.1.0 at.gv.egiz smccSTAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz BKUApplet - 1.0.5-SNAPSHOT + 1.1.0 diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml index 47cd7545..34a13fdd 100644 --- a/BKUCommonGUI/pom.xml +++ b/BKUCommonGUI/pom.xml @@ -2,23 +2,23 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKUCommonGUI BKU Common GUI - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz smcc - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz STAL - 1.0.5-SNAPSHOT + 1.1.0 compile diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml index 5fd142a2..a211da42 100644 --- a/BKULocal/pom.xml +++ b/BKULocal/pom.xml @@ -2,19 +2,19 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKULocal war BKU Local - 1.0.2-SNAPSHOT + 1.0.3 - scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal - scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal - scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal + scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.1.0/BKULocal + scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.1.0/BKULocal + scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.1.0/BKULocal @@ -56,22 +56,22 @@ at.gv.egiz STAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz bkucommon - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz smcc - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz smccSTAL - 1.0.5-SNAPSHOT + 1.1.0 org.springframework @@ -96,12 +96,12 @@ at.gv.egiz BKUApplet - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz BKUViewer - 1.0.5-SNAPSHOT + 1.1.0 diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml index bce6f584..d94b4893 100644 --- a/BKULocalApp/pom.xml +++ b/BKULocalApp/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKULocalApp BKU Local App - 1.0.2-SNAPSHOT + 1.0.3 @@ -76,13 +76,13 @@ at.gv.egiz BKULocal - 1.0.2-SNAPSHOT + 1.0.3 war utils at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 compile diff --git a/BKUOnline/nbactions.xml b/BKUOnline/nbactions.xml new file mode 100644 index 00000000..e09cc3da --- /dev/null +++ b/BKUOnline/nbactions.xml @@ -0,0 +1,13 @@ + + + + CUSTOM-Package_skipTest + Package_skipTest + + package + + + true + + + diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml index fc5f04fa..98090fcc 100644 --- a/BKUOnline/pom.xml +++ b/BKUOnline/pom.xml @@ -3,14 +3,14 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz BKUOnline war BKU Online - 1.0.5-SNAPSHOT + 1.1.0 @@ -24,12 +24,12 @@ at.gv.egiz bkucommon - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz BKUViewer - 1.0.5-SNAPSHOT + 1.1.0 commons-logging @@ -53,13 +53,13 @@ at.gv.egiz STALService - 1.0.5-SNAPSHOT + 1.1.0 compile at.gv.egiz STALService - 1.0.5-SNAPSHOT + 1.1.0 + true + true org.apache.maven.plugins maven-jar-plugin @@ -52,12 +49,12 @@ at.gv.egiz utils - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz STALExt - 1.0.2-SNAPSHOT + 1.1.0 commons-logging 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 0e64e7a2..18ccc11a 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 4c3d57a9..0fbc828f 100644 --- a/nbactions.xml +++ b/nbactions.xml @@ -10,4 +10,11 @@ true + + CUSTOM-release:prepare + release:prepare + + release:prepare + + diff --git a/pom.xml b/pom.xml index 2ba2b2ae..98470ab0 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ at.gv.egiz bku pom - 1.0.5-SNAPSHOT + 1.1.0 BKU http://bku.egiz.gv.at @@ -41,9 +41,9 @@ - scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk - scm:svn:svn+ssh://svn.egovlabs.gv.at/svnroot/mocca/trunk - svn://svn.egovlabs.gv.at/svnroot/mocca/trunk + scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.1.0 + scm:svn:svn+ssh://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.1.0 + svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.1.0 E-Government Innovation Center (EGIZ) diff --git a/smcc/pom.xml b/smcc/pom.xml index 59128c43..e0e0526d 100644 --- a/smcc/pom.xml +++ b/smcc/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz smcc smcc jar - 1.0.5-SNAPSHOT + 1.1.0 http://bku.egiz.gv.at 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 b9c68b06..e622f65a 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 00000000..a7e45765 --- /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 + */ +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 9b1787a0..b203ae52 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 903b11fc..ff6d004b 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 */ 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 35dd4f99..d8a6b40d 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 */ 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 07c16c3e..1e3bdce2 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 00000000..133bc350 --- /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 + */ +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/pom.xml b/smccSTAL/pom.xml index 02e80632..29362f30 100644 --- a/smccSTAL/pom.xml +++ b/smccSTAL/pom.xml @@ -2,13 +2,13 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz smccSTAL smcc STAL - 1.0.5-SNAPSHOT + 1.1.0 @@ -24,17 +24,17 @@ at.gv.egiz STAL - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz smcc - 1.0.5-SNAPSHOT + 1.1.0 at.gv.egiz BKUCommonGUI - 1.0.5-SNAPSHOT + 1.1.0 iaik 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 78ae6c2b..543fbb3a 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 */ public class PINProviderFactory { diff --git a/utils/pom.xml b/utils/pom.xml index aabab561..97938813 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -2,14 +2,14 @@ bku at.gv.egiz - 1.0.5-SNAPSHOT + 1.1.0 4.0.0 at.gv.egiz utils BKU Utils jar - 1.0.5-SNAPSHOT + 1.1.0 http://bku.egiz.gv.at -- cgit v1.2.3