summaryrefslogtreecommitdiff
path: root/smcc/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2010-01-19 12:10:37 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2010-01-19 12:10:37 +0000
commitd592f2a95096d4f234a24564b794c712359756fb (patch)
treea43f6c8b360f451348357259490c8247540daf7c /smcc/src/main/java/at/gv/egiz
parent9a3037ba70f14a246641eda772104a60b23770a1 (diff)
downloadmocca-d592f2a95096d4f234a24564b794c712359756fb.tar.gz
mocca-d592f2a95096d4f234a24564b794c712359756fb.tar.bz2
mocca-d592f2a95096d4f234a24564b794c712359756fb.zip
clear pin after use
bugfix correction/backspace button pinpadPinGUI git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@581 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smcc/src/main/java/at/gv/egiz')
-rw-r--r--smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java b/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java
index 45ea7a5a..6bf4a7de 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/reader/DefaultCardReader.java
@@ -35,6 +35,7 @@ import at.gv.egiz.smcc.VerifyAPDUSpec;
import at.gv.egiz.smcc.pin.gui.ModifyPINGUI;
import at.gv.egiz.smcc.pin.gui.PINGUI;
import at.gv.egiz.smcc.util.ISO7816Utils;
+import java.util.Arrays;
/**
*
@@ -61,7 +62,10 @@ public class DefaultCardReader implements CardReader {
throws SignatureCardException, CardException, InterruptedException {
log.debug("VERIFY");
- return channel.transmit(ISO7816Utils.createVerifyAPDU(apduSpec, pinGUI.providePIN(pinSpec, retries)));
+ char[] pin = pinGUI.providePIN(pinSpec, retries);
+ ResponseAPDU response = channel.transmit(ISO7816Utils.createVerifyAPDU(apduSpec, pin));
+ Arrays.fill(pin, '0');
+ return response;
}
@Override
@@ -69,9 +73,12 @@ public class DefaultCardReader implements CardReader {
ModifyPINGUI pinGUI, PINSpec pinSpec, int retries)
throws SignatureCardException, CardException, InterruptedException {
log.debug("MODIFY (CHANGE_REFERENCE_DATA)");
- char[] oldPin = pinGUI.provideCurrentPIN(pinSpec, retries);
- char[] newPin = pinGUI.provideNewPIN(pinSpec);
- return channel.transmit(ISO7816Utils.createChangeReferenceDataAPDU(apduSpec, oldPin, newPin));
+ char[] oldPIN = pinGUI.provideCurrentPIN(pinSpec, retries);
+ char[] newPIN = pinGUI.provideNewPIN(pinSpec);
+ ResponseAPDU response = channel.transmit(ISO7816Utils.createChangeReferenceDataAPDU(apduSpec, oldPIN, newPIN));
+ Arrays.fill(oldPIN, '0');
+ Arrays.fill(newPIN, '0');
+ return response;
}
@Override
@@ -80,7 +87,9 @@ public class DefaultCardReader implements CardReader {
throws SignatureCardException, CardException, InterruptedException {
log.debug("MODIFY (NEW_REFERENCE_DATA)");
char[] newPIN = pinGUI.provideNewPIN(pinSpec);
- return channel.transmit(ISO7816Utils.createNewReferenceDataAPDU(apduSpec, newPIN));
+ ResponseAPDU response = channel.transmit(ISO7816Utils.createNewReferenceDataAPDU(apduSpec, newPIN));
+ Arrays.fill(newPIN, '0');
+ return response;
}
@Override