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

upgrade to v1.2.0 #35

Merged
merged 33 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
62126f8
[tests]: make check signature func work
libotony May 22, 2023
10641ef
[UI]: improve certificate display info for NanoS/SP/X
libotony May 22, 2023
2c2c416
[Crypto]: use builtin blake2b function
libotony May 23, 2023
e2c1e09
[Sign Message]: display the full content's hash on screen
libotony May 24, 2023
a3c38b4
[UI]: update wording on STAX
libotony May 25, 2023
82fe24a
[tests]: add some random generated test cases
libotony May 26, 2023
93a95f4
add test
LucaGenoni Apr 22, 2024
f3f1518
add screenshots
LucaGenoni Apr 22, 2024
0f75a1e
fix screenshot
LucaGenoni Apr 22, 2024
7eeb5a4
add readme
LucaGenoni Apr 22, 2024
b2b331f
printf messageHash
LucaGenoni Apr 24, 2024
1684796
fix all deprecated in main
LucaGenoni Apr 24, 2024
90fe747
fix deprecated vetUtils
LucaGenoni Apr 24, 2024
762d92a
change to cx_ecdsa_sign_rs_no_throw
LucaGenoni Apr 24, 2024
cccce27
add a second test with parity odd
LucaGenoni Apr 24, 2024
7359ed7
add screenshots and small fix to parity odd
LucaGenoni Apr 24, 2024
df98177
Merge branch 'develop' into tonyPRs
LucaGenoni Apr 29, 2024
fa05d90
fix stax tests
LucaGenoni Apr 29, 2024
576e605
Merge branch 'tonyPRs' into test-long-tx
LucaGenoni Apr 29, 2024
5b40795
Merge branch 'test-long-tx' into remove-deprecated
LucaGenoni Apr 29, 2024
2b82f8e
remove deprecated functions used in tonyPRs
LucaGenoni Apr 29, 2024
1afa8b3
Merge branch 'remove-deprecated' into sign_rs
LucaGenoni Apr 29, 2024
eb23edb
set default contract data on
LucaGenoni Apr 29, 2024
c20917b
Merge pull request #4 from vechain/sign_rs
LucaGenoni Apr 29, 2024
0cfde9b
set both default setting to yes
LucaGenoni May 9, 2024
e19d7e0
set both setting to yes and fix tests
LucaGenoni May 9, 2024
560e5a9
update version, fix multiclause settings Yes bug
LucaGenoni May 13, 2024
bff2ebe
use cx_keccak_256_hash and CX_ASSERT
LucaGenoni May 20, 2024
8055814
fix VET-02 severity HIGH
LucaGenoni Jun 5, 2024
1054acd
fix weakness: magic numbers
LucaGenoni Jun 5, 2024
b1aa9bf
fix weakness: add comments, docs, and deps
LucaGenoni Jun 6, 2024
50f4fb6
fix low vulnerability for pointer dimensions +
LucaGenoni Jun 11, 2024
f521fc2
Abstract the parseBip32Path for better readability
LucaGenoni Jun 11, 2024
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
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "deps/nanos-secure-sdk"]
path = deps/nanos-secure-sdk
url = https://github.com/LedgerHQ/nanos-secure-sdk.git
[submodule "deps/nanosplus-secure-sdk"]
path = deps/nanosplus-secure-sdk
url = https://github.com/LedgerHQ/nanosplus-secure-sdk.git
[submodule "deps/nanox-secure-sdk"]
path = deps/nanox-secure-sdk
url = https://github.com/LedgerHQ/nanox-secure-sdk.git
[submodule "deps/stax-secure-sdk"]
path = deps/stax-secure-sdk
url = https://github.com/LedgerHQ/ledger-secure-sdk
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)

APPNAME = "VeChain"
APPVERSION_M = 1
APPVERSION_N = 1
APPVERSION_P = 1
APPVERSION_N = 2
APPVERSION_P = 0
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

ifeq ($(TARGET_NAME),TARGET_NANOS)
Expand Down Expand Up @@ -111,7 +111,7 @@ include $(BOLOS_SDK)/Makefile.glyphs
APP_SOURCE_PATH += src
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl

APP_SOURCE_PATH += common blake2
APP_SOURCE_PATH += common
SDK_SOURCE_PATH += lib_u2f


Expand Down
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,85 @@
# ledger-app-vet
VeChain wallet application framework for Ledger Nano S/SP/X and Stax


