Merge pull request #561 from LedgerHQ/cev/remove_wallet_id

Remove old WALLET_ID support
This commit is contained in:
Charles-Edouard de la Vergne
2024-03-28 16:26:58 +01:00
committed by GitHub
3 changed files with 1 additions and 45 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}