|
|
|
@ -42,6 +42,7 @@
|
|
|
|
|
#include "hmac.h"
|
|
|
|
|
#include "crypto.h"
|
|
|
|
|
#include "base58.h"
|
|
|
|
|
#include "bip39.h"
|
|
|
|
|
|
|
|
|
|
// message methods
|
|
|
|
|
|
|
|
|
@ -295,6 +296,14 @@ void fsm_msgLoadDevice(LoadDevice *msg)
|
|
|
|
|
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_commit();
|
|
|
|
|
fsm_sendSuccess("Device loaded");
|
|
|
|
|