Skip to content

Commit af99bcd

Browse files
Merge pull request #145 from LedgerHQ/cev/B2CA-1584-nbgl_nano
B2CA-1584: Port Nano on NBGL
2 parents 9c2ea1c + 204deaf commit af99bcd

File tree

163 files changed

+564
-574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+564
-574
lines changed

.clang-format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
BasedOnStyle: Google
33
IndentWidth: 4
4-
---
54
Language: Cpp
65
ColumnLimit: 100
76
PointerAlignment: Right

.clusterfuzzlite/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pushd fuzzing
66
cmake -DBOLOS_SDK=../BOLOS_SDK -Bbuild -H.
77
make -C build
88
mv ./build/fuzz_tx_parser "${OUT}"
9-
popd
9+
popd

.clusterfuzzlite/project.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
language: c
1+
language: c

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Checklist
2+
23
<!-- Put an `x` in each box when you have completed the items. -->
4+
35
- [ ] App update process has been followed <!-- See comment below -->
46
- [ ] Target branch is `develop` <!-- unless you have a very good reason -->
57
- [ ] Application version has been bumped <!-- required if your changes are to be deployed -->
68

7-
<!-- Make sure you followed the process described in https://developers.ledger.com/docs/device-app/deliver/maintenance before opening your Pull Request.
9+
<!-- Make sure you followed the process described in https://developers.ledger.com/docs/device-app/deliver/maintenance
10+
before opening your Pull Request.
811
Don't hesitate to contact us directly on Discord if you have any questions ! https://developers.ledger.com/discord -->

.github/workflows/build_and_functional_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
type: choice
1717
required: true
1818
default: 'Raise an error (default)'
19-
description: CI behavior if the test snaphots are different than expected.
19+
description: CI behavior if the test snapshots are different than expected.
2020
options:
2121
- 'Raise an error (default)'
2222
- 'Open a PR'

.github/workflows/cflite_cron.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@ jobs:
2323
- mode: coverage
2424
sanitizer: coverage
2525
steps:
26-
- name: Build Fuzzers (${{ matrix.mode }} - ${{ matrix.sanitizer }})
27-
id: build
28-
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
29-
with:
30-
github-token: ${{ secrets.GITHUB_TOKEN }}
31-
language: c # Change this to the language you are fuzzing.
32-
sanitizer: ${{ matrix.sanitizer }}
33-
- name: Run Fuzzers (${{ matrix.mode }} - ${{ matrix.sanitizer }})
34-
id: run
35-
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
36-
with:
37-
github-token: ${{ secrets.GITHUB_TOKEN }}
38-
fuzz-seconds: 300 # 5 minutes
39-
mode: ${{ matrix.mode }}
40-
sanitizer: ${{ matrix.sanitizer }}
41-
26+
- name: Build Fuzzers (${{ matrix.mode }} - ${{ matrix.sanitizer }})
27+
id: build
28+
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
language: c # Change this to the language you are fuzzing.
32+
sanitizer: ${{ matrix.sanitizer }}
33+
- name: Run Fuzzers (${{ matrix.mode }} - ${{ matrix.sanitizer }})
34+
id: run
35+
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
36+
with:
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
fuzz-seconds: 300 # 5 minutes
39+
mode: ${{ matrix.mode }}
40+
sanitizer: ${{ matrix.sanitizer }}

