Remove Ledger Blue specific code, and other unused discriminants

This commit is contained in:
TamtamHero
2020-10-20 15:22:22 +02:00
parent 94a521de78
commit 62a144b22b
19 changed files with 6 additions and 871 deletions

View File

@@ -1,11 +1,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
void handleGetAppConfiguration(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {
UNUSED(p1);

View File

@@ -1,11 +1,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
#include "feature_getPublicKey.h"
void handleGetPublicKey(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {
@@ -53,23 +49,8 @@ void handleGetPublicKey(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t da
#ifndef NO_CONSENT
else
{
/*
addressSummary[0] = '0';
addressSummary[1] = 'x';
os_memmove((unsigned char *)(addressSummary + 2), tmpCtx.publicKeyContext.address, 4);
os_memmove((unsigned char *)(addressSummary + 6), "...", 3);
os_memmove((unsigned char *)(addressSummary + 9), tmpCtx.publicKeyContext.address + 40 - 4, 4);
addressSummary[13] = '\0';
*/
// prepare for a UI based reply
#if defined(TARGET_BLUE)
snprintf(strings.common.fullAddress, sizeof(strings.common.fullAddress), "0x%.*s", 40, tmpCtx.publicKeyContext.address);
UX_DISPLAY(ui_address_blue, ui_address_blue_prepro);
#else
snprintf(strings.common.fullAddress, sizeof(strings.common.fullAddress), "0x%.*s", 40, tmpCtx.publicKeyContext.address);
ux_flow_init(0, ux_display_public_flow, NULL);
#endif // #if TARGET_ID
*flags |= IO_ASYNCH_REPLY;
}

View File

@@ -1,8 +1,6 @@
#include "shared_context.h"
#include "ui_callbacks.h"
#ifdef HAVE_UX_FLOW
UX_FLOW_DEF_NOCB(
ux_display_public_flow_1_step,
pnn,
@@ -42,6 +40,3 @@ const ux_flow_step_t * const ux_display_public_flow [] = {
&ux_display_public_flow_4_step,
FLOW_END_STEP,
};
#endif

View File

@@ -1,11 +1,6 @@
#include "shared_context.h"
#include "apdu_constants.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
static const uint8_t const TOKEN_SIGNATURE_PUBLIC_KEY[] = {
// production key 2019-01-11 03:07PM (erc20signer)

View File

@@ -1,12 +1,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#include "utils.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
static const char const SIGN_MAGIC[] = "\x19"
"Ethereum Signed Message:\n";
@@ -89,11 +84,7 @@ void handleSignPersonalMessage(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint
#ifdef NO_CONSENT
io_seproxyhal_touch_signMessage_ok(NULL);
#else //NO_CONSENT
#if defined(TARGET_BLUE)
ui_approval_message_sign_blue_init();
#else
ux_flow_init(0, ux_sign_flow, NULL);
#endif // #if TARGET_ID
#endif // NO_CONSENT
*flags |= IO_ASYNCH_REPLY;

View File

@@ -1,12 +1,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#include "utils.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
static const char const SIGN_MAGIC[] = "\x19"
"Ethereum Signed Message:\n";
@@ -52,12 +47,7 @@ void handleSignEIP712Message(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16
#ifdef NO_CONSENT
io_seproxyhal_touch_signMessage_ok(NULL);
#else //NO_CONSENT
#if defined(TARGET_BLUE)
// 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;

View File

@@ -1,11 +1,6 @@
#include "shared_context.h"
#include "apdu_constants.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
#include "feature_signTx.h"
void handleSign(uint8_t p1, uint8_t p2, uint8_t *workBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {

View File

@@ -1,12 +1,7 @@
#include "shared_context.h"
#include "utils.h"
#include "ui_callbacks.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
#ifdef HAVE_STARKWARE
#include "stark_utils.h"
#endif
@@ -231,11 +226,7 @@ customStatus_e customProcessor(txContext_t *context) {
dataContext.rawDataContext.fieldOffset = 0;
if (fieldPos == 0) {
array_hexstr(strings.tmp.tmp, dataContext.rawDataContext.data, 4);
#if defined(TARGET_BLUE)
UX_DISPLAY(ui_data_selector_blue, ui_data_selector_blue_prepro);
#else
ux_flow_init(0, ux_confirm_selector_flow, NULL);
#endif // #if TARGET_ID
}
else {
uint32_t offset = 0;
@@ -247,11 +238,7 @@ customStatus_e customProcessor(txContext_t *context) {
strings.tmp.tmp[offset++] = ':';
}
}
#if defined(TARGET_BLUE)
UX_DISPLAY(ui_data_parameter_blue, ui_data_parameter_blue_prepro);
#else
ux_flow_init(0, ux_confirm_parameter_flow, NULL);
#endif // #if TARGET_ID
}
}
else {
@@ -377,9 +364,6 @@ void finalizeParsing(bool direct) {
}
else
{
#ifdef TARGET_BLUE
os_memmove((void*)addressSummary, CONTRACT_ADDRESS, sizeof(CONTRACT_ADDRESS));
#endif
strcpy(strings.common.fullAddress, "Contract");
}
if ((contractProvisioned == CONTRACT_NONE) || (contractProvisioned == CONTRACT_ERC20) ||
@@ -438,9 +422,6 @@ void finalizeParsing(bool direct) {
io_seproxyhal_touch_tx_ok(NULL);
}
else{
#if defined(TARGET_BLUE)
ui_approval_transaction_blue_init();
#else
#ifdef HAVE_STARKWARE
@@ -492,7 +473,6 @@ void finalizeParsing(bool direct) {
ux_flow_init(0,
((dataPresent && !N_storage.contractDetails) ? ux_approval_tx_data_warning_flow : ux_approval_tx_flow),
NULL);
#endif // #if TARGET_ID
}
}

View File

@@ -1,8 +1,6 @@
#include "shared_context.h"
#include "ui_callbacks.h"
#ifdef HAVE_UX_FLOW
UX_FLOW_DEF_NOCB(
ux_confirm_selector_flow_1_step,
pnn,
@@ -160,6 +158,4 @@ const ux_flow_step_t * const ux_approval_tx_data_warning_flow [] = {
&ux_approval_tx_5_step,
&ux_approval_tx_6_step,
FLOW_END_STEP,
};
#endif
};

View File

@@ -4,12 +4,7 @@
#include "apdu_constants.h"
#include "stark_utils.h"
#include "feature_stark_getPublicKey.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
void handleStarkwareGetPublicKey(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {
UNUSED(dataLength);

View File

@@ -2,12 +2,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
void handleStarkwareProvideQuantum(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t dataLength, unsigned int *flags, unsigned int *tx) {
size_t i = 0;

View File

@@ -3,12 +3,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#include "stark_utils.h"
#ifdef TARGET_BLUE
#include "ui_blue.h"
#endif
#ifdef HAVE_UX_FLOW
#include "ui_flow.h"
#endif
#include "poorstream.h"
#include "ui_callbacks.h"