test key + disable bls sigs

This commit is contained in:
TamtamHero
2021-05-07 15:48:27 +02:00
committed by pscott
parent e2fa7ccaf9
commit ec1a0d1128
3 changed files with 12 additions and 3 deletions

View File

@@ -62,6 +62,15 @@ static const uint8_t const LEDGER_SIGNATURE_PUBLIC_KEY[] = {
};
#endif
static const uint8_t const LEDGER_PLUGINS_SIGNATURE_PUBLIC_KEY[] = {
// test key 2019-01-11 03:07PM (erc20signer)
0x04,
0x20, 0xda, 0x62, 0x00, 0x3c, 0x0c, 0xe0, 0x97, 0xe3, 0x36, 0x44, 0xa1, 0x0f, 0xe4, 0xc3, 0x04,
0x54, 0x06, 0x9a, 0x44, 0x54, 0xf0, 0xfa, 0x9d, 0x4e, 0x84, 0xf4, 0x50, 0x91, 0x42, 0x9b, 0x52,
0x20, 0xaf, 0x9e, 0x35, 0xc0, 0xb2, 0xd9, 0x28, 0x93, 0x80, 0x13, 0x73, 0x07, 0xde, 0x4d, 0xd1,
0xd4, 0x18, 0x42, 0x8c, 0xf2, 0x1a, 0x93, 0xb3, 0x35, 0x61, 0xbb, 0x09, 0xd8, 0x8f, 0xe5, 0x79,
};
#else
#define NUM_TOKENS_AKROMA 0

View File

@@ -19,7 +19,7 @@ void getEth2PublicKey(uint32_t *bip32Path, uint8_t bip32PathLength, uint8_t *out
uint8_t tmp[96];
io_seproxyhal_io_heartbeat();
os_perso_derive_eip2333(CX_CURVE_BLS12_381_G1, bip32Path, bip32PathLength, privateKeyData);
// os_perso_derive_eip2333(CX_CURVE_BLS12_381_G1, bip32Path, bip32PathLength, privateKeyData);
io_seproxyhal_io_heartbeat();
memset(tmp, 0, 48);
memmove(tmp + 16, privateKeyData, 32);

View File

@@ -31,8 +31,8 @@ void handleSetExternalPlugin(uint8_t p1,
// check Ledger's signature over the payload
cx_hash_sha256(workBuffer, payload_size, hash, sizeof(hash));
cx_ecfp_init_public_key(CX_CURVE_256K1,
LEDGER_SIGNATURE_PUBLIC_KEY,
sizeof(LEDGER_SIGNATURE_PUBLIC_KEY),
LEDGER_PLUGINS_SIGNATURE_PUBLIC_KEY,
sizeof(LEDGER_PLUGINS_SIGNATURE_PUBLIC_KEY),
&tokenKey);
if(!cx_ecdsa_verify(&tokenKey, CX_LAST, CX_SHA256, hash, sizeof(hash), workBuffer+payload_size, dataLength-payload_size)){
PRINTF("Invalid external plugin signature %.*H\n", payload_size, workBuffer);