summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-05 16:20:44 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-05 16:20:44 +0100
commit03b9af56efaec1adecfadc09327a14dc116a9c3a (patch)
tree9c3f5238dbbed83d1449b81e6a84796538bbd229 /pdf-over-gui/src
parent02bae5a8841e77f4409778576ffcebf3ab582d5e (diff)
downloadpdf-over-03b9af56efaec1adecfadc09327a14dc116a9c3a.tar.gz
pdf-over-03b9af56efaec1adecfadc09327a14dc116a9c3a.tar.bz2
pdf-over-03b9af56efaec1adecfadc09327a14dc116a9c3a.zip
support of all cases when pressing the sms tan button
Diffstat (limited to 'pdf-over-gui/src')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java29
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java20
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java3
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java4
5 files changed, 28 insertions, 30 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
index 891ff9f4..09e8d17d 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
@@ -88,20 +88,17 @@ public class MobileBKUConnector implements BkuSlConnector {
try {
String responseData = handler.postCredentials();
- if (responseData.contains("undecided.aspx?sid=")) { //$NON-NLS-1$
- // handle polling
+ if (responseData.contains("undecided.aspx?sid=")) { //$NON-NLS-1$
+ // handle polling
this.state.showOpenAppMessageWithSMSandCancel();
- if (((ATrustStatus) this.state.getStatus()).isSmsTan()) {
- ATrustHandler aHandler = (ATrustHandler) handler;
- String response = aHandler.postSMSRequest();
- aHandler.handleCredentialsResponse(response);
- } else if (handleErrorMessage()) {
- throw new SignatureException(new IllegalStateException());
- } else {
- handler.handlePolling(responseData);
- }
-
+ if (((ATrustStatus) this.state.getStatus()).isSmsTan()) {
+ ATrustHandler aHandler = (ATrustHandler) handler;
+ String response = aHandler.postSMSRequest();
+ aHandler.handleCredentialsResponse(response);
+ } else if (handleErrorMessage()) {
+ throw new SignatureException(new IllegalStateException());
+ }
} else {
// Now we have received some data lets check it:
@@ -149,7 +146,7 @@ public class MobileBKUConnector implements BkuSlConnector {
enterTAN = false;
}
}
- if (enterTAN && !aStatus.getTanField() && !aStatus.isSmsTan()) {
+ if (enterTAN && !aStatus.getTanField()) {
try {
this.state.showFingerPrintInformation();
@@ -158,9 +155,9 @@ public class MobileBKUConnector implements BkuSlConnector {
throw new SignatureException(new IllegalStateException());
} catch (Exception ex) {
log.error("Error in PostCredentialsThread", ex); //$NON-NLS-1$
- this.state.setThreadException(ex);
- this.state.displayError(ex);
- throw new SignatureException(ex);
+ this.state.setThreadException(new IllegalStateException());
+ //this.state.displayError(ex);
+ throw new SignatureException(new IllegalStateException());
}
if (this.state.getSMSStatus()) {
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
index 2c6f0e55..7d3f986a 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java
@@ -452,11 +452,10 @@ public class ATrustHandler extends MobileBKUHandler {
public Boolean handleWaitforAppResponse(String responseData) {
getStatus().setErrorMessage(null);
- if (!responseData.contains("Bitte starten Sie Ihre")) { //$NON-NLS-1$
- //getSigningState().setSignatureResponse(
- // new SLResponse(responseData, getStatus().getServer(), null, null));
+ if (!responseData.toLowerCase().contains("Bitte starten Sie Ihre Handy-Signatur App!".toLowerCase())/* || //$NON-NLS-1$
+ responseData.toLowerCase().contains("TAN (Handy-Signatur App)".toLowerCase())*/) { //$NON-NLS-1$
+
return true;
-
}
return false;
}
@@ -497,14 +496,15 @@ public class ATrustHandler extends MobileBKUHandler {
*
*/
@Override
- public void handlePolling(String responseData) throws ATrustConnectionException {
-
+ public boolean handlePolling() throws ATrustConnectionException {
+
ATrustStatus status = getStatus();
URLConnection urlconnection = null;
String isReady = null;
Status serverStatus = null;
int waits = 0;
final String ERROR = "Error: Server is not responding"; //$NON-NLS-1$
+
try {
do {
@@ -527,11 +527,11 @@ public class ATrustHandler extends MobileBKUHandler {
if (serverStatus.isFin()) {
String response = getSignaturePage();
handleCredentialsResponse(response);
- } else {
- status.setErrorMessage("Server reponded ERROR during polling"); //$NON-NLS-1$
- log.error("Server reponded ERROR during polling"); //$NON-NLS-1$
- throw new ATrustConnectionException();
+ return true;
}
+ status.setErrorMessage("Server reponded ERROR during polling"); //$NON-NLS-1$
+ log.error("Server reponded ERROR during polling"); //$NON-NLS-1$
+ throw new ATrustConnectionException();
} catch (Exception e) {
log.error("handle polling failed" + e.getMessage()); //$NON-NLS-1$
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java
index efb2b37d..2595de44 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/IAIKHandler.java
@@ -362,7 +362,8 @@ public class IAIKHandler extends MobileBKUHandler {
}
@Override
- public void handlePolling(String responseData) {
+ public boolean handlePolling() {
//nothing todo
+ return true;
}
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java
index 3ab47941..4c09c02d 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/MobileBKUHandler.java
@@ -356,5 +356,5 @@ public abstract class MobileBKUHandler {
/**
* @param responseData
*/
- public abstract void handlePolling(String responseData) throws ATrustConnectionException;
+ public abstract boolean handlePolling() throws ATrustConnectionException;
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java
index 3d98ab5e..116d5bb2 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java
@@ -458,10 +458,10 @@ public class MobileBKUState extends State {
@Override
public void run() {
- // ping signature page to see if code has been scanned
+ // ping signature page
try {
String resp = handler.getSignaturePage();
- if (handler.handleWaitforAppResponse(resp)) {
+ if (handler.handleWaitforAppResponse(resp) || handler.handlePolling()) {
log.debug("Signature page response: " + resp); //$NON-NLS-1$
getWaitingForAppComposite().setIsDone(true);
Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();