Skip to content

Commit e6f31c3

Browse files
Merge pull request #911 from LedgerHQ/feat/apa/multisig_address_book
Added a new trusted name source (multisig address book)
2 parents e6c8d85 + ec3b253 commit e6f31c3

File tree

30 files changed

+31
-16
lines changed

30 files changed

+31
-16
lines changed

client/src/ledger_app_clients/ethereum/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class TrustedNameType(IntEnum):
2626
CONTRACT = 0x02
2727
NFT = 0x03
2828
TOKEN = 0x04
29+
WALLET = 0x05
30+
CONTEXT_ADDRESS = 0x06
2931

3032

3133
class TrustedNameSource(IntEnum):
@@ -35,6 +37,8 @@ class TrustedNameSource(IntEnum):
3537
UD = 0x03
3638
FN = 0x04
3739
DNS = 0x05
40+
DYN_RESOLVER = 0x06
41+
MULTISIG_ADDRESS_BOOK = 0x07
3842

3943

4044
class EIP712CalldataParamPresence(IntEnum):

src/apdu_constants.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#define INS_EIP712_STRUCT_DEF 0x1A
2626
#define INS_EIP712_STRUCT_IMPL 0x1C
2727
#define INS_EIP712_FILTERING 0x1E
28-
#define INS_ENS_GET_CHALLENGE 0x20
29-
#define INS_ENS_PROVIDE_INFO 0x22
28+
#define INS_GET_CHALLENGE 0x20
29+
#define INS_PROVIDE_TRUSTED_NAME 0x22
3030
#define INS_PROVIDE_ENUM_VALUE 0x24
3131
#define INS_GTP_TRANSACTION_INFO 0x26
3232
#define INS_GTP_FIELD 0x28
@@ -52,8 +52,8 @@
5252
: x == INS_EIP712_STRUCT_DEF ? "EIP712_STRUCT_DEF" \
5353
: x == INS_EIP712_STRUCT_IMPL ? "EIP712_STRUCT_IMPL" \
5454
: x == INS_EIP712_FILTERING ? "EIP712_FILTERING" \
55-
: x == INS_ENS_GET_CHALLENGE ? "ENS_GET_CHALLENGE" \
56-
: x == INS_ENS_PROVIDE_INFO ? "ENS_PROVIDE_INFO" \
55+
: x == INS_GET_CHALLENGE ? "GET_CHALLENGE" \
56+
: x == INS_PROVIDE_TRUSTED_NAME ? "PROVIDE_TRUSTED_NAME" \
5757
: x == INS_PROVIDE_ENUM_VALUE ? "PROVIDE_ENUM_VALUE" \
5858
: x == INS_GTP_TRANSACTION_INFO ? "GTP_TRANSACTION_INFO" \
5959
: x == INS_GTP_FIELD ? "GTP_FIELD" \

src/features/provide_trusted_name/trusted_name.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ static bool handle_trusted_name_source(const s_tlv_data *data, s_trusted_name_ct
439439
switch (context->trusted_name.name_source) {
440440
case TN_SOURCE_CAL:
441441
case TN_SOURCE_ENS:
442+
case TN_SOURCE_MAB:
442443
break;
443444
case TN_SOURCE_LAB:
444445
case TN_SOURCE_UD:

src/features/provide_trusted_name/trusted_name.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ typedef enum {
2929
TN_SOURCE_FN,
3030
TN_SOURCE_DNS,
3131
TN_SOURCE_DYNAMIC_RESOLVER,
32+
TN_SOURCE_MAB,
3233
TN_SOURCE_COUNT,
3334
} e_name_source;
3435

src/features/signMessageEIP712/filtering.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,7 @@ bool filtering_trusted_name(const uint8_t *payload,
926926
case TN_SOURCE_FN:
927927
case TN_SOURCE_DNS:
928928
case TN_SOURCE_DYNAMIC_RESOLVER:
929+
case TN_SOURCE_MAB:
929930
break;
930931
default:
931932
return false;

src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) {
229229
sw = handle_eip712_filtering(cmd->p1, cmd->p2, cmd->data, cmd->lc, flags);
230230
break;
231231

232-
case INS_ENS_GET_CHALLENGE:
232+
case INS_GET_CHALLENGE:
233233
sw = handle_get_challenge(tx);
234234
break;
235235

236-
case INS_ENS_PROVIDE_INFO:
236+
case INS_PROVIDE_TRUSTED_NAME:
237237
sw = handle_trusted_name(cmd->p1, cmd->data, cmd->lc);
238238
break;
239239

-18 Bytes
Loading
-705 Bytes
Loading
-467 Bytes
Loading
303 Bytes
Loading

0 commit comments

Comments
 (0)