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

Feat/LDG-504--nano-app-add-support-for-2-derivation-paths #3

Merged
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
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ include $(BOLOS_SDK)/Makefile.defines
APPNAME = "Concordium"

# Application version
APPVERSION_M = 2
APPVERSION_N = 1
APPVERSION_M = 5
APPVERSION_N = 0
APPVERSION_P = 0
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

Expand All @@ -56,7 +56,8 @@ CURVE_APP_LOAD_PARAMS = secp256k1
# and SLIP-0044 standards.
# If your app needs it, you can specify multiple path by using:
# `PATH_APP_LOAD_PARAMS = "44'/1'" "45'/1'"`
PATH_APP_LOAD_PARAMS = "44'/1'" # purpose=coin(44) / coin_type=Testnet(1)
# purpose=coin(44) / coin_type=Testnet(1)
PATH_APP_LOAD_PARAMS = "44'/919'" "1105'/0'"

# Setting to allow building variant applications
# - <VARIANT_PARAM> is the name of the parameter which should be set
Expand Down
2 changes: 1 addition & 1 deletion src/address.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/apdu/dispatcher.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/app_main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/handler/get_app_name.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/handler/get_public_key.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/handler/get_version.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/handler/sign_tx.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/helper/send_reponse.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/deserialize.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/serialize.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/transaction/utils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/ui/action/validate.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/ui/bagl_display.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions src/ui/menu_bagl.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,7 +49,7 @@ void ui_menu_main() {
ux_flow_init(0, ux_menu_main_flow, NULL);
}

UX_STEP_NOCB(ux_menu_info_step, bn, {"Concordium App", "(c) 2020 Ledger"});
UX_STEP_NOCB(ux_menu_info_step, bn, {"Concordium App", "(c) 2024 Concordium"});
UX_STEP_CB(ux_menu_back_step, pb, ui_menu_main(), {&C_icon_back, "Back"});

// FLOW for the about submenu:
Expand Down
4 changes: 2 additions & 2 deletions src/ui/menu_nbgl.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,7 +39,7 @@ void app_quit(void) {
// -----------------------------------------------------------
#define SETTING_INFO_NB 2
static const char* const INFO_TYPES[SETTING_INFO_NB] = {"Version", "Developer"};
static const char* const INFO_CONTENTS[SETTING_INFO_NB] = {APPVERSION, "Ledger"};
static const char* const INFO_CONTENTS[SETTING_INFO_NB] = {APPVERSION, "Blooo"};

// settings switches definitions
enum { DUMMY_SWITCH_1_TOKEN = FIRST_USER_TOKEN, DUMMY_SWITCH_2_TOKEN };
Expand Down
2 changes: 1 addition & 1 deletion src/ui/nbgl_display_address.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/ui/nbgl_display_transaction.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
* Ledger App Concordium.
* (c) 2020 Ledger SAS.
* (c) 2024 Concordium.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Binary file modified tests/snapshots/flex/test_app_mainmenu/00006.png
n4l5u0r marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/snapshots/flex/test_get_public_key_confirm_refused/00001.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/snapshots/nanosp/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/snapshots/nanox/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/snapshots/stax/test_app_mainmenu/00006.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/snapshots/stax/test_get_public_key_confirm_accepted/00001.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/snapshots/stax/test_get_public_key_confirm_refused/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/test_name_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def test_get_app_and_version(backend, backend_name):
app_name, version = unpack_get_app_and_version_response(response.data)

assert app_name == "Concordium"
assert version == "2.1.0"
assert version == "5.0.0"
7 changes: 4 additions & 3 deletions tests/test_pubkey_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

# In this test we check that the GET_PUBLIC_KEY works in non-confirmation mode
def test_get_public_key_no_confirm(backend):
for path in ["m/44'/1'/0'/0/0", "m/44'/1'/0/0/0", "m/44'/1'/911'/0/0", "m/44'/1'/255/255/255", "m/44'/1'/2147483647/0/0/0/0/0/0/0"]:
for path in ["m/44'/919'/0'/0/0", "m/44'/919'/0/0/0", "m/44'/919'/911'/0/0", "m/44'/919'/255/255/255", "m/44'/919'/2147483647/0/0/0/0/0/0/0",
"m/1105'/0'/0'/0/0", "m/1105'/0'/0/0/0", "m/1105'/0'/911'/0/0", "m/1105'/0'/255/255/255", "m/1105'/0'/2147483647/0/0/0/0/0/0/0"]:
client = BoilerplateCommandSender(backend)
response = client.get_public_key(path=path).data
_, public_key, _, chain_code = unpack_get_public_key_response(response)
Expand All @@ -22,7 +23,7 @@ def test_get_public_key_no_confirm(backend):
# In this test we check that the GET_PUBLIC_KEY works in confirmation mode
def test_get_public_key_confirm_accepted(backend, scenario_navigator):
client = BoilerplateCommandSender(backend)
path = "m/44'/1'/0'/0/0"
path = "m/44'/919'/0'/0/0"
with client.get_public_key_with_confirmation(path=path):
scenario_navigator.address_review_approve()

Expand All @@ -37,7 +38,7 @@ def test_get_public_key_confirm_accepted(backend, scenario_navigator):
# In this test we check that the GET_PUBLIC_KEY in confirmation mode replies an error if the user refuses
def test_get_public_key_confirm_refused(backend, scenario_navigator):
client = BoilerplateCommandSender(backend)
path = "m/44'/1'/0'/0/0"
path = "m/44'/919'/0'/0/0"

with pytest.raises(ExceptionRAPDU) as e:
with client.get_public_key_with_confirmation(path=path):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_sign_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_sign_tx_short_tx(backend, scenario_navigator):
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
# The path used for this entire test
path: str = "m/44'/1'/0'/0/0"
path: str = "m/44'/919'/0'/0/0"

# First we need to get the public key of the device in order to build the transaction
rapdu = client.get_public_key(path=path)
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_sign_tx_short_tx_blind_sign(firmware, navigator, backend, scenario_navi
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
# The path used for this entire test
path: str = "m/44'/1'/0'/0/0"
path: str = "m/44'/919'/0'/0/0"

# First we need to get the public key of the device in order to build the transaction
rapdu = client.get_public_key(path=path)
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_sign_tx_short_tx_blind_sign(firmware, navigator, backend, scenario_navi
def test_sign_tx_long_tx(backend, scenario_navigator):
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
path: str = "m/44'/1'/0'/0/0"
path: str = "m/44'/919'/0'/0/0"

rapdu = client.get_public_key(path=path)
_, public_key, _, _ = unpack_get_public_key_response(rapdu.data)
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_sign_tx_long_tx(backend, scenario_navigator):
def test_sign_tx_refused(backend, scenario_navigator):
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
path: str = "m/44'/1'/0'/0/0"
path: str = "m/44'/919'/0'/0/0"

rapdu = client.get_public_key(path=path)
_, pub_key, _, _ = unpack_get_public_key_response(rapdu.data)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_version_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from application_client.boilerplate_response_unpacker import unpack_get_version_response

# Taken from the Makefile, to update every time the Makefile version is bumped
MAJOR = 2
MINOR = 1
MAJOR = 5
MINOR = 0
PATCH = 0

# In this test we check the behavior of the device when asked to provide the app version
Expand Down
Loading