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 3614cfc..4f1ce25 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 0000000..c83dae5 Binary files /dev/null and b/icons/gpg_40px.gif differ diff --git a/ledger_app.toml b/ledger_app.toml index e557cc8..27f2fad 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -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/" diff --git a/src/gpg_ux_nbgl.c b/src/gpg_ux_nbgl.c index 83dd677..ae47c37 100644 --- a/src/gpg_ux_nbgl.c +++ b/src/gpg_ux_nbgl.c @@ -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" @@ -1243,4 +1243,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)) diff --git a/tests/usage.md b/tests/usage.md index 75e9664..f20bacc 100644 --- a/tests/usage.md +++ b/tests/usage.md @@ -21,7 +21,7 @@ docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest cd 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