|
|
|
@ -75,6 +75,8 @@ void fsm_msgSignIdentity(const SignIdentity *msg) {
|
|
|
|
|
|
|
|
|
|
CHECK_INITIALIZED
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
layoutSignIdentity(&(msg->identity),
|
|
|
|
|
msg->has_challenge_visual ? msg->challenge_visual : 0);
|
|
|
|
|
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
|
|
|
@ -83,8 +85,6 @@ void fsm_msgSignIdentity(const SignIdentity *msg) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
uint8_t hash[32];
|
|
|
|
|
if (cryptoIdentityFingerprint(&(msg->identity), hash) == 0) {
|
|
|
|
|
fsm_sendFailure(FailureType_Failure_DataError, _("Invalid identity"));
|
|
|
|
@ -179,6 +179,8 @@ void fsm_msgGetECDHSessionKey(const GetECDHSessionKey *msg) {
|
|
|
|
|
|
|
|
|
|
CHECK_INITIALIZED
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
layoutDecryptIdentity(&msg->identity);
|
|
|
|
|
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
|
|
|
|
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
|
|
|
@ -186,8 +188,6 @@ void fsm_msgGetECDHSessionKey(const GetECDHSessionKey *msg) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
uint8_t hash[32];
|
|
|
|
|
if (cryptoIdentityFingerprint(&(msg->identity), hash) == 0) {
|
|
|
|
|
fsm_sendFailure(FailureType_Failure_DataError, _("Invalid identity"));
|
|
|
|
@ -258,6 +258,8 @@ void fsm_msgCosiCommit(const CosiCommit *msg) {
|
|
|
|
|
|
|
|
|
|
CHECK_PARAM(msg->has_data, _("No data provided"));
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
if (!fsm_checkCosiPath(msg->address_n_count, msg->address_n)) {
|
|
|
|
|
layoutHome();
|
|
|
|
|
return;
|
|
|
|
@ -271,8 +273,6 @@ void fsm_msgCosiCommit(const CosiCommit *msg) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
const HDNode *node = fsm_getDerivedNode(ED25519_NAME, msg->address_n,
|
|
|
|
|
msg->address_n_count, NULL);
|
|
|
|
|
if (!node) return;
|
|
|
|
@ -311,6 +311,8 @@ void fsm_msgCosiSign(const CosiSign *msg) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
layoutCosiCommitSign(msg->address_n, msg->address_n_count, msg->data.bytes,
|
|
|
|
|
msg->data.size, true);
|
|
|
|
|
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
|
|
|
@ -319,8 +321,6 @@ void fsm_msgCosiSign(const CosiSign *msg) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CHECK_PIN
|
|
|
|
|
|
|
|
|
|
const HDNode *node = fsm_getDerivedNode(ED25519_NAME, msg->address_n,
|
|
|
|
|
msg->address_n_count, NULL);
|
|
|
|
|
if (!node) return;
|
|
|
|
|