Skip to content

Commit 0884c0e

Browse files
committed
hww: _api_info write byte for initialized status
Write another byte for the initialized status in the _api_info function. This field can be used to check whether a device can be unlocked or not. The unlocked byte is not sufficient because unlocked = false could mean the device is locked or the device is uninitialized.
1 parent 1d0a095 commit 0884c0e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately.
1313
- Bitcoin: allow spendung UTXOs at very high BIP-44 address indices
1414
- Ethereum: allow signing EIP-712 messages containing multi-line strings
1515
- Allow exiting the screen asking to insert the microSD card
16+
- HWW: add initialized status byte to _api_info response
1617

1718
### 9.18.0
1819
- Add support for deriving BIP-39 mnemonics according to BIP-85

src/hww.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <hardfault.h>
1818
#include <keystore.h>
19+
#include <memory/memory.h>
1920

2021
#include <platform_config.h>
2122
#include <rust/rust.h>
@@ -65,6 +66,7 @@ typedef struct {
6566
* - For the BitBoxBase platform (deprecated):
6667
" - 0x00 - Standard
6768
* 1 byte: 0x00 if the device is locked, 0x01 if the device is unlocked.
69+
* 1 byte: 0x00 if the device is uninitialized, 0x01 if the device is initialized.
6870
* @param[out] buf serialize info to this buffer.
6971
* @return number of bytes written
7072
*/
@@ -97,6 +99,10 @@ static size_t _api_info(uint8_t* buf)
9799
*current = keystore_is_locked() ? 0x00 : 0x01;
98100
current++;
99101

102+
// 1 byte initialized status
103+
*current = memory_is_initialized() ? 0x01 : 0x00;
104+
current++;
105+
100106
return current - buf;
101107
}
102108

0 commit comments

Comments
 (0)