Skip to content
Draft
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
32 changes: 3 additions & 29 deletions .github/workflows/codeql_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@ on:

jobs:
analyse:
name: Analyse
strategy:
matrix:
sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"]
#'cpp' covers C and C++
language: [ 'cpp' ]
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest

steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-and-quality

# CodeQL will create the database during the compilation
- name: Build
run: |
make BOLOS_SDK=${{ matrix.sdk }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
name: Call Ledger CodeQL analysis
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_codeql_checks.yml@v1
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/documentation_generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: HTML documentation
run: doxygen .doxygen/Doxyfile

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: documentation
path: doc/html
4 changes: 2 additions & 2 deletions .github/workflows/js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- run: cd js && yarn install && yarn build && yarn test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/misspellings_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check misspellings
uses: codespell-project/actions-codespell@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python_client_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Installing PIP dependencies
run: |
pip install pylint
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Installing PIP dependencies
run: |
pip install mypy
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check directory
run: |
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Clone SDK
if: ${{ env.DIR_OK == 'true' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ledgerHQ/ledger-secure-sdk
path: sdk
Expand All @@ -53,15 +53,15 @@ jobs:
lcov --directory . -b "$(realpath build/)" --remove coverage.info '*/unit-tests/*' -o coverage.info && \
genhtml coverage.info -o coverage

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ env.DIR_OK == 'true' }}
with:
name: code-coverage
path: unit-tests/coverage

- name: Upload to codecov.io
if: ${{ env.DIR_OK == 'true' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit-tests/coverage.info
Expand Down
12 changes: 3 additions & 9 deletions 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=15
APPVERSION_N=16
APPVERSION_P=0
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

Expand All @@ -49,6 +49,7 @@ ICON_NANOX = icons/nanox_icon.gif
ICON_NANOSP = icons/nanox_icon.gif
ICON_STAX = icons/stax_icon.gif
ICON_FLEX = icons/flex_icon.png
ICON_APEX_P = icons/apex_p_icon.png

# Application allowed derivation curves.
# Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1
Expand Down Expand Up @@ -105,15 +106,12 @@ ENABLE_BLUETOOTH = 1
########################################
# These advanced settings allow to disable some feature that are by
# default enabled in the SDK `Makefile.standard_app`.
DISABLE_STANDARD_APP_FILES = 1
# DISABLE_STANDARD_APP_FILES = 1
#DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE = 1 # To allow custom size declaration
#DISABLE_STANDARD_APP_DEFINES = 1 # Will set all the following disablers
#DISABLE_STANDARD_SNPRINTF = 1
#DISABLE_STANDARD_USB = 1
#DISABLE_STANDARD_WEBUSB = 1
ifeq ($(TARGET_NAME),TARGET_NANOS)
DISABLE_STANDARD_BAGL_UX_FLOW = 1
endif

########################################
# Main app configuration #
Expand All @@ -122,10 +120,6 @@ endif
DEFINES += HAVE_BOLOS_APP_STACK_CANARY
DEFINES += LEDGER_SPECIFIC

ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_STACK_MIN_SIZE:=2480
endif

########################################
# Unit tests and misc #
########################################
Expand Down
Binary file added glyphs/icon_apex_p_48.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 added icons/apex_p_icon.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 ledger_app.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos+", "nanox", "stax", "flex"]
devices = ["nanos+", "nanox", "stax", "flex", "apex_p"]

[tests]
unit_directory = "./unit-tests/"
Expand Down
18 changes: 0 additions & 18 deletions src/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,12 @@ zxerr_t addr_getItem_internal(int8_t *displayIdx,
pageString(outVal, outValLen, "account data.", pageIdx, pageCount);
return zxerr_ok;
case SHOW_ADDRESS_EMPTY_SLOT:
#if defined(TARGET_NANOS)
snprintf(outKey, outKeyLen, "Account data");
pageString(outVal, outValLen, "not saved on the device.", pageIdx, pageCount);
#else
snprintf(outKey, outKeyLen, "Address:");
pageString(outVal,
outValLen,
"Account data not saved on the device.",
pageIdx,
pageCount);
#endif
return zxerr_ok;
case SHOW_ADDRESS_HDPATHS_NOT_EQUAL:
snprintf(outKey, outKeyLen, "Address:");
Expand All @@ -107,32 +102,19 @@ zxerr_t addr_getItem_internal(int8_t *displayIdx,
}

SCREEN(show_address_yes) {
#if defined(TARGET_NANOS)
snprintf(outKey, outKeyLen, "Verify if this");
snprintf(outVal, outValLen, " public key was added to");
#else
snprintf(outKey, outKeyLen, "Warning:");
snprintf(outVal, outValLen, "Verify if this public key was added to");
#endif
return zxerr_ok;
}

SCREEN(show_address_yes) {
#if defined(TARGET_NANOS)
array_to_hexstr(outKey,
outKeyLen,
address_to_display.data,
sizeof(address_to_display.data));
snprintf(outVal, outValLen, " using any Flow blockch. explorer.");
#else
char buffer[2 * sizeof(address_to_display.data) + 1];
array_to_hexstr(buffer,
sizeof(buffer),
address_to_display.data,
sizeof(address_to_display.data));
snprintf(outVal, outValLen, "%s using any Flow blockchain explorer.", buffer);
snprintf(outKey, outKeyLen, "");
#endif
return zxerr_ok;
}

Expand Down
1 change: 1 addition & 0 deletions src/common/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ __attribute__((section(".boot"))) int main(void) {
app_main();
}
CATCH_OTHER(e) {
UNUSED(e);
}
FINALLY {
}
Expand Down
7 changes: 1 addition & 6 deletions src/common/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@
#include "zxmacros.h"
#include "app_mode.h"

#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX)
#define RAM_BUFFER_SIZE 8192
#define FLASH_BUFFER_SIZE 16384
#elif defined(TARGET_NANOS)
#define RAM_BUFFER_SIZE 0
#define FLASH_BUFFER_SIZE 8192
#endif

// Ram
uint8_t ram_buffer[RAM_BUFFER_SIZE];
Expand All @@ -39,7 +34,7 @@ typedef struct {
} storage_t;

#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || \
defined(TARGET_STAX) || defined(TARGET_FLEX)
defined(TARGET_STAX) || defined(TARGET_FLEX) || defined(TARGET_APEX_P)
storage_t NV_CONST N_appdata_impl __attribute__((aligned(64)));
#define N_appdata (*(NV_VOLATILE storage_t *) PIC(&N_appdata_impl))
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "zxerror.h"

#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || \
defined(TARGET_STAX) || defined(TARGET_FLEX)
defined(TARGET_STAX) || defined(TARGET_FLEX) || defined(TARGET_APEX_P)
#include "lib_standard_app/crypto_helpers.h"
#include "cx.h"

Expand Down
2 changes: 1 addition & 1 deletion src/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef enum { HASH_UNKNOWN, HASH_SHA2_256, HASH_SHA3_256 } digest_type_e;
typedef enum { CURVE_UNKNOWN, CURVE_SECP256K1, CURVE_SECP256R1 } curve_e;

#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || \
defined(TARGET_STAX) || defined(TARGET_FLEX)
defined(TARGET_STAX) || defined(TARGET_FLEX) || defined(TARGET_APEX_P)
#else
#define CX_SHA256_SIZE 32
#define CX_SHA3_256_SIZE 32
Expand Down
6 changes: 0 additions & 6 deletions src/json/json_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ extern "C" {
/// Max number of accepted tokens in the JSON input
#define MAX_NUMBER_OF_TOKENS 256

// we must limit the number
#if defined(TARGET_NANOS)
#undef MAX_NUMBER_OF_TOKENS
#define MAX_NUMBER_OF_TOKENS 128
#endif

#define ROOT_TOKEN_INDEX 0

//---------------------------------------------
Expand Down
Loading