check LoadDevice.skip_checksum field

pull/25/head
Pavol Rusnak 10 years ago
parent 983d1ff4b5
commit 10fc0b69fc

@ -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");

Loading…
Cancel
Save