keystore: add timeout reset in keystore_encrypt_and_store_seed
What changed, and why it matters
This commit fixes a timeout issue during wallet creation or seed restoration on the BitBox02 hardware wallet. The operation of encrypting and storing a new seed could take longer than the default 500 millisecond USB communication timeout, causing the host software to think the device had stopped responding. The fix extends the allowed time for this specific operation. It is a reliability/usability fix rather than a security vulnerability in the cryptographic handling of the seed.
Treat as a minor reliability fix. No urgent security response is indicated by the commit content alone. If a security advisory is later published, reassess based on that external information.
Security signals we found
Timeout-related reliability fix in seed creation/restoration path
Change is localized to a single API function and does not alter cryptographic logic
No mention of authentication bypass, memory corruption, or information disclosure
Evidence from the diff
In keystore_encrypt_and_store_seed() in src/keystore.c, a call to usb_processing_timeout_reset(LONG_TIMEOUT) was added before securechip_init_new_password(). The function’s execution could exceed the default 500 ms USB processing timeout, leading to a timeout on the create/restore API calls. The patch extends the timeout window for this operation only.
Changed components
src/keystore.cWallet seed creation and restoration APIUSB processing timeout handlingInspect captured patch +3 / −0
diff --git a/src/keystore.c b/src/keystore.c
index c5cf4ab..2c3d72e 100644
--- a/src/keystore.c
+++ b/src/keystore.c
@@ -347,6 +347,9 @@ keystore_error_t keystore_encrypt_and_store_seed(
if (!_validate_seed_length(seed_length)) {
return KEYSTORE_ERR_SEED_SIZE;
}
+
+ usb_processing_timeout_reset(LONG_TIMEOUT);
+
if (securechip_init_new_password(password)) {
return KEYSTORE_ERR_SECURECHIP;
}
Why this scored 24/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.