Skip to content

Commit

Permalink
Port Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Jun 25, 2024
1 parent 7707908 commit fbc919c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 7 deletions.
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ICON_NANOS = icons/gpg_16px.gif
ICON_NANOX = icons/gpg_14px.gif
ICON_NANOSP = icons/gpg_14px.gif
ICON_STAX = icons/gpg_32px.gif
ICON_FLEX = icons/gpg_40px.gif

# Application allowed derivation curves.
# Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ 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`

### Loading on a physical device

Expand Down
3 changes: 3 additions & 0 deletions doc/user/0001-plist.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<string>0x2C97</string>
<string>0x2C97</string>
+ <string>0x2C97</string>
+ <string>0x2C97</string>
+ <string>0x2C97</string>
<string>0x17EF</string>
<string>0x17EF</string>
Expand All @@ -19,6 +20,7 @@
+ <string>0x4009</string>
+ <string>0x5009</string>
+ <string>0x6009</string>
+ <string>0x7009</string>
<string>0x6007</string>
<string>0x6055</string>
<string>0x6111</string>
Expand All @@ -28,6 +30,7 @@
<string>Ledger Nano X</string>
+ <string>Ledger Nano S Plus</string>
+ <string>Ledger Stax</string>
+ <string>Ledger Flex</string>
<string>Lenovo Lenovo USB Smartcard Keyboard</string>
<string>Lenovo Lenovo USB Smartcard Keyboard</string>
<string>Lenovo Lenovo Smartcard Wired Keyboard II</string>
6 changes: 6 additions & 0 deletions doc/user/app-openpgp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ Thus, you must ensure (or add):
- ifdProductID: 0x6009
- ifdFriendlyName: Ledger Stax

- for Flex:

- ifdVendorID: 0x2C97
- ifdProductID: 0x7009
- ifdFriendlyName: Ledger Flex

Notes:

- The 3 entry nodes must be added for each device. It can be easier to add new ones at the end of each list.
Expand Down
Binary file added icons/gpg_40px.gif
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", "nanos+", "stax"]
devices = ["nanos", "nanox", "nanos+", "stax", "flex"]

[tests]
unit_directory = "./unit-tests/"
Expand Down
4 changes: 2 additions & 2 deletions src/gpg_ux_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*****************************************************************************/

#include "bolos_target.h"
#if defined(HAVE_NBGL) && defined(TARGET_STAX)
#if defined(HAVE_NBGL) && (defined(TARGET_STAX) || defined(TARGET_FLEX))

#include "os.h"
#include "glyphs.h"
Expand Down Expand Up @@ -1240,4 +1240,4 @@ void ui_menu_uifconfirm_display(unsigned int value) {
nbgl_useCaseChoice(NULL, "Confirm operation", G_gpg_vstate.menu, "Yes", "No", uif_confirm_cb);
}

#endif // defined(HAVE_NBGL) && defined(TARGET_STAX)
#endif // defined(HAVE_NBGL) && (defined(TARGET_STAX) || defined(TARGET_FLEX))
6 changes: 3 additions & 3 deletions tests/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
cd <your app repository>

docker run --user "$(id -u)":"$(id -g)" --rm -ti -v "$(realpath .):/app" --privileged -v "/dev/bus/usb:/dev/bus/usb" ledger-app-builder-lite:latest
make clean && make BOLOS_SDK=$<device>_SDK # replace <device> with one of [NANOS, NANOX, NANOSP, STAX]
make clean && make BOLOS_SDK=$<device>_SDK # replace <device> with one of [NANOS, NANOX, NANOSP, STAX, FLEX]
exit
```

Expand All @@ -45,7 +45,7 @@ docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
cd app-<appname>/

docker run --user "$(id -u)":"$(id -g)" --rm -ti -v "$(realpath .):/app" --privileged -v "/dev/bus/usb:/dev/bus/usb" ledger-app-builder-lite:latest
make clean && make BOLOS_SDK=$<device>_SDK load # replace <device> with one of [NANOS, NANOX, NANOSP, STAX]
make clean && make BOLOS_SDK=$<device>_SDK load # replace <device> with one of [NANOS, NANOX, NANOSP, STAX, FLEX]
exit
```

Expand Down Expand Up @@ -73,7 +73,7 @@ Custom pytest options
```shell
--full Run full tests
--device <device> Run the test on the specified device [nanos,nanox,nanosp,stax,all]. This parameter is mandatory
--device <device> Run the test on the specified device [nanos,nanox,nanosp,stax,flex,all]. This parameter is mandatory
--backend <backend> Run the tests against the backend [speculos, ledgercomm, ledgerwallet]. Speculos is the default
--display On Speculos, enables the display of the app screen using QT
--golden_run Pn Speculos, screen comparison functions will save the current screen instead of comparing
Expand Down

0 comments on commit fbc919c

Please sign in to comment.