Skip to content

Commit

Permalink
Remove old WALLET_ID support
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Mar 28, 2024
1 parent a84d4f5 commit e439436
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ else
DEFINES += HAVE_BAGL
DEFINES += HAVE_UX_FLOW
ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += HAVE_WALLET_ID_SDK
DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=32
else
DEFINES += HAVE_GLO096
Expand Down
1 change: 0 additions & 1 deletion src/apdu_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#define P2_EIP712_FULL_IMPLEM 0x01

#define COMMON_CLA 0xB0
#define COMMON_INS_GET_WALLET_ID 0x04

#define APDU_RESPONSE_OK 0x9000
#define APDU_RESPONSE_ERROR_NO_INFO 0x6a00
Expand Down
42 changes: 0 additions & 42 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,38 +130,6 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
return NULL;
}

#ifndef HAVE_WALLET_ID_SDK

unsigned int const U_os_perso_seed_cookie[] = {
0xda7aba5e,
0xc1a551c5,
};

void handleGetWalletId(volatile unsigned int *tx) {
unsigned char t[64];
cx_ecfp_256_private_key_t priv;
cx_ecfp_256_public_key_t pub;
// seed => pubkey
CX_ASSERT(bip32_derive_with_seed_init_privkey_256(HDW_NORMAL,
CX_CURVE_256K1,
U_os_perso_seed_cookie,
2,
&priv,
NULL,
NULL,
0));
// priv key => pubkey
CX_ASSERT(cx_ecfp_generate_pair_no_throw(CX_CURVE_256K1, &pub, &priv, 1));
// pubkey -> sha512
cx_hash_sha512(pub.W, sizeof(pub.W), t, sizeof(t));
// ! cookie !
memmove(G_io_apdu_buffer, t, 64);
*tx = 64;
THROW(0x9000);
}

#endif // HAVE_WALLET_ID_SDK

const uint8_t *parseBip32(const uint8_t *dataBuffer, uint8_t *dataLength, bip32_path_t *bip32) {
if (*dataLength < 1) {
PRINTF("Invalid data\n");
Expand Down Expand Up @@ -197,16 +165,6 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {

BEGIN_TRY {
TRY {
#ifndef HAVE_WALLET_ID_SDK

if ((G_io_apdu_buffer[OFFSET_CLA] == COMMON_CLA) &&
(G_io_apdu_buffer[OFFSET_INS] == COMMON_INS_GET_WALLET_ID)) {
handleGetWalletId(tx);
return;
}

#endif // HAVE_WALLET_ID_SDK

if (G_io_apdu_buffer[OFFSET_CLA] != CLA) {
THROW(0x6E00);
}
Expand Down

0 comments on commit e439436

Please sign in to comment.