2014-04-29 12:26:51 +00:00
|
|
|
/*
|
2017-11-05 16:46:34 +00:00
|
|
|
* This file is part of the TREZOR project, https://trezor.io/
|
2014-04-29 12:26:51 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Pavol Rusnak <stick@satoshilabs.com>
|
|
|
|
*
|
|
|
|
* This library is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FSM_H__
|
|
|
|
#define __FSM_H__
|
|
|
|
|
|
|
|
#include "messages.pb.h"
|
|
|
|
|
|
|
|
// message functions
|
|
|
|
|
|
|
|
void fsm_sendSuccess(const char *text);
|
|
|
|
void fsm_sendFailure(FailureType code, const char *text);
|
|
|
|
|
|
|
|
void fsm_msgInitialize(Initialize *msg);
|
2015-03-30 13:47:03 +00:00
|
|
|
void fsm_msgGetFeatures(GetFeatures *msg);
|
2014-04-29 12:26:51 +00:00
|
|
|
void fsm_msgPing(Ping *msg);
|
|
|
|
void fsm_msgChangePin(ChangePin *msg);
|
|
|
|
void fsm_msgWipeDevice(WipeDevice *msg);
|
|
|
|
void fsm_msgGetEntropy(GetEntropy *msg);
|
|
|
|
void fsm_msgGetPublicKey(GetPublicKey *msg);
|
|
|
|
void fsm_msgLoadDevice(LoadDevice *msg);
|
|
|
|
void fsm_msgResetDevice(ResetDevice *msg);
|
2017-06-26 17:17:40 +00:00
|
|
|
void fsm_msgBackupDevice(BackupDevice *msg);
|
2014-04-29 12:26:51 +00:00
|
|
|
void fsm_msgSignTx(SignTx *msg);
|
|
|
|
//void fsm_msgPinMatrixAck(PinMatrixAck *msg);
|
|
|
|
void fsm_msgCancel(Cancel *msg);
|
|
|
|
void fsm_msgTxAck(TxAck *msg);
|
2014-06-07 12:21:59 +00:00
|
|
|
void fsm_msgCipherKeyValue(CipherKeyValue *msg);
|
2014-06-17 14:03:07 +00:00
|
|
|
void fsm_msgClearSession(ClearSession *msg);
|
2014-04-29 12:26:51 +00:00
|
|
|
void fsm_msgApplySettings(ApplySettings *msg);
|
2017-07-17 16:36:09 +00:00
|
|
|
void fsm_msgApplyFlags(ApplyFlags *msg);
|
2014-04-29 12:26:51 +00:00
|
|
|
//void fsm_msgButtonAck(ButtonAck *msg);
|
|
|
|
void fsm_msgGetAddress(GetAddress *msg);
|
|
|
|
void fsm_msgEntropyAck(EntropyAck *msg);
|
|
|
|
void fsm_msgSignMessage(SignMessage *msg);
|
|
|
|
void fsm_msgVerifyMessage(VerifyMessage *msg);
|
2015-02-20 19:22:05 +00:00
|
|
|
void fsm_msgSignIdentity(SignIdentity *msg);
|
2016-06-16 19:40:21 +00:00
|
|
|
void fsm_msgGetECDHSessionKey(GetECDHSessionKey *msg);
|
2017-06-22 10:40:39 +00:00
|
|
|
/* ECIES disabled
|
2014-10-22 17:53:25 +00:00
|
|
|
void fsm_msgEncryptMessage(EncryptMessage *msg);
|
|
|
|
void fsm_msgDecryptMessage(DecryptMessage *msg);
|
2017-06-22 10:40:39 +00:00
|
|
|
*/
|
2014-04-29 12:26:51 +00:00
|
|
|
//void fsm_msgPassphraseAck(PassphraseAck *msg);
|
|
|
|
void fsm_msgRecoveryDevice(RecoveryDevice *msg);
|
|
|
|
void fsm_msgWordAck(WordAck *msg);
|
2016-06-12 21:39:28 +00:00
|
|
|
void fsm_msgSetU2FCounter(SetU2FCounter *msg);
|
2016-05-23 20:27:18 +00:00
|
|
|
void fsm_msgEthereumGetAddress(EthereumGetAddress *msg);
|
|
|
|
void fsm_msgEthereumSignTx(EthereumSignTx *msg);
|
|
|
|
void fsm_msgEthereumTxAck(EthereumTxAck *msg);
|
2017-07-02 14:12:56 +00:00
|
|
|
void fsm_msgEthereumSignMessage(EthereumSignMessage *msg);
|
|
|
|
void fsm_msgEthereumVerifyMessage(EthereumVerifyMessage *msg);
|
2014-04-29 12:26:51 +00:00
|
|
|
|
2017-05-29 16:07:55 +00:00
|
|
|
void fsm_msgNEMGetAddress(NEMGetAddress *msg);
|
2017-05-30 16:41:02 +00:00
|
|
|
void fsm_msgNEMSignTx(NEMSignTx *msg);
|
2017-12-16 19:15:54 +00:00
|
|
|
void fsm_msgNEMDecryptMessage(NEMDecryptMessage *msg);
|
2017-05-29 16:07:55 +00:00
|
|
|
|
2017-10-03 11:11:53 +00:00
|
|
|
void fsm_msgCosiCommit(CosiCommit *msg);
|
|
|
|
void fsm_msgCosiSign(CosiSign *msg);
|
|
|
|
|
2014-04-29 12:26:51 +00:00
|
|
|
// debug message functions
|
|
|
|
#if DEBUG_LINK
|
|
|
|
//void fsm_msgDebugLinkDecision(DebugLinkDecision *msg);
|
|
|
|
void fsm_msgDebugLinkGetState(DebugLinkGetState *msg);
|
|
|
|
void fsm_msgDebugLinkStop(DebugLinkStop *msg);
|
2016-05-26 18:28:11 +00:00
|
|
|
void fsm_msgDebugLinkMemoryWrite(DebugLinkMemoryWrite *msg);
|
|
|
|
void fsm_msgDebugLinkMemoryRead(DebugLinkMemoryRead *msg);
|
|
|
|
void fsm_msgDebugLinkFlashErase(DebugLinkFlashErase *msg);
|
2014-04-29 12:26:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|