mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-11 09:08:02 +00:00
add bitbox02 attestation failed dialog
This commit is contained in:
+1
-1
Submodule lark updated: a246d87cca...ddffe556f0
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user