Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[update] New icons #11

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ all: default
APPNAME = "Recovery Check"
APPVERSION_M = 1
APPVERSION_N = 2
APPVERSION_P = 0
APPVERSION_P = 1
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

APP_LOAD_PARAMS = --appFlags 0x10 $(COMMON_LOAD_PARAMS) --curve secp256k1 --path ""
Expand Down
Binary file removed glyphs/stax_recovery_64px.gif
Binary file not shown.
Binary file modified glyphs/stax_recovery_check_64px.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icons/stax_recovery_check_32px.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/nano/nanos_enter_phrase.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,18 @@ void compare_recovery_phrase(void) {
cx_hmac_sha512_t ctx;
const char key[] = "Bitcoin seed";

cx_hmac_sha512_init(&ctx, (const uint8_t*) key, strlen(key));
cx_hmac((cx_hmac_t*) &ctx, CX_LAST, buffer, 64, buffer, 64);
cx_hmac_sha512_init_no_throw(&ctx, (const uint8_t*) key, strlen(key));
cx_hmac_no_throw((cx_hmac_t*) &ctx, CX_LAST, buffer, 64, buffer, 64);
PRINTF("Root key from input:\n%.*H\n", 64, buffer);

// get rootkey from device's seed
uint8_t buffer_device[64];

os_perso_derive_node_bip32(CX_CURVE_256K1, NULL, 0, buffer_device, buffer_device + 32);
if (os_derive_bip32_no_throw(CX_CURVE_256K1, NULL, 0, buffer_device, buffer_device + 32) !=
CX_OK) {
PRINTF("An error occurred while comparing the recovery phrase\n");
return;
}
PRINTF("Root key from device: \n%.*H\n", 64, buffer_device);

// compare both rootkey
Expand Down
12 changes: 8 additions & 4 deletions src/nano/nanox_enter_phrase.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ const bagl_element_t* screen_onboarding_4_restore_word_before_element_display_ca
return element;
}

uint8_t compare_recovery_phrase(void) {
static uint8_t compare_recovery_phrase(void) {
// convert mnemonic to hex-seed
uint8_t buffer[64];

Expand All @@ -410,14 +410,18 @@ uint8_t compare_recovery_phrase(void) {
cx_hmac_sha512_t ctx;
const char key[] = "Bitcoin seed";

cx_hmac_sha512_init(&ctx, (const uint8_t*) key, strlen(key));
cx_hmac((cx_hmac_t*) &ctx, CX_LAST, buffer, 64, buffer, 64);
cx_hmac_sha512_init_no_throw(&ctx, (const uint8_t*) key, strlen(key));
cx_hmac_no_throw((cx_hmac_t*) &ctx, CX_LAST, buffer, 64, buffer, 64);
PRINTF("Root key from input:\n%.*H\n", 64, buffer);

// get rootkey from device's seed
uint8_t buffer_device[64];

os_perso_derive_node_bip32(CX_CURVE_256K1, NULL, 0, buffer_device, buffer_device + 32);
if (os_derive_bip32_no_throw(CX_CURVE_256K1, NULL, 0, buffer_device, buffer_device + 32) !=
CX_OK) {
PRINTF("An error occurred while comparing the recovery phrase\n");
return 0;
}
PRINTF("Root key from device: \n%.*H\n", 64, buffer_device);

// compare both rootkey
Expand Down
2 changes: 1 addition & 1 deletion src/stax/passphrase_length_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
nbgl_image_t *passphrase_length_set_icon() {
nbgl_image_t *image = (nbgl_image_t *) nbgl_objPoolGet(IMAGE, 0);
image->foregroundColor = BLACK;
image->buffer = &C_stax_recovery_64px;
image->buffer = &C_stax_recovery_check_64px;
image->obj.area.bpp = NBGL_BPP_1;
image->obj.alignmentMarginX = ICON_X;
image->obj.alignmentMarginY = ICON_Y;
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ def _write(self, characters: str):
# the screen can be compared, when it has not reached its last state yet.
# Adding extra time after writing to have a better chance to get the expected screen
self.screen.keyboard.write(characters)
sleep(0.3)
sleep(1)
Binary file modified tests/functional/snapshots/stax/check_previous_word/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/check_previous_word/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/correct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/first_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/first_18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/first_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/incorrect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/passphrase_length.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/second_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/third_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/functional/snapshots/stax/welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions tests/functional/test_fatstacks_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
def test_check_info_then_leave(navigator: StaxNavigator, functional_test_directory: str):
instructions = format_instructions([
CustomNavInsID.HOME_TO_SETTINGS,
CustomNavInsID.SETTINGS_TO_HOME,
CustomNavInsID.HOME_TO_QUIT
CustomNavInsID.SETTINGS_TO_HOME
])
navigator.navigate_and_compare(functional_test_directory,
"check_info_then_leave",
instructions,
screen_change_before_first_instruction=False,
screen_change_after_last_instruction=False)
screen_change_after_last_instruction=True)


def test_check_all_passphrase_lengths(navigator: StaxNavigator, functional_test_directory: str):
Expand Down
Loading