mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-08 18:08:46 +00:00
feat(legacy): Implement DoPreauthorized.
This commit is contained in:
parent
34dcd53135
commit
6d20fccefd
@ -68,6 +68,9 @@
|
|||||||
|
|
||||||
static uint8_t msg_resp[MSG_OUT_DECODED_SIZE] __attribute__((aligned));
|
static uint8_t msg_resp[MSG_OUT_DECODED_SIZE] __attribute__((aligned));
|
||||||
|
|
||||||
|
// Authorization message type triggered by DoPreauthorized.
|
||||||
|
static MessageType authorization_type = 0;
|
||||||
|
|
||||||
#define RESP_INIT(TYPE) \
|
#define RESP_INIT(TYPE) \
|
||||||
TYPE *resp = (TYPE *)(void *)msg_resp; \
|
TYPE *resp = (TYPE *)(void *)msg_resp; \
|
||||||
_Static_assert(sizeof(msg_resp) >= sizeof(TYPE), #TYPE " is too large"); \
|
_Static_assert(sizeof(msg_resp) >= sizeof(TYPE), #TYPE " is too large"); \
|
||||||
@ -403,6 +406,7 @@ void fsm_msgRebootToBootloader(void) {
|
|||||||
void fsm_abortWorkflows(void) {
|
void fsm_abortWorkflows(void) {
|
||||||
recovery_abort();
|
recovery_abort();
|
||||||
signing_abort();
|
signing_abort();
|
||||||
|
authorization_type = 0;
|
||||||
#if !BITCOIN_ONLY
|
#if !BITCOIN_ONLY
|
||||||
ethereum_signing_abort();
|
ethereum_signing_abort();
|
||||||
stellar_signingAbort();
|
stellar_signingAbort();
|
||||||
|
@ -87,6 +87,7 @@ void fsm_msgGetOwnershipId(const GetOwnershipId *msg);
|
|||||||
void fsm_msgGetOwnershipProof(const GetOwnershipProof *msg);
|
void fsm_msgGetOwnershipProof(const GetOwnershipProof *msg);
|
||||||
void fsm_msgAuthorizeCoinJoin(const AuthorizeCoinJoin *msg);
|
void fsm_msgAuthorizeCoinJoin(const AuthorizeCoinJoin *msg);
|
||||||
void fsm_msgCancelAuthorization(const CancelAuthorization *msg);
|
void fsm_msgCancelAuthorization(const CancelAuthorization *msg);
|
||||||
|
void fsm_msgDoPreauthorized(const DoPreauthorized *msg);
|
||||||
|
|
||||||
// crypto
|
// crypto
|
||||||
void fsm_msgCipherKeyValue(const CipherKeyValue *msg);
|
void fsm_msgCipherKeyValue(const CipherKeyValue *msg);
|
||||||
|
@ -701,3 +701,22 @@ void fsm_msgCancelAuthorization(const CancelAuthorization *msg) {
|
|||||||
fsm_sendSuccess(_("Authorization cancelled"));
|
fsm_sendSuccess(_("Authorization cancelled"));
|
||||||
layoutHome();
|
layoutHome();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fsm_msgDoPreauthorized(const DoPreauthorized *msg) {
|
||||||
|
(void)msg;
|
||||||
|
|
||||||
|
RESP_INIT(PreauthorizedRequest);
|
||||||
|
|
||||||
|
CHECK_INITIALIZED
|
||||||
|
|
||||||
|
authorization_type = config_getAuthorizationType();
|
||||||
|
if (authorization_type == 0) {
|
||||||
|
fsm_sendFailure(FailureType_Failure_ProcessError,
|
||||||
|
_("No preauthorized operation"));
|
||||||
|
layoutHome();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_write(MessageType_MessageType_PreauthorizedRequest, resp);
|
||||||
|
layoutHome();
|
||||||
|
}
|
||||||
|
@ -4,7 +4,7 @@ endif
|
|||||||
|
|
||||||
SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tezos WebAuthn \
|
SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tezos WebAuthn \
|
||||||
DebugLinkRecordScreen DebugLinkEraseSdCard DebugLinkWatchLayout \
|
DebugLinkRecordScreen DebugLinkEraseSdCard DebugLinkWatchLayout \
|
||||||
DoPreauthorized DebugLinkLayout GetNonce SetBusy UnlockPath \
|
DebugLinkLayout GetNonce SetBusy UnlockPath \
|
||||||
TxAckInput TxAckOutput TxAckPrev TxAckPaymentRequest \
|
TxAckInput TxAckOutput TxAckPrev TxAckPaymentRequest \
|
||||||
EthereumSignTypedData EthereumTypedDataStructRequest EthereumTypedDataStructAck \
|
EthereumSignTypedData EthereumTypedDataStructRequest EthereumTypedDataStructAck \
|
||||||
EthereumTypedDataValueRequest EthereumTypedDataValueAck
|
EthereumTypedDataValueRequest EthereumTypedDataValueAck
|
||||||
|
Loading…
Reference in New Issue
Block a user