## Quick start guide
Follow the steps of [Quick start guide of app-boilerplate](https://github.com/LedgerHQ/app-boilerplate?tab=readme-ov-file#quick-start-guide) reported below just for the sake of completeness.

### With VSCode

You can quickly setup a convenient environment to build and test your application by using [Ledger's VSCode developer tools extension](https://marketplace.visualstudio.com/items?itemName=LedgerHQ.ledger-dev-tools) which leverages the [ledger-app-dev-tools](https://github.com/LedgerHQ/ledger-app-builder/pkgs/container/ledger-app-builder%2Fledger-app-dev-tools) docker image.

It will allow you, whether you are developing on macOS, Windows or Linux to quickly **build** your apps, **test** them on **Speculos** and **load** them on any supported device.

* Install and run [Docker](https://www.docker.com/products/docker-desktop/).
* Make sure you have an X11 server running :
* On Ubuntu Linux, it should be running by default.
* On macOS, install and launch [XQuartz](https://www.xquartz.org/) (make sure to go to XQuartz > Preferences > Security and check "Allow client connections").
* On Windows, install and launch [VcXsrv](https://sourceforge.net/projects/vcxsrv/) (make sure to configure it to disable access control).
* Install [VScode](https://code.visualstudio.com/download) and add [Ledger's extension](https://marketplace.visualstudio.com/items?itemName=LedgerHQ.ledger-dev-tools).
* Open a terminal and clone `app-boilerplate` with `git clone [email protected]:LedgerHQ/app-boilerplate.git`.
* Open the `app-boilerplate` folder with VSCode.
* Use Ledger extension's sidebar menu or open the tasks menu with `ctrl + shift + b` (`command + shift + b` on a Mac) to conveniently execute actions :
* Build the app for the device model of your choice with `Build`.
* Test your binary on [Speculos](https://github.com/LedgerHQ/speculos) with `Run with Speculos`.
* You can also run functional tests, load the app on a physical device, and more.

:information_source: The terminal tab of VSCode will show you what commands the extension runs behind the scene.

### With a terminal

The [ledger-app-dev-tools](https://github.com/LedgerHQ/ledger-app-builder/pkgs/container/ledger-app-builder%2Fledger-app-dev-tools) docker image contains all the required tools and libraries to **build**, **test** and **load** an application.

You can download it from the ghcr.io docker repository:

```shell
sudo docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
```

You can then enter this development environment by executing the following command from the directory of the application `git` repository:

**Linux (Ubuntu)**

```shell
sudo docker run --rm -ti --user "$(id -u):$(id -g)" --privileged -v "/dev/bus/usb:/dev/bus/usb" -v "$(realpath .):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
```

**macOS**

```shell
sudo docker run --rm -ti --user "$(id -u):$(id -g)" --privileged -v "$(pwd -P):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
```

**Windows (with PowerShell)**

```shell
docker run --rm -ti --privileged -v "$(Get-Location):/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
```

The application's code will be available from inside the docker container, you can proceed to the following compilation steps to build your app.


## Building and testing the application
### With VsCode
Supposing you have followed the steps of the previous section with VSCode, you can now build and test the application with ease thanks to the Ledger extension.
The steps should be:
1. `Docker Container > Update container`
2. `Select target` for the desired target.
3. `Build > Build` to build the application and `app.elf` file (used by Speculos).
4. `Functional Tests > Run tests` to test the application

### With Speculos
Manually run with [Speculos](https://github.com/LedgerHQ/speculos). Once you have the Speculos installed, you can run the application with the following command:
- Run the server specifying the port, the model, and the app
```shell
/speculos$ ./speculos.py --api-port 5000 --model nanos --display headless <app-vechain-location>/build/nanos/bin/app.elf
```
- Visit [local website](http://127.0.0.1:5000/) to test and send apdu codes.

It's possible to generate the transaction and the APDU codes for the transaction by running `tests/generatetx.py` script with desired args or directly changing the body of the transaction there.

If you encounter any issue with APDU codes generated by `tests/generatetx.py` try by extracting APDU codes from the test suite.
1. Get the hex of transaction.
2. To generate the APDU codes, you can change the transaction in the test `tests/test_sign_tx_long_cmd.py` and run the test.
3. The test should fail for a wrong signature. This is normal because different transaction should have different blake2 message hash and consequentially different signature.
4. Given that the test failed, you can extract the APDU codes from the logs of the failed test.
116 changes: 0 additions & 116 deletions blake2/LICENSE

This file was deleted.

10 changes: 0 additions & 10 deletions blake2/README.md

This file was deleted.

Loading
Loading