Skip to content

Commit 763491a

Browse files
committed
Merge branch 'bluetooth-hex-lit'
2 parents ce66917 + a54cfd6 commit 763491a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/rust/bitbox02-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ bip39 = { workspace = true }
5757
# writing, this might fluctuate over time).
5858
bitcoin_hashes = { version = "0.14.0", default-features = false, features = ["small-hash"] }
5959
futures-lite = { workspace = true }
60+
hex_lit = { workspace = true, features = ["rust_v_1_46"] }
6061

6162
[dependencies.prost]
6263
# keep version in sync with tools/prost-build/Cargo.toml.
@@ -66,7 +67,6 @@ features = ["derive"]
6667

6768
[dev-dependencies]
6869
bitbox-aes = { path = "../bitbox-aes" }
69-
hex_lit = { workspace = true }
7070

7171
[features]
7272
ed25519 = [

src/rust/bitbox02-rust/src/hww/api/bluetooth.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use super::Error;
1616
use super::pb;
1717

18+
use hex_lit::hex;
19+
1820
use pb::bluetooth_request::Request;
1921
use pb::bluetooth_response::Response;
2022

@@ -27,7 +29,9 @@ use alloc::vec::Vec;
2729

2830
use bitbox02::{memory, spi_mem};
2931

30-
const ALLOWED_HASH: &[u8; 32] = b"\x1e\x4a\xa8\x36\x4e\x93\x5c\x07\x85\xe4\xf8\x91\x20\x83\x07\xd8\x32\xf7\x88\x17\x2e\x4b\xf6\x16\x21\xde\x6d\xf9\xec\x3c\x21\x5f";
32+
// See also bitbox-da14531-firmware.bin.sha256.
33+
const ALLOWED_HASH: [u8; 32] =
34+
hex!("1e4aa8364e935c0785e4f891208307d832f788172e4bf61621de6df9ec3c215f");
3135

3236
// We want to write FW to the memory chip in erase-size chunks, so that we don't repeatedly need to
3337
// read-erase-write the same sector.
@@ -159,7 +163,7 @@ async fn process_upgrade(
159163
})
160164
.await?;
161165

162-
let response = _process_upgrade(&mut RealFuncs, request, ALLOWED_HASH).await;
166+
let response = _process_upgrade(&mut RealFuncs, request, &ALLOWED_HASH).await;
163167

164168
if response.is_ok() {
165169
hal.ui().status("Upgrade\nsuccessful", true).await;

0 commit comments

Comments
 (0)