feat(legacy): enable DebugLinkReseedRandom

mmilata/tt-pin-keyboard
matejcik 2 years ago committed by matejcik
parent 658c50fc1f
commit e81bb0f856

@ -0,0 +1 @@
\[emulator] Added support for `DebugLinkReseedRandom`.

@ -94,6 +94,7 @@ void fsm_msgDebugLinkStop(const DebugLinkStop *msg);
void fsm_msgDebugLinkMemoryWrite(const DebugLinkMemoryWrite *msg);
void fsm_msgDebugLinkMemoryRead(const DebugLinkMemoryRead *msg);
void fsm_msgDebugLinkFlashErase(const DebugLinkFlashErase *msg);
void fsm_msgDebugLinkReseedRandom(const DebugLinkReseedRandom *msg);
#endif
// ethereum

@ -100,4 +100,20 @@ void fsm_msgDebugLinkFlashErase(const DebugLinkFlashErase *msg) {
uint32_t dummy = svc_flash_lock();
(void)dummy;
}
void fsm_msgDebugLinkReseedRandom(const DebugLinkReseedRandom *msg) {
#if EMULATOR
RESP_INIT(Success);
random_reseed(msg->value);
msg_debug_write(MessageType_MessageType_Success, resp);
#else
(void)msg;
RESP_INIT(Failure);
resp->code = FailureType_Failure_UnexpectedMessage;
resp->has_message = true;
strlcpy(resp->message, "ReseedRandom not supported on hardware",
sizeof(resp->message));
msg_debug_write(MessageType_MessageType_Failure, resp);
#endif
}
#endif

@ -3,7 +3,7 @@ Q := @
endif
SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tezos WebAuthn \
DebugLinkRecordScreen DebugLinkReseedRandom DebugLinkShowText DebugLinkEraseSdCard DebugLinkWatchLayout \
DebugLinkRecordScreen DebugLinkEraseSdCard DebugLinkWatchLayout \
GetOwnershipProof OwnershipProof GetOwnershipId OwnershipId AuthorizeCoinJoin DoPreauthorized \
CancelAuthorization DebugLinkLayout GetNonce \
TxAckInput TxAckOutput TxAckPrev TxAckPaymentRequest \

Loading…
Cancel
Save