.github/workflows/cflite_pr.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
sanitizer: [address, undefined, memory] # Override this with the sanitizers you want.
16+
sanitizer: [address, undefined, memory] # Override this with the sanitizers you want.
1717
steps:
18-
- name: Build Fuzzers (${{ matrix.sanitizer }})
19-
id: build
20-
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
21-
with:
22-
language: c # Change this to the language you are fuzzing.
23-
github-token: ${{ secrets.GITHUB_TOKEN }}
24-
sanitizer: ${{ matrix.sanitizer }}
25-
# Optional but recommended: used to only run fuzzers that are affected
26-
# by the PR.
27-
# storage-repo: https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/OWNER/STORAGE-REPO-NAME.git
28-
# storage-repo-branch: main # Optional. Defaults to "main"
29-
# storage-repo-branch-coverage: gh-pages # Optional. Defaults to "gh-pages".
30-
- name: Run Fuzzers (${{ matrix.sanitizer }})
31-
id: run
32-
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
33-
with:
34-
github-token: ${{ secrets.GITHUB_TOKEN }}
35-
fuzz-seconds: 300 # 5 minutes
36-
mode: 'code-change'
37-
sanitizer: ${{ matrix.sanitizer }}
38-
output-sarif: true
39-
# Optional but recommended: used to download the corpus produced by
40-
# batch fuzzing.
41-
# storage-repo: https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/OWNER/STORAGE-REPO-NAME.git
42-
# storage-repo-branch: main # Optional. Defaults to "main"
43-
# storage-repo-branch-coverage: gh-pages # Optional. Defaults to "gh-pages".
18+
- name: Build Fuzzers (${{ matrix.sanitizer }})
19+
id: build
20+
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
21+
with:
22+
language: c # Change this to the language you are fuzzing.
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
sanitizer: ${{ matrix.sanitizer }}
25+
# Optional but recommended: used to only run fuzzers that are affected
26+
# by the PR.
27+
# storage-repo: https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/OWNER/STORAGE-REPO-NAME.git
28+
# storage-repo-branch: main # Optional. Defaults to "main"
29+
# storage-repo-branch-coverage: gh-pages # Optional. Defaults to "gh-pages".
30+
- name: Run Fuzzers (${{ matrix.sanitizer }})
31+
id: run
32+
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
fuzz-seconds: 300 # 5 minutes
36+
mode: 'code-change'
37+
sanitizer: ${{ matrix.sanitizer }}
38+
output-sarif: true
39+
# Optional but recommended: used to download the corpus produced by
40+
# batch fuzzing.
41+
# storage-repo: https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/OWNER/STORAGE-REPO-NAME.git
42+
# storage-repo-branch: main # Optional. Defaults to "main"
43+
# storage-repo-branch-coverage: gh-pages # Optional. Defaults to "gh-pages".

.github/workflows/codeql_checks.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ jobs:
1717
analyse:
1818
name: Analyse
1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
sdk: ["$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"]
22-
#'cpp' covers C and C++
23-
language: [ 'cpp' ]
23+
# 'cpp' covers C and C++
24+
language: ['cpp']
2425
runs-on: ubuntu-latest
2526
container:
2627
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
2728

2829
steps:
2930
- name: Clone
30-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
3132

3233
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@v2
34+
uses: github/codeql-action/init@v3
3435
with:
3536
languages: ${{ matrix.language }}
3637
queries: security-and-quality
@@ -41,4 +42,4 @@ jobs:
4142
make BOLOS_SDK=${{ matrix.sdk }}
4243
4344
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v2
45+
uses: github/codeql-action/analyze@v3

.github/workflows/coding_style_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
with:
2323
source: './src'
2424
extensions: 'h,c'
25-
version: 11
25+
version: 12

.github/workflows/documentation_generation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818

1919
steps:
2020
- name: Clone
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: HTML documentation
2424
run: doxygen .doxygen/Doxyfile
2525

26-
- uses: actions/upload-artifact@v3
26+
- uses: actions/upload-artifact@v4
2727
with:
2828
name: documentation
2929
path: doc/html

.github/workflows/misspellings_checks.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
name: Check misspellings
1919
runs-on: ubuntu-latest
2020
steps:
21-
- name: Clone
22-
uses: actions/checkout@v3
21+
- name: Clone
22+
uses: actions/checkout@v4
2323

24-
- name: Check misspellings
25-
uses: codespell-project/actions-codespell@v1
26-
with:
27-
builtin: clear,rare
28-
check_filenames: true
24+
- name: Check misspellings
25+
uses: codespell-project/actions-codespell@v2
26+
with:
27+
builtin: clear,rare
28+
check_filenames: true

.github/workflows/python_client_checks.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,28 @@ on:
1414
pull_request:
1515

