From dded652d9f359911f6d9ac8108ac38dc3afc2bbc Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Fri, 9 Feb 2024 18:16:57 +0100 Subject: [PATCH] Fix the plugin making the Ethereum app generate incorrect signatures --- src/handle_provide_parameter.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 88979dd..5a10c28 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -65,6 +65,7 @@ int find_lr_known_strategy(const char address[ADDRESS_STR_LEN]) { void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) { uint8_t buffer[ADDRESS_LENGTH]; char address_buffer[ADDRESS_STR_LEN]; + cx_sha3_t sha3; switch (context->next_param) { case LR_DEPOSIT_INTO_STRATEGY_STRATEGY: @@ -72,7 +73,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), - msg->pluginSharedRW->sha3, + &sha3, 0); context->param_data.lr_deposit.strategy_to_display = find_lr_known_strategy(address_buffer); @@ -84,7 +85,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), - msg->pluginSharedRW->sha3, + &sha3, 0); context->param_data.lr_deposit.erc20_to_display = find_lr_known_erc20(address_buffer); @@ -105,6 +106,8 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t } void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + cx_sha3_t sha3; + // queueWithdrawal(uint256[],address[],uint256[],address,bool // example for queue withdrawal with 2 strategies indexes, contracts and shares // [0] selector @@ -169,7 +172,7 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con getEthDisplayableAddress(buffer, context->param_data.lr_queue_withdrawal.withdrawer, sizeof(context->param_data.lr_queue_withdrawal.withdrawer), - msg->pluginSharedRW->sha3, + &sha3, 0); context->next_param = LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE; break;