Skip to content

Commit

Permalink
Fix the plugin making the Ethereum app generate incorrect signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
apaillier-ledger committed Feb 12, 2024
1 parent 7373e0c commit dded652
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/handle_provide_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ 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:
copy_address(buffer, msg->parameter, sizeof(buffer));
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);
Expand All @@ -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);

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dded652

Please sign in to comment.