Remove trailing whitespaces
This commit is contained in:
@@ -19,7 +19,7 @@ void handleGetAppConfiguration(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint
|
||||
#endif
|
||||
#ifdef HAVE_STARKWARE
|
||||
G_io_apdu_buffer[0] |= APP_FLAG_STARKWARE;
|
||||
#endif
|
||||
#endif
|
||||
G_io_apdu_buffer[1] = LEDGER_MAJOR_VERSION;
|
||||
G_io_apdu_buffer[2] = LEDGER_MINOR_VERSION;
|
||||
G_io_apdu_buffer[3] = LEDGER_PATCH_VERSION;
|
||||
|
||||
@@ -39,7 +39,7 @@ void handleProvideErc20TokenInformation(uint8_t p1, uint8_t p2, uint8_t *workBuf
|
||||
|
||||
tmpCtx.transactionContext.currentTokenIndex = (tmpCtx.transactionContext.currentTokenIndex + 1) % MAX_TOKEN;
|
||||
tokenDefinition_t* token = &tmpCtx.transactionContext.tokens[tmpCtx.transactionContext.currentTokenIndex];
|
||||
|
||||
|
||||
if (dataLength < 1) {
|
||||
THROW(0x6A80);
|
||||
}
|
||||
@@ -139,12 +139,12 @@ void handleProvideErc20TokenInformation(uint8_t p1, uint8_t p2, uint8_t *workBuf
|
||||
}
|
||||
offset += 4;
|
||||
dataLength -= 4;
|
||||
|
||||
#ifdef HAVE_TOKENS_EXTRA_LIST
|
||||
|
||||
#ifdef HAVE_TOKENS_EXTRA_LIST
|
||||
tokenDefinition_t *currentToken = NULL;
|
||||
uint32_t index;
|
||||
for (index=0; index < NUM_TOKENS_EXTRA; index++) {
|
||||
currentToken = (tokenDefinition_t *)PIC(&TOKENS_EXTRA[index]);
|
||||
currentToken = (tokenDefinition_t *)PIC(&TOKENS_EXTRA[index]);
|
||||
if (os_memcmp(currentToken->address, token->address, 20) == 0) {
|
||||
strcpy((char*)token->ticker, (char*)currentToken->ticker);
|
||||
token->decimals = currentToken->decimals;
|
||||
|
||||
@@ -27,7 +27,7 @@ void handleSignPersonalMessage(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint
|
||||
if (appState != APP_STATE_IDLE) {
|
||||
reset_app_context();
|
||||
}
|
||||
appState = APP_STATE_SIGNING_MESSAGE;
|
||||
appState = APP_STATE_SIGNING_MESSAGE;
|
||||
tmpCtx.messageSigningContext.pathLength = workBuffer[0];
|
||||
if ((tmpCtx.messageSigningContext.pathLength < 0x01) ||
|
||||
(tmpCtx.messageSigningContext.pathLength > MAX_BIP32_PATH)) {
|
||||
@@ -48,7 +48,7 @@ void handleSignPersonalMessage(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint
|
||||
if (dataLength < 4) {
|
||||
PRINTF("Invalid data\n");
|
||||
THROW(0x6a80);
|
||||
}
|
||||
}
|
||||
tmpCtx.messageSigningContext.remainingLength = U4BE(workBuffer, 0);
|
||||
workBuffer += 4;
|
||||
dataLength -= 4;
|
||||
|
||||
@@ -13,7 +13,7 @@ static const char const SIGN_MAGIC[] = "\x19"
|
||||
|
||||
void handleSignEIP712Message(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {
|
||||
uint8_t i;
|
||||
|
||||
|
||||
UNUSED(tx);
|
||||
if ((p1 != 00) || (p2 != 00)) {
|
||||
THROW(0x6B00);
|
||||
@@ -45,7 +45,7 @@ void handleSignEIP712Message(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16
|
||||
if (dataLength < 32 + 32) {
|
||||
PRINTF("Invalid data\n");
|
||||
THROW(0x6a80);
|
||||
}
|
||||
}
|
||||
memmove(tmpCtx.messageSigningContext712.domainHash, workBuffer, 32);
|
||||
memmove(tmpCtx.messageSigningContext712.messageHash, workBuffer + 32, 32);
|
||||
|
||||
@@ -53,12 +53,12 @@ void handleSignEIP712Message(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16
|
||||
io_seproxyhal_touch_signMessage_ok(NULL);
|
||||
#else //NO_CONSENT
|
||||
#if defined(TARGET_BLUE)
|
||||
// TODO implement
|
||||
// TODO implement
|
||||
ui_approval_message_sign_blue_init();
|
||||
#else
|
||||
ux_flow_init(0, ux_sign_712_v0_flow, NULL);
|
||||
#endif // #if TARGET_ID
|
||||
#endif // NO_CONSENT
|
||||
|
||||
*flags |= IO_ASYNCH_REPLY;
|
||||
*flags |= IO_ASYNCH_REPLY;
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ unsigned int io_seproxyhal_touch_signMessage712_v0_ok(const bagl_element_t *e) {
|
||||
io_seproxyhal_io_heartbeat();
|
||||
cx_keccak_init(&global_sha3, 256);
|
||||
cx_hash((cx_hash_t *)&global_sha3, 0, (uint8_t*)EIP_712_MAGIC, sizeof(EIP_712_MAGIC), NULL, 0);
|
||||
cx_hash((cx_hash_t *)&global_sha3, 0, tmpCtx.messageSigningContext712.domainHash,
|
||||
cx_hash((cx_hash_t *)&global_sha3, 0, tmpCtx.messageSigningContext712.domainHash,
|
||||
sizeof(tmpCtx.messageSigningContext712.domainHash), NULL, 0);
|
||||
cx_hash((cx_hash_t *)&global_sha3, CX_LAST, tmpCtx.messageSigningContext712.messageHash,
|
||||
cx_hash((cx_hash_t *)&global_sha3, CX_LAST, tmpCtx.messageSigningContext712.messageHash,
|
||||
sizeof(tmpCtx.messageSigningContext712.messageHash), hash, sizeof(hash));
|
||||
PRINTF("EIP712 hash to sign %.*H\n", 32, hash);
|
||||
io_seproxyhal_io_heartbeat();
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void prepare_domain_hash_v0() {
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, tmpCtx.messageSigningContext712.domainHash);
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, tmpCtx.messageSigningContext712.domainHash);
|
||||
}
|
||||
|
||||
void prepare_message_hash_v0() {
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, tmpCtx.messageSigningContext712.messageHash);
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, tmpCtx.messageSigningContext712.messageHash);
|
||||
}
|
||||
|
||||
UX_FLOW_DEF_NOCB(
|
||||
|
||||
@@ -16,11 +16,11 @@ void handleSign(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength
|
||||
if (dataLength < 1) {
|
||||
PRINTF("Invalid data\n");
|
||||
THROW(0x6a80);
|
||||
}
|
||||
}
|
||||
if (appState != APP_STATE_IDLE) {
|
||||
reset_app_context();
|
||||
}
|
||||
appState = APP_STATE_SIGNING_TX;
|
||||
appState = APP_STATE_SIGNING_TX;
|
||||
tmpCtx.transactionContext.pathLength = workBuffer[0];
|
||||
if ((tmpCtx.transactionContext.pathLength < 0x01) ||
|
||||
(tmpCtx.transactionContext.pathLength > MAX_BIP32_PATH)) {
|
||||
@@ -33,7 +33,7 @@ void handleSign(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength
|
||||
if (dataLength < 4) {
|
||||
PRINTF("Invalid data\n");
|
||||
THROW(0x6a80);
|
||||
}
|
||||
}
|
||||
tmpCtx.transactionContext.bip32Path[i] = U4BE(workBuffer, 0);
|
||||
workBuffer += 4;
|
||||
dataLength -= 4;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void prepare_escape_3() {
|
||||
void prepare_escape_3() {
|
||||
uint8_t address[41];
|
||||
getEthAddressStringFromBinary(tmpContent.txContent.destination, address, &global_sha3, chainConfig);
|
||||
strings.common.fullAddress[0] = '0';
|
||||
@@ -23,7 +23,7 @@ void prepare_escape_4() {
|
||||
else {
|
||||
tokenDefinition_t *token = &tmpCtx.transactionContext.tokens[dataContext.tokenContext.quantumIndex];
|
||||
decimals = token->decimals;
|
||||
ticker = (char*)token->ticker;
|
||||
ticker = (char*)token->ticker;
|
||||
}
|
||||
readu256BE(dataContext.tokenContext.data + 4 + 32 + 32 + 32, &amountPre);
|
||||
readu256BE(dataContext.tokenContext.quantum, &quantum);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void prepare_register_3() {
|
||||
void prepare_register_3() {
|
||||
uint8_t address[41];
|
||||
getEthAddressStringFromBinary(tmpContent.txContent.destination, address, &global_sha3, chainConfig);
|
||||
strings.common.fullAddress[0] = '0';
|
||||
@@ -12,7 +12,7 @@ void prepare_register_3() {
|
||||
strings.common.fullAddress[42] = '\0';
|
||||
}
|
||||
|
||||
void prepare_register_4() {
|
||||
void prepare_register_4() {
|
||||
uint8_t privateKeyData[32];
|
||||
uint8_t address[41];
|
||||
cx_ecfp_private_key_t privateKey;
|
||||
@@ -33,8 +33,8 @@ void prepare_register_4() {
|
||||
strings.common.fullAddress[42] = '\0';
|
||||
}
|
||||
|
||||
void prepare_register_5() {
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, dataContext.tokenContext.data + 4);
|
||||
void prepare_register_5() {
|
||||
snprintf(strings.tmp.tmp, 70, "0x%.*H", 32, dataContext.tokenContext.data + 4);
|
||||
}
|
||||
|
||||
UX_FLOW_DEF_NOCB(ux_approval_starkware_register_1_step,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
void prepare_verify_escape_3() {
|
||||
void prepare_verify_escape_3() {
|
||||
uint8_t address[41];
|
||||
getEthAddressStringFromBinary(tmpContent.txContent.destination, address, &global_sha3, chainConfig);
|
||||
strings.common.fullAddress[0] = '0';
|
||||
|
||||
@@ -14,11 +14,11 @@ void prepare_verify_vault_id_2() {
|
||||
else
|
||||
if (contractProvisioned == CONTRACT_STARKWARE_FULL_WITHDRAWAL) {
|
||||
strcpy(strings.common.fullAddress, "Full Withdrawal");
|
||||
}
|
||||
}
|
||||
else
|
||||
if (contractProvisioned == CONTRACT_STARKWARE_FREEZE) {
|
||||
strcpy(strings.common.fullAddress, "Freeze");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void prepare_verify_vault_id_3() {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
void prepare_register_4();
|
||||
|
||||
void prepare_withdraw_3() {
|
||||
void prepare_withdraw_3() {
|
||||
uint8_t address[41];
|
||||
getEthAddressStringFromBinary(tmpContent.txContent.destination, address, &global_sha3, chainConfig);
|
||||
strings.common.fullAddress[0] = '0';
|
||||
@@ -14,8 +14,8 @@ void prepare_withdraw_3() {
|
||||
strings.common.fullAddress[42] = '\0';
|
||||
}
|
||||
|
||||
void prepare_withdraw_5() {
|
||||
char *ticker = (char*)PIC(chainConfig->coinName);
|
||||
void prepare_withdraw_5() {
|
||||
char *ticker = (char*)PIC(chainConfig->coinName);
|
||||
|
||||
if (dataContext.tokenContext.quantumIndex != MAX_TOKEN) {
|
||||
tokenDefinition_t *token = &tmpCtx.transactionContext.tokens[dataContext.tokenContext.quantumIndex];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
|
||||
#include "shared_context.h"
|
||||
#include "apdu_constants.h"
|
||||
#ifdef TARGET_BLUE
|
||||
|
||||
Reference in New Issue
Block a user