1616
jobs:
17-
1817
lint:
1918
name: Boilerplate client linting
2019
runs-on: ubuntu-latest
2120
steps:
22-
- name: Clone
23-
uses: actions/checkout@v3
24-
- name: Installing PIP dependencies
25-
run: |
26-
pip install pylint
27-
pip install -r tests/requirements.txt
28-
- name: Lint Python code
29-
run: |
30-
pylint --rc tests/setup.cfg tests/application_client/
21+
- name: Clone
22+
uses: actions/checkout@v4
23+
- name: Installing PIP dependencies
24+
run: |
25+
pip install pylint
26+
pip install -r tests/requirements.txt
27+
- name: Lint Python code
28+
run: pylint --rc tests/setup.cfg tests/application_client/
3129

3230
mypy:
3331
name: Type checking
3432
runs-on: ubuntu-latest
3533
steps:
36-
- name: Clone
37-
uses: actions/checkout@v3
38-
- name: Installing PIP dependencies
39-
run: |
40-
pip install mypy
41-
pip install -r tests/requirements.txt
42-
- name: Mypy type checking
43-
run: |
44-
mypy tests/application_client/
34+
- name: Clone
35+
uses: actions/checkout@v4
36+
- name: Installing PIP dependencies
37+
run: |
38+
pip install mypy
39+
pip install -r tests/requirements.txt
40+
- name: Mypy type checking
41+
run: mypy tests/application_client/

.github/workflows/unit_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818

1919
steps:
2020
- name: Clone
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: Clone SDK
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
2626
repository: ledgerHQ/ledger-secure-sdk
2727
path: sdk
@@ -41,7 +41,7 @@ jobs:
4141
lcov --directory . -b "$(realpath build/)" --remove coverage.info '*/unit-tests/*' -o coverage.info && \
4242
genhtml coverage.info -o coverage
4343
44-
- uses: actions/upload-artifact@v3
44+
- uses: actions/upload-artifact@v4
4545
with:
4646
name: code-coverage
4747
path: unit-tests/coverage

.mdl.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Style file for mdl
2+
# https://github.com/markdownlint/markdownlint/blob/main/docs/creating_styles.md
3+
4+
# Include all rules
5+
all
6+
7+
# Disable specific rules
8+
#exclude_rule 'MD012'
9+
10+
# Update rules configuration
11+
rule 'MD013', :line_length => 120

.mdlrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# markdownlint config file
2+
3+
# Use custom style file
4+
style "#{File.dirname(__FILE__)}/.mdl.rb"
5+
6+
# MD002 - First header in file should be a top level header
7+
# MD005 - Inconsistent indentation for list items at the same level
8+
# MD007 - Unordered list indentation
9+
# MD014 - Dollar signs used before commands without showing output
10+
# MD024 - Multiple headers with the same content
11+
# MD029 - Ordered list item prefix
12+
# MD033 - Inline HTML
13+
# MD041 - First line in file should be a top level header
14+
rules "~MD002,~MD005,~MD007,~MD014,~MD024,~MD029,~MD033,~MD041"

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# To install hooks, run:
2+
# pre-commit install --hook-type pre-commit
3+
# pre-commit install --hook-type commit-msg
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v5.0.0
8+
hooks:
9+
- id: trailing-whitespace
10+
- id: end-of-file-fixer
11+
- id: mixed-line-ending
12+
- id: check-added-large-files
13+
- id: check-merge-conflict
14+
- id: check-case-conflict
15+
16+
- repo: https://github.com/codespell-project/codespell
17+
rev: v2.3.0
18+
hooks:
19+
- id: codespell
20+
21+
- repo: https://github.com/pre-commit/mirrors-clang-format
22+
rev: v12.0.1
23+
hooks:
24+
- id: clang-format
25+
types_or: [c]
26+
27+
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
28+
rev: v1.7.6.22
29+
hooks:
30+
- id: actionlint
31+
types_or: [yaml]
32+
args: [-shellcheck='' -pyflakes='']
33+
34+
- repo: https://github.com/markdownlint/markdownlint
35+
rev: v0.12.0
36+
hooks:
37+
- id: markdownlint
38+
types_or: [markdown]
39+
40+
- repo: https://github.com/PyCQA/pylint
41+
rev: v3.3.3
42+
hooks:
43+
- id: pylint
44+
language: system
45+
types: [python]
46+
args: ['--jobs=0', '--rcfile=tests/setup.cfg']
47+
files: '^tests/.*$'

0 commit comments

Comments
 (0)