From d2934c94c510b7913a3a571d4f4fa74c11cd14a1 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 14 Mar 2024 09:05:14 +0200 Subject: [PATCH] disable manifest field in download verify dialog if signature signs release file directly --- .../sparrow/control/DownloadVerifierDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java index ee3f8f92..ecf4008e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DownloadVerifierDialog.java @@ -71,6 +71,7 @@ public class DownloadVerifierDialog extends Dialog { private final ObjectProperty publicKey = new SimpleObjectProperty<>(); private final ObjectProperty release = new SimpleObjectProperty<>(); + private final BooleanProperty manifestDisabled = new SimpleBooleanProperty(); private final BooleanProperty publicKeyDisabled = new SimpleBooleanProperty(); private final Label signedBy; @@ -100,7 +101,7 @@ public class DownloadVerifierDialog extends Dialog { String version = VersionCheckService.getVersion() != null ? VersionCheckService.getVersion() : "x.x.x"; Field signatureField = setupField(signature, "Signature", SIGNATURE_EXTENSIONS, false, "sparrow-" + version + "-manifest.txt", null); - Field manifestField = setupField(manifest, "Manifest", MANIFEST_EXTENSIONS, false, "sparrow-" + version + "-manifest", null); + Field manifestField = setupField(manifest, "Manifest", MANIFEST_EXTENSIONS, false, "sparrow-" + version + "-manifest", manifestDisabled); Field publicKeyField = setupField(publicKey, "Public Key", PUBLIC_KEY_EXTENSIONS, true, "pgp_keys", publicKeyDisabled); Field releaseFileField = setupField(release, "Release File", getReleaseFileExtensions(), false, getReleaseFileExample(version), null); @@ -264,6 +265,7 @@ public class DownloadVerifierDialog extends Dialog { } private void verify() { + manifestDisabled.set(false); publicKeyDisabled.set(false); if(signature.get() == null || manifest.get() == null) { @@ -291,6 +293,7 @@ public class DownloadVerifierDialog extends Dialog { } if(manifest.get().equals(release.get())) { + manifestDisabled.set(true); releaseHash.setText("No hash required, signature signs release file directly"); releaseHash.setGraphic(GlyphUtils.getSuccessGlyph()); releaseHash.setTooltip(null);