diff options
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java | 14 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java | 15 |
2 files changed, 10 insertions, 19 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 b24761a9..a3b70d00 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 @@ -92,13 +92,13 @@ public class MobileBKUConnector implements BkuSlConnector { // 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());
- }
+ 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:
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 ebd434f7..2c5fbd48 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 @@ -461,10 +461,10 @@ public class MobileBKUState extends State { Display display = getStateMachine().getGUIProvider().getMainShell().getDisplay();
undecidedPolling();
- long startTime = System.nanoTime();
+ long timeoutTime = System.nanoTime() + (300 * ((long)1e9));
while (!waitingForAppcomposite.getUserCancel() && !waitingForAppcomposite.getUserSMS()
- && !waitingForAppcomposite.getIsDone() && !isTimout(startTime)) {
+ && !waitingForAppcomposite.getIsDone() && (System.nanoTime() < timeoutTime)) {
if (!display.readAndDispatch()) {
display.sleep();
}
@@ -490,7 +490,7 @@ public class MobileBKUState extends State { if (waitingForAppcomposite.getIsDone())
waitingForAppcomposite.setIsDone(false);
- if (isTimout(startTime)){
+ if (!(System.nanoTime() < timeoutTime)) {
log.warn("The undecided polling got a timeout");
status.setQRCode(null);
status.setErrorMessage("Polling Timeout");
@@ -593,15 +593,6 @@ public class MobileBKUState extends State { return this.getMobileBKUFingerprintComposite().isUserSMS();
}
-
- private boolean isTimout(long startTime){
- long NANOSEC_PER_SEC = 1000l*1000*1000;
- if ((System.nanoTime()-startTime)< 5*60*NANOSEC_PER_SEC){
- return false;
- }
- return true;
- }
-
/*
* (non-Javadoc)
*
|