Skip to content

Commit

Permalink
zero address node
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Mar 10, 2023
1 parent 2c72c2d commit ad40ecc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions views/flipbip_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,16 @@ typedef struct {
CONFIDENTIAL const char* xpub_extended;
} FlipBipScene1Model;

// Node for the receive address
static CONFIDENTIAL HDNode* s_addr_node = NULL;

// Generic display text
static CONFIDENTIAL char* s_disp_text1 = NULL;
static CONFIDENTIAL char* s_disp_text2 = NULL;
static CONFIDENTIAL char* s_disp_text3 = NULL;
static CONFIDENTIAL char* s_disp_text4 = NULL;
static CONFIDENTIAL char* s_disp_text5 = NULL;
static CONFIDENTIAL char* s_disp_text6 = NULL;

// Derivation path text
static const char* s_derivation_text = TEXT_DEFAULT_DERIV;
//static bool s_busy = false;

Expand Down Expand Up @@ -196,11 +197,11 @@ static void
flipbip_scene_1_draw_address(const HDNode* node, uint32_t addr_type, uint32_t addr_index) {
//s_busy = true;

// buffer for address serialization
// Buffer for address serialization
const size_t buflen = 40;
char buf[40 + 1] = {0};

// use static node for address generation
// Use static node for address generation
memcpy(s_addr_node, node, sizeof(HDNode));

hdnode_private_ckd(s_addr_node, addr_index);
Expand Down Expand Up @@ -233,6 +234,9 @@ static void
flipbip_scene_1_draw_generic(address, 12);
}

// Clear the address node
memzero(s_addr_node, sizeof(HDNode));

//s_busy = false;
}

Expand Down

0 comments on commit ad40ecc

Please sign in to comment.