mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
legacy: remove redundant failure response
This commit is contained in:
parent
b96d7cafbb
commit
f21c13f0bd
@ -31,6 +31,7 @@
|
||||
#include "config.h"
|
||||
#include "curves.h"
|
||||
#include "debug.h"
|
||||
#include "fsm.h"
|
||||
#include "gettext.h"
|
||||
#include "hmac.h"
|
||||
#include "layout2.h"
|
||||
@ -581,6 +582,9 @@ const uint8_t *config_getSeed(void) {
|
||||
usbTiny(oldTiny);
|
||||
sessionSeedCached = sectrue;
|
||||
return sessionSeed;
|
||||
} else {
|
||||
fsm_sendFailure(FailureType_Failure_NotInitialized,
|
||||
_("Device not initialized"));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -610,8 +614,12 @@ bool config_getRootNode(HDNode *node, const char *curve) {
|
||||
if (seed == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return hdnode_from_seed(seed, 64, curve, node);
|
||||
int result;
|
||||
result = hdnode_from_seed(seed, 64, curve, node);
|
||||
if (result == 0) {
|
||||
fsm_sendFailure(FailureType_Failure_NotInitialized, _("Unsupported curve"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool config_getLabel(char *dest, uint16_t dest_size) {
|
||||
|
@ -213,9 +213,6 @@ static HDNode *fsm_getDerivedNode(const char *curve, const uint32_t *address_n,
|
||||
*fingerprint = 0;
|
||||
}
|
||||
if (!config_getRootNode(&node, curve)) {
|
||||
fsm_sendFailure(FailureType_Failure_NotInitialized,
|
||||
_("Device not initialized or passphrase request cancelled "
|
||||
"or unsupported curve"));
|
||||
layoutHome();
|
||||
return 0;
|
||||
}
|
||||
|
@ -397,8 +397,9 @@ bool protectPassphrase(char *passphrase) {
|
||||
protectAbortedByInitialize =
|
||||
(msg_tiny_id == MessageType_MessageType_Initialize);
|
||||
if (protectAbortedByCancel || protectAbortedByInitialize) {
|
||||
msg_tiny_id = 0xFFFF;
|
||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
||||
result = false;
|
||||
msg_tiny_id = 0xFFFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user