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

Request to review current develop #5

Closed
wants to merge 101 commits into from
Closed
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
fe3d9f8
fix ARD-#01
sargue Mar 30, 2023
248a634
added E2E tests instructions
sargue Apr 19, 2023
208e3cc
added unit tests using Ragger
sargue Apr 21, 2023
eb58e6c
fix ARD-#03
sargue Apr 21, 2023
40b5ba0
remove warnings
sargue Apr 21, 2023
c5c397f
remove AES included library, use SDK functions
sargue Apr 24, 2023
ed965f4
remove NXT references
sargue Apr 24, 2023
8b359fd
added pragma once to include files
sargue Apr 24, 2023
b59f9b6
fix type mismatch
sargue Apr 24, 2023
3565cd6
remove unused icons
sargue Apr 24, 2023
3028f2d
extract parse code to file, refactor magic numbers
sargue Apr 24, 2023
b3b7beb
update Copyright
sargue Apr 24, 2023
ccac8c4
refactor magic numbers
sargue Apr 25, 2023
52957fa
improve code consistency
sargue Apr 25, 2023
9b8c1ea
refactor long functions
sargue Apr 25, 2023
569dd93
added tests
sargue Apr 25, 2023
ddb5349
support for testing Nano S Plus
sargue May 2, 2023
0ed1558
updated CI workflow
sargue May 2, 2023
f429c43
Ci fixes (#12)
sargue May 3, 2023
65d6515
missing include
sargue May 3, 2023
0255e93
move SDK code to new standard_app SDK
sargue May 3, 2023
ab2a3df
fix icons location
sargue May 3, 2023
36c471d
Merge pull request #13 from jelurida-dev/audit_fixes
sargue May 3, 2023
c04e98c
refactor to extract UI code
sargue May 5, 2023
67afdf6
refactor to global UI callbacks
sargue May 5, 2023
b0ed5da
stax support
sargue May 9, 2023
cdc465d
added stax ragger tests
sargue May 9, 2023
42f1f0e
enable stax on workflows
sargue May 9, 2023
1793609
one more workflow for stax
sargue May 9, 2023
b534bf5
switch to gif icons
sargue May 9, 2023
be97f11
Merge pull request #14 from jelurida-dev/stax_support
sargue May 9, 2023
ead0cae
update glyphs from latest SDK
sargue May 10, 2023
0bdb1bb
updated tests snapshots
sargue May 10, 2023
f6a907f
updated Makefile regarding txnTypeLists.c
sargue May 10, 2023
b7216f8
updated pytest requirements
sargue May 10, 2023
e5a0a86
apply further Makefile simplifications
sargue May 10, 2023
44af1b3
fix stax ragger tests
sargue May 10, 2023
d8c3b3a
use new _no_throw cx variants
sargue May 11, 2023
0687cf2
simplify clearing of tx state
sargue May 15, 2023
d8402e1
refactor unneeded cast
sargue May 15, 2023
71d6050
properly close TRY structure
sargue May 15, 2023
2e508d0
remove local copy of glyphs to use SDK ones
sargue May 15, 2023
b34de60
use _no_throw version of BIP32 derivation call
sargue May 15, 2023
001bb9b
more functional tests
sargue May 18, 2023
37689d0
use higher level io / APDU functions
sargue May 25, 2023
3c740ec
use HAVE_PENDING_REVIEW_SCREEN setting
sargue May 25, 2023
83a4212
update NGBL signToken UX flow
sargue Jun 1, 2023
7c94641
code style
sargue Jun 1, 2023
a0a1bd1
Merge pull request #15 from LedgerHQ/master
sargue Jun 5, 2023
9c3d574
Merge branch 'master' into develop
sargue Jun 5, 2023
8895c10
update version on functional test
sargue Jun 5, 2023
c409b65
updated pytest libraries
sargue Aug 8, 2023
fe15867
fix test
sargue Aug 8, 2023
6e89c23
replace deprecated SDK usage
sargue Aug 9, 2023
acbd489
add ticker name to amounts and fees
sargue Aug 9, 2023
cd78c57
comments about disabled chains
sargue Aug 10, 2023
bbd0b9a
fix linting issues
sargue Aug 10, 2023
131df5a
added settings menu for blind signing
sargue Aug 14, 2023
4c1da2e
blind signing support for Stax
sargue Aug 17, 2023
caaf827
blind signing support for nanos/x/sp
sargue Aug 18, 2023
7ff4436
code linting
sargue Aug 18, 2023
ebf57b7
enabled qr code for address verification on stax
sargue Aug 18, 2023
9a3107a
bump version to 1.1.0
sargue Aug 18, 2023
af67d6f
update Makefile
sargue Aug 22, 2023
62037b7
blind signing also for unknown transactions
sargue Aug 22, 2023
3d0c749
minor UI fixes for Stax version
sargue Aug 25, 2023
f0a445d
update expected test results
sargue Aug 25, 2023
1c39553
fix ragger tests dependencies
sargue Oct 18, 2023
cf3f60d
minor improvements Makefile
sargue Oct 18, 2023
488d773
Improvement: Change state union into a struct
sargue Oct 18, 2023
cc30af2
move call to show screen from parser to control
sargue Oct 19, 2023
2857544
enums to track state and lastCommandDifferent refactor
sargue Oct 19, 2023
9d1b644
code linting
sargue Oct 19, 2023
c096035
fix ARD-#07 type confusion
sargue Oct 19, 2023
dc669d7
fix ARD-#08 sensitive information clearing
sargue Oct 19, 2023
6123557
fix ARD-#09 add null protection
sargue Oct 19, 2023
4661322
add buffer size protection
sargue Oct 19, 2023
bd5fe1a
commit txnTypeLists.c as it rarely changes
sargue Oct 20, 2023
711512b
use more secure explicit_bzero instead of memset
sargue Oct 21, 2023
8cd928d
adjust Makefile to commited txnTypeLists.c
sargue Oct 23, 2023
348d32e
refactor p1InitContinueCommon
sargue Oct 23, 2023
ac721da
more magic numbers refactor
sargue Oct 23, 2023
c615ad0
code style
sargue Oct 24, 2023
726c7a2
parseMainTxnData refactoring
sargue Oct 24, 2023
16b0639
fix codeql warnings
sargue Oct 24, 2023
9633e2d
refactor referenced_tx support
sargue Oct 24, 2023
293a6db
fix asset order attachment support
sargue Oct 24, 2023
d2d1911
replace generic fields with union for tx attachments
sargue Oct 25, 2023
2702f48
refactored the optional UI windows as an array
sargue Oct 25, 2023
b8f582c
added STAX to CodeQL checks
sargue Oct 25, 2023
47d132f
fix CodeQL warning
sargue Oct 25, 2023
ac8076e
remove infinite loop
sargue Oct 25, 2023
42a1934
added recommended volatile for variables inside try/catch
sargue Oct 27, 2023
2a3c042
update README
sargue Oct 27, 2023
ee749b1
added notes about custom EC-KCDSA signing algorithm
sargue Nov 9, 2023
74655ec
added workflows manifest file
sargue Nov 23, 2023
7501308
remove review screen
sargue Dec 27, 2023
7b5db66
handle crypto library return values
sargue Dec 27, 2023
99527d5
ignore python virtual env
sargue Dec 27, 2023
1d64443
code style
sargue Dec 27, 2023
9ac821d
Merge pull request #16 from LedgerHQ/develop
sargue Dec 27, 2023
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
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
BasedOnStyle: Google
IndentWidth: 4
---
Language: Cpp
ColumnLimit: 100
PointerAlignment: Right
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AllowAllParametersOfDeclarationOnNextLine: false
SortIncludes: false
SpaceAfterCStyleCast: true
AllowShortCaseLabelsOnASingleLine: false
AllowAllArgumentsOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
BinPackParameters: false
---
77 changes: 77 additions & 0 deletions .github/workflows/build_and_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and run functional tests using ragger

# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation.
# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the
# resulting binaries.
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary.
#
# While this workflow is optional, having functional testing on your application is mandatory and this workflow and
# tooling environment is meant to be easy to use and adapt after forking your application

on:
workflow_dispatch:
push:
pull_request:

jobs:
build_application:
name: Build application
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: "compiled_app_binaries"

ragger_tests:
name: Run ragger tests
needs: build_application
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
download_app_binaries_artifact: "compiled_app_binaries"
test_dir: tests

job_e2e_tests:
name: E2E tests
needs: build_application
runs-on: ubuntu-latest
timeout-minutes: 10

container:
image: ghcr.io/ledgerhq/speculos:latest
options: --entrypoint /bin/bash

steps:
- name: Install dependencies
run: apt update && apt install -qy openjdk-17-jdk-headless git

- name: Download app binary
uses: actions/download-artifact@v3
with:
name: "compiled_app_binaries"
path: /tmp/app/build/

- name: Run speculos in the background
run: |
/speculos/speculos.py --display headless --seed "opinion change copy struggle town cigar input kit school patient execute bird bundle option canvas defense hover poverty skill donkey pottery infant sense orchard" /tmp/app/build/nanos/bin/app.elf 2>/tmp/speculos.log &
echo $! >/tmp/speculos.pid

- name: Run tests with Ardor node
run: |
git clone --branch ledger-tests https://sargue@bitbucket.org/sargue/ardor-ledger-test.git /ardor
cd /ardor
./run-unit-tests.sh com.jelurida.ardor.integration.wallet.ledger.application.LedgerSpeculosSuite

- name: Kill speculos
run: kill -9 $(cat /tmp/speculos.pid)

- name: Upload Speculos log
uses: actions/upload-artifact@v3
if: failure()
with:
name: speculos-log
path: /tmp/speculos.log

- name: Upload Ardor log
uses: actions/upload-artifact@v3
if: failure()
with:
name: ardor-log
path: /ardor/logs/ardor.0.log
111 changes: 0 additions & 111 deletions .github/workflows/ci-workflow.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/codeql_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "CodeQL"

on:
workflow_dispatch:
push:
pull_request:
# Excluded path: add the paths you want to ignore instead of deleting the workflow
paths-ignore:
- '.github/workflows/*.yml'
- 'tests/*'

jobs:
analyse:
name: Analyse
strategy:
matrix:
sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_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

- 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
25 changes: 25 additions & 0 deletions .github/workflows/coding_style_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run coding style check through reusable workflow

# This workflow will run linting checks to ensure a level of uniformization among all Ledger applications.
#
# The presence of this workflow is mandatory as a minimal level of linting is required.
# You are however free to modify the content of the .clang-format file and thus the coding style of your application.
# We simply ask you to not diverge too much from the linting of the Boilerplate application.

on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
pull_request:

jobs:
check_linting:
name: Check linting using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_lint.yml@v1
with:
source: './src'
extensions: 'h,c'
version: 11
23 changes: 23 additions & 0 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Ensure compliance with Ledger guidelines

# This workflow is mandatory in all applications
# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team.
# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger
# application store.
#
# More information on the guidelines can be found in the repository:
# LedgerHQ/ledger-app-workflows/

on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
pull_request:

jobs:
guidelines_enforcer:
name: Call Ledger guidelines_enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ bin/
debug/
dep/
obj/
build/
src/glyphs\.c
src/glyphs\.h
usbtool/
src/txnTypeLists.c
.vscode/
output-scan-build/
tests/build/
scan-build/
scan-build/
.history/
tests/__pycache__/
tests/snapshots-tmp/
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright 2019-2020 Haim Bender
Copyright 2021-2023 Jelurida IP B.V.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading
Loading