Skip to content

Commit

Permalink
[fix] os_derive_bip32 syscall can't take NULL path
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Nov 13, 2023
1 parent 504aed6 commit 80838af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/nano/nanos_enter_phrase.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ void compare_recovery_phrase(void) {
// get rootkey from device's seed
uint8_t buffer_device[64];

if (os_derive_bip32_no_throw(CX_CURVE_256K1, NULL, 0, buffer_device, buffer_device + 32) !=
// os_derive_bip32* do not accept NULL path, even with a size of 0, so we provide an empty path
const unsigned int empty_path = 0;
if (os_derive_bip32_no_throw(CX_CURVE_256K1, &empty_path, 0, buffer_device, buffer_device + 32) !=
CX_OK) {
PRINTF("An error occurred while comparing the recovery phrase\n");
return;
Expand Down
4 changes: 3 additions & 1 deletion src/nano/nanox_enter_phrase.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ static uint8_t compare_recovery_phrase(void) {
// get rootkey from device's seed
uint8_t buffer_device[64];

if (os_derive_bip32_no_throw(CX_CURVE_256K1, NULL, 0, buffer_device, buffer_device + 32) !=
// os_derive_bip32* do not accept NULL path, even with a size of 0, so we provide an empty path
const unsigned int empty_path = 0;
if (os_derive_bip32_no_throw(CX_CURVE_256K1, &empty_path, 0, buffer_device, buffer_device + 32) !=
CX_OK) {
PRINTF("An error occurred while comparing the recovery phrase\n");
return 0;
Expand Down

0 comments on commit 80838af

Please sign in to comment.