Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/codeql_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Analyse
strategy:
matrix:
sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK" ]
sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"]
#'cpp' covers C and C++
language: [ 'cpp' ]
runs-on: ubuntu-latest
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ include $(BOLOS_SDK)/Makefile.defines
APPNAME = "Flow"

APPVERSION_M=0
APPVERSION_N=13
APPVERSION_N=14
APPVERSION_P=0
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

Expand All @@ -48,6 +48,7 @@ ICON_NANOS = icons/nanos_icon.gif
ICON_NANOX = icons/nanox_icon.gif
ICON_NANOSP = icons/nanox_icon.gif
ICON_STAX = icons/stax_icon.gif
ICON_FLEX = icons/flex_icon.png

# Application allowed derivation curves.
# Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1
Expand Down Expand Up @@ -133,6 +134,11 @@ ifeq ($(DEBUG),1)
DEFINES += ZEMU_LOGGING
endif

PRODUCTION_BUILD ?= 1
ifeq ($(PRODUCTION_BUILD),1)
DEFINES += PRODUCTION_BUILD=1
endif

#########################

# Import generic rules from the SDK
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

This repository contains:

- Ledger Nano S/Nano X/Nano SPlus/STAX BOLOS app
- Ledger Nano S/Nano X/Nano SPlus/STAX/FLEX BOLOS app
- Specs / Documentation
- Ledger ragger tests

Expand Down Expand Up @@ -51,14 +51,21 @@ make
make BOLOS_SDK=$NANOX_SDK
make BOLOS_SDK=$NANOSP_SDK
make BOLOS_SDK=$STAX_SDK
make BOLOS_SDK=$FLEX_SDK
```

Stax app can be compiled in DEBUG mode for debugging purposes
Stax and flex app can be compiled in DEBUG mode for debugging purposes
```shell
make BOLOS_SDK=$STAX_SDK DEBUG=1
```
Note, that it is possible (although unlikely) for ledger to make a braking change in ledger-app-dev-tools:latest.

Note, that the build by default builds a build with captions showing that it is a demo app. To replace the captions with correct ones one should use e.g.

```shell
make BOLOS_SDK=$STAX_SDK PRODUCTION_BUILD=1
```

#### Tests

##### Speculos integration tests
Expand All @@ -71,6 +78,7 @@ pytest tests/ --tb=short -v --device nanos
pytest tests/ --tb=short -v --device nanox
pytest tests/ --tb=short -v --device nanosp
pytest tests/ --tb=short -v --device stax
pytest tests/ --tb=short -v --device flex
```

Note that in case ledger-app-dev-tools:latest is updated there is a chance that slight changes in gui happen. In that case it is necessary to re-generate the snapshots, e.g.
Expand Down Expand Up @@ -99,6 +107,7 @@ make scan-build
make scan-build BOLOS_SDK=$NANOX_SDK
make scan-build BOLOS_SDK=$NANOSP_SDK
make scan-build BOLOS_SDK=$STAX_SDK
make scan-build BOLOS_SDK=$FLEX_SDK
```

## Further information
Expand Down Expand Up @@ -203,8 +212,9 @@ You can choose which device to compile and load for by setting the `BOLOS_SDK` e
- `BOLOS_SDK=$NANOX_SDK`
- `BOLOS_SDK=$NANOSP_SDK`
- `BOLOS_SDK=$STAX_SDK`
- `BOLOS_SDK=$FLEX_SDK`

For Stax device you can compile
For Stax and FLEX device you can compile
```shell
make BOLOS_SDK=$STAX_SDK DEBUG=1 # compile optionally with PRINTF
```
Expand Down
10 changes: 10 additions & 0 deletions deps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Updating zx-lib

Menu fetaure requires us to change zxlib menu layout. Thus instead of a submodule, we have ledger-zxlib included as a copy. In case you need to update zxlib, this is the list of changes performed.

- Menu contains new "Show address"/"View address" entries which display address and pubkey according to data saved on slot 0
- Menu changes. Remove "Developed by" and "Website" entries.
- Set MAX_CHARS_PER_VALUE1_LINE to 120
We experienced crashes with certain strings too long.
- Removed duplicate base58.* files to avoid warnings.

5 changes: 5 additions & 0 deletions deps/ledger-zxlib/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120
DerivePointerAlignment: false
PointerAlignment: Right
21 changes: 21 additions & 0 deletions deps/ledger-zxlib/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Checks: "-*,
clang-analyzer-*,
clang-diagnostic-*,
cppcoreguidelines-init-variables,
google-readability-avoid-underscore-in-googletest-name,
google-runtime-int,
misc-*,
performance-*,
portability-*,
readability-*,
-misc-no-recursion,
-readability-function-cognitive-complexity
-readability-magic-numbers"
WarningsAsErrors: "*"
CheckOptions:
- key: readability-identifier-length.MinimumVariableNameLength
value: 2
- key: readability-identifier-length.MinimumParameterNameLength
value: 2
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 1
6 changes: 3 additions & 3 deletions deps/ledger-zxlib/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- run: cmake -DCMAKE_BUILD_TYPE=Debug . && make
Expand All @@ -26,7 +26,7 @@ jobs:
exists: ${{ steps.get-version.outputs.exists }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand All @@ -53,7 +53,7 @@ jobs:
if: ${{ needs.check_version.outputs.exists != 'true' && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.check_version.outputs.version }}
35 changes: 27 additions & 8 deletions deps/ledger-zxlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#*******************************************************************************
#* (c) 2018 Zondax GmbH
#* (c) 2018 Zondax AG
#*
#* Licensed under the Apache License, Version 2.0 (the "License");
#* you may not use this file except in compliance with the License.
Expand All @@ -13,19 +13,38 @@
#* See the License for the specific language governing permissions and
#* limitations under the License.
#********************************************************************************
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.18)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.25.5.tar.gz"
SHA1 "a20151e4c0740ee7d0f9994476856d813cdead29"
LOCAL
)

if(CMAKE_GENERATOR MATCHES "Ninja")
message(FATAL_ERROR "This project does not support the Ninja generator. "
"Please use Unix Makefiles or another supported generator. "
"This error is typical in CLion. In this case, switch to generator Unix Makefiles.")
endif()

########################################################
project(ledger-zxlib)

set(CMAKE_CXX_STANDARD 11)
cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0144 NEW)

enable_testing()

add_subdirectory(cmake/gtest)
hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED)

###############

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
)

###############

file(GLOB_RECURSE ZXLIB_SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/*.c
)
Expand All @@ -48,10 +67,10 @@ add_executable(zxlib_tests

target_include_directories(zxlib_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${gtest_SOURCE_DIR}/include
${gmock_SOURCE_DIR}/include
)

target_link_libraries(zxlib_tests gtest_main zxlib)
target_link_libraries(zxlib_tests PRIVATE
GTest::gtest_main
zxlib)

add_test(ZXLIB_TESTS zxlib_tests)
2 changes: 1 addition & 1 deletion deps/ledger-zxlib/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2020 Zondax GmbH
Copyright 2018-2024 Zondax AG

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 deps/ledger-zxlib/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ledger-zxlib

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

[![GithubActions](https://github.com/zondax/ledger-zxlib/actions/workflows/main.yml/badge.svg)](https://github.com/Zondax/ledger-zxlib/blob/main/.github/workflows/main.yaml)
[![CodeFactor](https://www.codefactor.io/repository/github/zondax/ledger-zxlib/badge)](https://www.codefactor.io/repository/github/zondax/ledger-zxlib)
Loading