From fbc919c6679b3d09bbc615920bdb4635f51bbcc1 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Mon, 24 Jun 2024 16:45:08 +0200 Subject: [PATCH] Port Flex --- .github/workflows/codeql_checks.yml | 2 +- Makefile | 1 + README.md | 1 + doc/user/0001-plist.patch | 3 +++ doc/user/app-openpgp.rst | 6 ++++++ icons/gpg_40px.gif | Bin 0 -> 523 bytes ledger_app.toml | 2 +- src/gpg_ux_nbgl.c | 4 ++-- tests/usage.md | 6 +++--- 9 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 icons/gpg_40px.gif diff --git a/.github/workflows/codeql_checks.yml b/.github/workflows/codeql_checks.yml index fb95064..acbc6b4 100644 --- a/.github/workflows/codeql_checks.yml +++ b/.github/workflows/codeql_checks.yml @@ -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 diff --git a/Makefile b/Makefile index fab4ae8..08ff4f0 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 5c5a959..a773fae 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/user/0001-plist.patch b/doc/user/0001-plist.patch index 73ca1ad..b7935ed 100644 --- a/doc/user/0001-plist.patch +++ b/doc/user/0001-plist.patch @@ -5,6 +5,7 @@ 0x2C97 0x2C97 + 0x2C97 ++ 0x2C97 + 0x2C97 0x17EF 0x17EF @@ -19,6 +20,7 @@ + 0x4009 + 0x5009 + 0x6009 ++ 0x7009 0x6007 0x6055 0x6111 @@ -28,6 +30,7 @@ Ledger Nano X + Ledger Nano S Plus + Ledger Stax ++ Ledger Flex Lenovo Lenovo USB Smartcard Keyboard Lenovo Lenovo USB Smartcard Keyboard Lenovo Lenovo Smartcard Wired Keyboard II diff --git a/doc/user/app-openpgp.rst b/doc/user/app-openpgp.rst index 89a4935..586ed4a 100644 --- a/doc/user/app-openpgp.rst +++ b/doc/user/app-openpgp.rst @@ -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. diff --git a/icons/gpg_40px.gif b/icons/gpg_40px.gif new file mode 100644 index 0000000000000000000000000000000000000000..c83dae59b6635834720725bd1143873be00843cd GIT binary patch literal 523 zcmV+m0`&byNk%w1VJHA70P_F<000051qBWc4jddDGBPq|W@d_ting}4&d$#1>FMD5n0D^(0 zDF6qCgkrK#Bn%%w;Y6e?3N6BnL9HMNpkZ}#5CpWS#W%Pe+Xija0aO?>4ueru@ji?V zFbQ2L2rYg@3Iu0MRR|wbhywuzgEc{w8HrMM3sCpI7f;}r+xlboI*@f7pQbqojx2mUeo2M__3dm!?WaUo_$k0cU$^eB)(0z!Bi z<`wHlk%@%@n~dCv%g8WdMG1l`bnN6pVZ@T>SQ!9?k`Y1xF7K2>Wd&r0StBz%t5<;! zO_j-VKI2J227;p&TatW7=? 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=$_SDK # replace with one of [NANOS, NANOX, NANOSP, STAX] +make clean && make BOLOS_SDK=$_SDK # replace with one of [NANOS, NANOX, NANOSP, STAX, FLEX] exit ``` @@ -45,7 +45,7 @@ docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest cd app-/ 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=$_SDK load # replace with one of [NANOS, NANOX, NANOSP, STAX] +make clean && make BOLOS_SDK=$_SDK load # replace with one of [NANOS, NANOX, NANOSP, STAX, FLEX] exit ``` @@ -73,7 +73,7 @@ Custom pytest options ```shell --full Run full tests - --device Run the test on the specified device [nanos,nanox,nanosp,stax,all]. This parameter is mandatory + --device Run the test on the specified device [nanos,nanox,nanosp,stax,flex,all]. This parameter is mandatory --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