Skip to content

Commit

Permalink
Added message response for CANCEL request from client during exchange…
Browse files Browse the repository at this point in the history
… verification.

*Added message response for bip44 address error detection in exchange's withdrawal node.
  • Loading branch information
pkhx02 committed Aug 24, 2016
1 parent 38fa0c9 commit 8d5bd29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions keepkey/local/baremetal/exchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,13 @@ bool process_exchange_contract(const CoinType *coin, TxOutputType *tx_out, const
{
if(!confirm_exchange_output("ShapeShift", amount_from_str, amount_to_str, node_str))
{
set_exchange_error(ERROR_EXCHANGE_CANCEL);
goto process_exchange_contract_exit;
}
}
else
{
set_exchange_error(ERROR_EXCHANGE_WITHDRAWAL_ADDRESS);
goto process_exchange_contract_exit;
}
}
Expand Down
5 changes: 5 additions & 0 deletions keepkey/local/baremetal/signing.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ static void send_fsm_co_error_message(int co_error)
{
switch(get_exchange_error())
{
case ERROR_EXCHANGE_CANCEL:
{
fsm_sendFailure(FailureType_Failure_Other, "Exchange cancelled");
break;
}
case ERROR_EXCHANGE_SIGNATURE:
{
fsm_sendFailure(FailureType_Failure_Other, "Exchange signature error");
Expand Down
3 changes: 2 additions & 1 deletion keepkey/public/exchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ typedef enum
ERROR_EXCHANGE_WITHDRAWAL_ADDRESS,
ERROR_EXCHANGE_RETURN_COINTYPE,
ERROR_EXCHANGE_RETURN_ADDRESS,
ERROR_EXCHANGE_API_KEY
ERROR_EXCHANGE_API_KEY,
ERROR_EXCHANGE_CANCEL
}ExchangeError;

/* === Functions =========================================================== */
Expand Down

0 comments on commit 8d5bd29

Please sign in to comment.