1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

Include placeholder handlers for the Ethereum protocol

This commit is contained in:
Alex Beregszaszi 2016-05-23 21:27:18 +01:00
parent c29457337b
commit bf465357ee
4 changed files with 28 additions and 0 deletions

View File

@ -59,3 +59,4 @@ CFLAGS += -DDEBUG_LOG=0
CFLAGS += -DSCM_REVISION='"$(shell git rev-parse HEAD | sed 's:\(..\):\\x\1:g')"'
CFLAGS += -DED25519_CUSTOMRANDOM=1
CFLAGS += -DED25519_CUSTOMHASH=1
CFLAGS += -DUSE_ETHEREUM=1

View File

@ -419,6 +419,19 @@ void fsm_msgSignTx(SignTx *msg)
signing_init(msg->inputs_count, msg->outputs_count, coin, node, msg->version, msg->lock_time);
}
void fsm_msgEthereumSignTx(EthereumSignTx *msg)
{
(void)msg;
fsm_sendFailure(FailureType_Failure_Other, "Unsupported feature");
}
void fsm_msgEthereumTxAck(EthereumTxAck *msg)
{
(void)msg;
fsm_sendFailure(FailureType_Failure_Other, "Unsupported feature");
}
void fsm_msgCancel(Cancel *msg)
{
(void)msg;
@ -628,6 +641,12 @@ void fsm_msgGetAddress(GetAddress *msg)
layoutHome();
}
void fsm_msgEthereumGetAddress(EthereumGetAddress *msg)
{
(void)msg;
fsm_sendFailure(FailureType_Failure_Other, "Unsupported feature");
}
void fsm_msgEntropyAck(EntropyAck *msg)
{
if (msg->has_entropy) {

View File

@ -59,6 +59,9 @@ void fsm_msgEstimateTxSize(EstimateTxSize *msg);
void fsm_msgRecoveryDevice(RecoveryDevice *msg);
void fsm_msgWordAck(WordAck *msg);
void fsm_msgSetU2FCounter(SetU2FCounter *msg);
void fsm_msgEthereumGetAddress(EthereumGetAddress *msg);
void fsm_msgEthereumSignTx(EthereumSignTx *msg);
void fsm_msgEthereumTxAck(EthereumTxAck *msg);
// debug message functions
#if DEBUG_LINK

View File

@ -73,6 +73,9 @@ static const struct MessagesMap_t MessagesMap[] = {
{'n', 'i', MessageType_MessageType_RecoveryDevice, RecoveryDevice_fields, (void (*)(void *))fsm_msgRecoveryDevice},
{'n', 'i', MessageType_MessageType_WordAck, WordAck_fields, (void (*)(void *))fsm_msgWordAck},
{'n', 'i', MessageType_MessageType_SetU2FCounter, SetU2FCounter_fields, (void (*)(void *))fsm_msgSetU2FCounter},
{'n', 'i', MessageType_MessageType_EthereumGetAddress, EthereumGetAddress_fields, (void (*)(void *))fsm_msgEthereumGetAddress},
{'n', 'i', MessageType_MessageType_EthereumSignTx, EthereumSignTx_fields, (void (*)(void *))fsm_msgEthereumSignTx},
{'n', 'i', MessageType_MessageType_EthereumTxAck, EthereumTxAck_fields, (void (*)(void *))fsm_msgEthereumTxAck},
// out messages
{'n', 'o', MessageType_MessageType_Success, Success_fields, 0},
{'n', 'o', MessageType_MessageType_Failure, Failure_fields, 0},
@ -95,6 +98,8 @@ static const struct MessagesMap_t MessagesMap[] = {
{'n', 'o', MessageType_MessageType_PassphraseRequest, PassphraseRequest_fields, 0},
{'n', 'o', MessageType_MessageType_TxSize, TxSize_fields, 0},
{'n', 'o', MessageType_MessageType_WordRequest, WordRequest_fields, 0},
{'n', 'o', MessageType_MessageType_EthereumAddress, EthereumAddress_fields, 0},
{'n', 'o', MessageType_MessageType_EthereumTxRequest, EthereumTxRequest_fields, 0},
#if DEBUG_LINK
// debug in messages
// {'d', 'i', MessageType_MessageType_DebugLinkDecision, DebugLinkDecision_fields, (void (*)(void *))fsm_msgDebugLinkDecision},