From 1a810c062044d3d432ec8e2cccd7eb5752d71221 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 4 Aug 2026 14:54:50 +0200 Subject: [PATCH] add bitbox02 attestation failed dialog --- lark | 2 +- .../java/com/sparrowwallet/sparrow/io/Hwi.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lark b/lark index a246d87c..ddffe556 160000 --- a/lark +++ b/lark @@ -1 +1 @@ -Subproject commit a246d87ccafab476636dcdcf878851cb43f572d8 +Subproject commit ddffe556f0d1ba6a138be3b362ce74219fed0710 diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java index fd9fa8d2..9c3165b2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java @@ -541,12 +541,27 @@ public class Hwi { } private static final class BitBoxFxNoiseConfig extends BitBoxFileNoiseConfig { + private static final AtomicBoolean attestationWarningShown = new AtomicBoolean(false); + private BitBoxPairingDialog pairingDialog; public BitBoxFxNoiseConfig() { super(Path.of(Storage.getDataHome().getAbsolutePath(), LARK_HOME_DIR, BITBOX_FILENAME).toFile()); } + @Override + public void attestationCheck(boolean result) { + if(!result) { + log.warn("BitBox02 attestation check failed, device may not be genuine"); + //Devices are opened repeatedly while enumerating, so warn only once per session + if(attestationWarningShown.compareAndSet(false, true)) { + Platform.runLater(() -> AppServices.showWarningDialog("BitBox02 Attestation Failed", + "This BitBox02 did not pass the attestation check, which means it may not be a genuine device.\n\n" + + "Do not use it to store funds until you have verified it externally.")); + } + } + } + @Override public boolean showPairing(String code, DeviceResponse response) throws DeviceException { CountDownLatch latch = new CountDownLatch(1);