summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-11-16 15:58:07 +0100
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-11-16 15:58:07 +0100
commit9f1b46e1e92906b4f57d0076233a956566736f7b (patch)
treee8ae340551bde8016f261b9d8225de9a3939fe4d
parent34ac0c6b303f09771d3d2dbd5d44e3b8e932d17c (diff)
downloadpdf-over-9f1b46e1e92906b4f57d0076233a956566736f7b.tar.gz
pdf-over-9f1b46e1e92906b4f57d0076233a956566736f7b.tar.bz2
pdf-over-9f1b46e1e92906b4f57d0076233a956566736f7b.zip
do not force fido2 default if libfido2 is unavailable
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java3
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java4
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties1
-rw-r--r--pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties1
4 files changed, 6 insertions, 3 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 29bf880f..f9108b7d 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
@@ -48,6 +48,7 @@ import at.asit.pdfover.signer.BkuSlConnector;
import at.asit.pdfover.signer.SignatureException;
import at.asit.pdfover.signer.UserCancelledException;
import at.asit.pdfover.signer.pdfas.PdfAs4SLRequest;
+import at.asit.webauthn.WebAuthN;
import static at.asit.pdfover.commons.Constants.ISNOTNULL;
@@ -57,7 +58,7 @@ public class MobileBKUConnector implements BkuSlConnector {
private final @Nonnull MobileBKUState state;
public MobileBKUConnector(@Nonnull MobileBKUState state) {
this.state = state;
- this.wantsFido2Default = state.getConfig().getFido2ByDefault();
+ this.wantsFido2Default = WebAuthN.isAvailable() && state.getConfig().getFido2ByDefault();
state.storeRememberedCredentialsTo(this.credentials);
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java
index 547f217f..b0506596 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java
@@ -48,7 +48,6 @@ public class MobileBKUFido2Composite extends StateComposite {
this.fido2OptionsString = fido2Options;
this.credential = null;
this.userCancel = this.userSms = false;
- this.btn_authenticate.setEnabled(WebAuthN.isAvailable());
}
public boolean isDone() { return ((this.credential != null) || this.userCancel || this.userSms); }
@@ -106,6 +105,7 @@ public class MobileBKUFido2Composite extends StateComposite {
this.btn_authenticate = new Button(containerComposite, SWT.NATIVE);
SWTUtils.anchor(btn_authenticate).top(50, -15).left(0, 90).right(100, -90);
SWTUtils.addSelectionListener(btn_authenticate, this::beginAuthentication);
+ btn_authenticate.setEnabled(WebAuthN.isAvailable());
this.btn_cancel = new Button(containerComposite, SWT.NATIVE);
SWTUtils.anchor(btn_cancel).bottom(100, -10).right(100, -10);
@@ -124,7 +124,7 @@ public class MobileBKUFido2Composite extends StateComposite {
@Override
public void reloadResources() {
- SWTUtils.setLocalizedText(btn_authenticate, "mobileBKU.authorize");
+ SWTUtils.setLocalizedText(btn_authenticate, WebAuthN.isAvailable() ? "mobileBKU.authorize" : "common.unavailable");
SWTUtils.setLocalizedText(btn_cancel, "common.Cancel");
SWTUtils.setLocalizedText(btn_sms, "tanEnter.SMS");
SWTUtils.setLocalizedText(lnk_sigData, "mobileBKU.show");
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
index a1027e3e..c183648e 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties
@@ -115,6 +115,7 @@ common.info=Information
common.open=Open
common.warning=Warning
common.working=Working...
+common.unavailable=Unavailable
config.About=A&bout %s
config.AboutText=This software is freely provided by A-SIT under the conditions of the EUPL.\nTerms and details at <a>https\://technology.a-sit.at/en/terms-of-a-license/</a>.\n\nNote that components may have different licenses, partly restricting their free use to EUPL-licensed software.
config.LicenseURL=https://technology.a-sit.at/en/terms-of-a-license/
diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
index 82a49c25..a6326706 100644
--- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
+++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties
@@ -106,6 +106,7 @@ common.info=Information
common.open=Öffnen
common.warning=Warnung
common.working=In Arbeit...
+common.unavailable=Nicht verfügbar
config.About=Ü&ber %s
config.AboutText=Diese Software wird von A-SIT unter den Bedingungen der EUPL frei zur Verfügung gestellt.\nLizenbedingungen unter <a>https://technology.a-sit.at/lizenzbedingungen/</a>.\n\nBeachten Sie, dass Komponenten unter eigenen Lizenzen zur Verfügung gestellt werden, die teilweise nur für EUPL-lizensierte Software zur freien Verwendung vorgesehen sind.
config.LicenseURL=https://technology.a-sit.at/lizenzbedingungen/