From 43306544acd37a4bb0a09ab268cde0cffda459d8 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Thu, 28 Mar 2024 15:21:12 +0100 Subject: [PATCH] Remove old WALLET_ID support --- Makefile | 1 - src/apdu_constants.h | 3 +-- src/main.c | 42 ------------------------------------------ 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Makefile b/Makefile index 39c64e461..a09d220f9 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/apdu_constants.h b/src/apdu_constants.h index 4b628bd89..471a26253 100644 --- a/src/apdu_constants.h +++ b/src/apdu_constants.h @@ -33,8 +33,7 @@ #define P2_EIP712_LEGACY_IMPLEM 0x00 #define P2_EIP712_FULL_IMPLEM 0x01 -#define COMMON_CLA 0xB0 -#define COMMON_INS_GET_WALLET_ID 0x04 +#define COMMON_CLA 0xB0 #define APDU_RESPONSE_OK 0x9000 #define APDU_RESPONSE_ERROR_NO_INFO 0x6a00 diff --git a/src/main.c b/src/main.c index 24d2f63ba..c148a7acc 100644 --- a/src/main.c +++ b/src/main.c @@ -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"); @@ -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); }