mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-17 01:52:02 +00:00
check LoadDevice.skip_checksum field
This commit is contained in:
parent
983d1ff4b5
commit
10fc0b69fc
@ -42,6 +42,7 @@
|
|||||||
#include "hmac.h"
|
#include "hmac.h"
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
|
#include "bip39.h"
|
||||||
|
|
||||||
// message methods
|
// message methods
|
||||||
|
|
||||||
@ -295,6 +296,14 @@ void fsm_msgLoadDevice(LoadDevice *msg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (msg->has_mnemonic && !(msg->has_skip_checksum && msg->skip_checksum) ) {
|
||||||
|
if (!mnemonic_check(msg->mnemonic)) {
|
||||||
|
fsm_sendFailure(FailureType_Failure_ActionCancelled, "Mnemonic with wrong checksum provided");
|
||||||
|
layoutHome();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
storage_loadDevice(msg);
|
storage_loadDevice(msg);
|
||||||
storage_commit();
|
storage_commit();
|
||||||
fsm_sendSuccess("Device loaded");
|
fsm_sendSuccess("Device loaded");
|
||||||
|
Loading…
Reference in New Issue
Block a user