mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 20:19:23 +00:00
Support interruption of the PIN wait dialog by Cancel and Initialize messages.
This commit is contained in:
parent
e49e84ea5a
commit
03e9ea4f5c
@ -345,9 +345,6 @@ void config_init(void)
|
||||
// TODO Add salt.
|
||||
storage_init(&protectPinUiCallback, (const uint8_t*)"", 0);
|
||||
|
||||
// TODO Remove
|
||||
storage_unlock(1);
|
||||
|
||||
uint16_t len = 0;
|
||||
if (sectrue == storage_get(KEY_UUID, config_uuid, sizeof(config_uuid), &len) && len == sizeof(config_uuid)) {
|
||||
data2hex(config_uuid, sizeof(config_uuid), config_uuid_str);
|
||||
@ -643,7 +640,7 @@ bool config_setMnemonic(const char *mnemonic)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sectrue != config_set_bool(KEY_INITIALIZED, true)) {
|
||||
if (!config_set_bool(KEY_INITIALIZED, true)) {
|
||||
storage_delete(KEY_MNEMONIC);
|
||||
return false;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ const char *requestPin(PinMatrixRequestType type, const char *text)
|
||||
}
|
||||
}
|
||||
|
||||
void protectPinUiCallback(uint32_t wait, uint32_t progress)
|
||||
secbool protectPinUiCallback(uint32_t wait, uint32_t progress)
|
||||
{
|
||||
(void) progress;
|
||||
|
||||
@ -166,16 +166,17 @@ void protectPinUiCallback(uint32_t wait, uint32_t progress)
|
||||
}
|
||||
layoutDialog(&bmp_icon_info, NULL, NULL, NULL, _("Wrong PIN entered"), NULL, _("Please wait"), secstr, _("to continue ..."), NULL);
|
||||
|
||||
/* TODO
|
||||
if (msg_tiny_id == MessageType_MessageType_Initialize) {
|
||||
protectAbortedByCancel = false;
|
||||
protectAbortedByInitialize = true;
|
||||
// Check for Cancel / Initialize.
|
||||
protectAbortedByCancel = (msg_tiny_id == MessageType_MessageType_Cancel);
|
||||
protectAbortedByInitialize = (msg_tiny_id == MessageType_MessageType_Initialize);
|
||||
if (protectAbortedByCancel || protectAbortedByInitialize) {
|
||||
msg_tiny_id = 0xFFFF;
|
||||
usbTiny(0);
|
||||
fsm_sendFailure(FailureType_Failure_PinCancelled, NULL);
|
||||
return false;
|
||||
return sectrue;
|
||||
}
|
||||
*/
|
||||
|
||||
return secfalse;
|
||||
}
|
||||
|
||||
bool protectPin(bool use_cached)
|
||||
|
@ -22,9 +22,10 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "messages-common.pb.h"
|
||||
#include "secbool.h"
|
||||
|
||||
bool protectButton(ButtonRequestType type, bool confirm_only);
|
||||
void protectPinUiCallback(uint32_t wait, uint32_t progress);
|
||||
secbool protectPinUiCallback(uint32_t wait, uint32_t progress);
|
||||
bool protectPin(bool use_cached);
|
||||
bool protectChangePin(bool removal);
|
||||
bool protectPassphrase(void);
|
||||
|
2
vendor/trezor-storage
vendored
2
vendor/trezor-storage
vendored
@ -1 +1 @@
|
||||
Subproject commit 6d9a4962a427717100517d59a4dcc1012199f0f5
|
||||
Subproject commit 4429888b9325d200b699a90f7a0e1a07d08f09c0
|
Loading…
Reference in New Issue
Block a user