From 684e19b06f6dc02dbeae131953a069b5da9a1f84 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Tue, 29 Aug 2023 16:33:46 +0200 Subject: [PATCH] New SET_PLUGIN test key --- Makefile | 6 ++++++ client/src/ledger_app_clients/ethereum/keychain.py | 1 + .../ledger_app_clients/ethereum/keychain/set_plugin.pem | 8 ++++++++ src_features/setPlugin/cmd_setPlugin.c | 8 +++++++- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 client/src/ledger_app_clients/ethereum/keychain/set_plugin.pem diff --git a/Makefile b/Makefile index efc8f6b..c33ca42 100644 --- a/Makefile +++ b/Makefile @@ -147,6 +147,12 @@ ifneq ($(BYPASS_SIGNATURES),0) DEFINES += HAVE_BYPASS_SIGNATURES endif +# Enable the SET_PLUGIN test key +SET_PLUGIN_TEST_KEY:=0 +ifneq ($(SET_PLUGIN_TEST_KEY),0) +DEFINES += HAVE_SET_PLUGIN_TEST_KEY +endif + # NFTs ifneq ($(TARGET_NAME),TARGET_NANOS) DEFINES += HAVE_NFT_SUPPORT diff --git a/client/src/ledger_app_clients/ethereum/keychain.py b/client/src/ledger_app_clients/ethereum/keychain.py index 4e66b6a..b6021af 100644 --- a/client/src/ledger_app_clients/ethereum/keychain.py +++ b/client/src/ledger_app_clients/ethereum/keychain.py @@ -11,6 +11,7 @@ from typing import Dict class Key(Enum): CAL = auto() DOMAIN_NAME = auto() + SET_PLUGIN = auto() _keys: Dict[Key, SigningKey] = dict() diff --git a/client/src/ledger_app_clients/ethereum/keychain/set_plugin.pem b/client/src/ledger_app_clients/ethereum/keychain/set_plugin.pem new file mode 100644 index 0000000..6e84a21 --- /dev/null +++ b/client/src/ledger_app_clients/ethereum/keychain/set_plugin.pem @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BgUrgQQACg== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHQCAQEEIBErwcYvqeKSOlmQ/j3xPkVcwFf+j1aiMsA+RabczvN7oAcGBSuBBAAK +oUQDQgAEwFW8Ts8FXi2FCF01Eno95nBcf4hQVc1wceh2cb8ZH+M8yPAavC8ofIGa +FIq+G1gd8bSUCvXU3DpOa2AZF3ErNw== +-----END EC PRIVATE KEY----- diff --git a/src_features/setPlugin/cmd_setPlugin.c b/src_features/setPlugin/cmd_setPlugin.c index 76c5a0b..6d3757a 100644 --- a/src_features/setPlugin/cmd_setPlugin.c +++ b/src_features/setPlugin/cmd_setPlugin.c @@ -46,7 +46,13 @@ typedef enum AlgorithmID { // Only used for signing NFT plugins (ERC721 and ERC1155) static const uint8_t LEDGER_NFT_SELECTOR_PUBLIC_KEY[] = { -#ifdef HAVE_NFT_STAGING_KEY +#if defined(HAVE_SET_PLUGIN_TEST_KEY) + 0x04, 0xc0, 0x55, 0xbc, 0x4e, 0xcf, 0x05, 0x5e, 0x2d, 0x85, 0x08, 0x5d, 0x35, 0x12, + 0x7a, 0x3d, 0xe6, 0x70, 0x5c, 0x7f, 0x88, 0x50, 0x55, 0xcd, 0x70, 0x71, 0xe8, 0x76, + 0x71, 0xbf, 0x19, 0x1f, 0xe3, 0x3c, 0xc8, 0xf0, 0x1a, 0xbc, 0x2f, 0x28, 0x7c, 0x81, + 0x9a, 0x14, 0x8a, 0xbe, 0x1b, 0x58, 0x1d, 0xf1, 0xb4, 0x94, 0x0a, 0xf5, 0xd4, 0xdc, + 0x3a, 0x4e, 0x6b, 0x60, 0x19, 0x17, 0x71, 0x2b, 0x37 +#elif defined(HAVE_NFT_STAGING_KEY) 0x04, 0xf5, 0x70, 0x0c, 0xa1, 0xe8, 0x74, 0x24, 0xc7, 0xc7, 0xd1, 0x19, 0xe7, 0xe3, 0xc1, 0x89, 0xb1, 0x62, 0x50, 0x94, 0xdb, 0x6e, 0xa0, 0x40, 0x87, 0xc8, 0x30, 0x00, 0x7d, 0x0b, 0x46, 0x9a, 0x53, 0x11, 0xee, 0x6a, 0x1a, 0xcd, 0x1d, 0xa5, 0xaa, 0xb0,