Removed chain ID restrictions from SET_PLUGIN and PROVIDE_NFT_INFORMATION apdus

This commit is contained in:
Alexandre Paillier
2023-08-04 15:00:48 +02:00
parent 11974b45a6
commit 7efb861804
2 changed files with 10 additions and 10 deletions

View File

@@ -169,13 +169,13 @@ void handleSetPlugin(uint8_t p1,
PRINTF("Selector: %.*H\n", SELECTOR_SIZE, tokenContext->methodSelector);
offset += SELECTOR_SIZE;
uint64_t chainId = u64_from_BE(workBuffer + offset, CHAIN_ID_SIZE);
uint64_t chain_id = u64_from_BE(workBuffer + offset, CHAIN_ID_SIZE);
// this prints raw data, so to have a more meaningful print, display
// the buffer before the endianness swap
PRINTF("ChainID: %.*H\n", sizeof(chainId), (workBuffer + offset));
if ((chainConfig->chainId != 0) && (chainConfig->chainId != chainId)) {
PRINTF("Chain ID token mismatch\n");
THROW(0x6A80);
PRINTF("ChainID: %.*H\n", sizeof(chain_id), (workBuffer + offset));
if (!chain_is_ethereum_compatible(&chain_id)) {
PRINTF("Unsupported chain ID!\n");
THROW(APDU_RESPONSE_INVALID_DATA);
}
offset += CHAIN_ID_SIZE;