From 778be97040a031f4bd374377478ab6610ea0d7e3 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 08:31:11 +0200 Subject: [PATCH 01/13] Remove Nano S and associated src, test, bagl... --- Makefile | 10 +- README.md | 6 +- .../src/ledger_app_clients/ethereum/client.py | 4 +- .../ledger_app_clients/ethereum/settings.py | 11 +- icons/nanos_app_chain_1.gif | Bin 1125 -> 0 bytes icons/nanos_app_chain_108.gif | Bin 87 -> 0 bytes icons/nanos_app_chain_1284.gif | Bin 108 -> 0 bytes icons/nanos_app_chain_1285.gif | Bin 80 -> 0 bytes icons/nanos_app_chain_1313114.gif | Bin 1128 -> 0 bytes icons/nanos_app_chain_1620.gif | Bin 1129 -> 0 bytes icons/nanos_app_chain_1666600000.gif | Bin 87 -> 0 bytes icons/nanos_app_chain_19.gif | Bin 73 -> 0 bytes icons/nanos_app_chain_1987.gif | Bin 64 -> 0 bytes icons/nanos_app_chain_2.gif | Bin 1134 -> 0 bytes icons/nanos_app_chain_200625.gif | Bin 1134 -> 0 bytes icons/nanos_app_chain_20531812.gif | Bin 1124 -> 0 bytes icons/nanos_app_chain_237.gif | Bin 75 -> 0 bytes icons/nanos_app_chain_24484.gif | Bin 61 -> 0 bytes icons/nanos_app_chain_246.gif | Bin 1131 -> 0 bytes icons/nanos_app_chain_246529.gif | Bin 73 -> 0 bytes icons/nanos_app_chain_248.gif | Bin 107 -> 0 bytes icons/nanos_app_chain_269.gif | Bin 79 -> 0 bytes icons/nanos_app_chain_2894.gif | Bin 1134 -> 0 bytes icons/nanos_app_chain_30.gif | Bin 1128 -> 0 bytes icons/nanos_app_chain_31.gif | Bin 67 -> 0 bytes icons/nanos_app_chain_31102.gif | Bin 1129 -> 0 bytes icons/nanos_app_chain_3125659152.gif | Bin 1131 -> 0 bytes icons/nanos_app_chain_336.gif | Bin 95 -> 0 bytes icons/nanos_app_chain_4689.gif | Bin 1178 -> 0 bytes icons/nanos_app_chain_50.gif | Bin 67 -> 0 bytes icons/nanos_app_chain_592.gif | Bin 100 -> 0 bytes icons/nanos_app_chain_60.gif | Bin 1125 -> 0 bytes icons/nanos_app_chain_61.gif | Bin 58 -> 0 bytes icons/nanos_app_chain_64.gif | Bin 1131 -> 0 bytes icons/nanos_app_chain_76.gif | Bin 1135 -> 0 bytes icons/nanos_app_chain_7762959.gif | Bin 1124 -> 0 bytes icons/nanos_app_chain_78.gif | Bin 1212 -> 0 bytes icons/nanos_app_chain_8.gif | Bin 1210 -> 0 bytes icons/nanos_app_chain_820.gif | Bin 1129 -> 0 bytes icons/nanos_app_chain_846000.gif | Bin 75 -> 0 bytes icons/nanos_app_chain_88.gif | Bin 61 -> 0 bytes icons/nanos_app_chain_888.gif | Bin 1133 -> 0 bytes makefile_conf/features.mk | 63 +-- src/shared_context.h | 4 - src_bagl/common_ui.c | 90 ---- src_bagl/ui_flow.c | 343 -------------- src_bagl/ui_flow.h | 51 -- src_bagl/ui_flow_erc20_approval.c | 72 --- src_bagl/ui_flow_getEth2PublicKey.c | 55 --- src_bagl/ui_flow_getPublicKey.c | 48 -- src_bagl/ui_flow_performPrivacyOperation.c | 67 --- src_bagl/ui_flow_signAuthorization7702.c | 61 --- src_bagl/ui_flow_signMessage.c | 142 ------ src_bagl/ui_flow_signMessage712.c | 152 ------ src_bagl/ui_flow_signMessage712_v0.c | 83 ---- src_bagl/ui_flow_signTx.c | 304 ------------ src_bagl/ui_gcs.c | 445 ------------------ src_bagl/ui_plugin.c | 49 -- src_bagl/ui_plugin.h | 6 - src_bagl/ui_trusted_name.c | 17 - src_bagl/ui_trusted_name.h | 12 - .../nanos/test_settings/blind_sign/00000.png | Bin 349 -> 0 bytes .../nanos/test_settings/blind_sign/00001.png | Bin 368 -> 0 bytes .../nanos/test_settings/blind_sign/00002.png | Bin 357 -> 0 bytes .../nanos/test_settings/blind_sign/00003.png | Bin 366 -> 0 bytes .../nanos/test_settings/blind_sign/00004.png | Bin 361 -> 0 bytes .../nanos/test_settings/blind_sign/00005.png | Bin 356 -> 0 bytes .../nanos/test_settings/blind_sign/00006.png | Bin 374 -> 0 bytes .../nanos/test_settings/blind_sign/00007.png | Bin 281 -> 0 bytes .../nanos/test_settings/blind_sign/00008.png | Bin 349 -> 0 bytes .../nanos/test_settings/debug_token/00000.png | Bin 349 -> 0 bytes .../nanos/test_settings/debug_token/00001.png | Bin 368 -> 0 bytes .../nanos/test_settings/debug_token/00002.png | Bin 357 -> 0 bytes .../nanos/test_settings/debug_token/00003.png | Bin 366 -> 0 bytes .../nanos/test_settings/debug_token/00004.png | Bin 356 -> 0 bytes .../nanos/test_settings/debug_token/00005.png | Bin 374 -> 0 bytes .../nanos/test_settings/debug_token/00006.png | Bin 364 -> 0 bytes .../nanos/test_settings/debug_token/00007.png | Bin 281 -> 0 bytes .../nanos/test_settings/debug_token/00008.png | Bin 349 -> 0 bytes .../test_settings/eip712_token/00000.png | Bin 349 -> 0 bytes .../test_settings/eip712_token/00001.png | Bin 368 -> 0 bytes .../test_settings/eip712_token/00002.png | Bin 357 -> 0 bytes .../test_settings/eip712_token/00003.png | Bin 366 -> 0 bytes .../test_settings/eip712_token/00004.png | Bin 356 -> 0 bytes .../test_settings/eip712_token/00005.png | Bin 374 -> 0 bytes .../test_settings/eip712_token/00006.png | Bin 281 -> 0 bytes .../test_settings/eip712_token/00007.png | Bin 349 -> 0 bytes .../nanos/test_settings/multiple1/00000.png | Bin 349 -> 0 bytes .../nanos/test_settings/multiple1/00001.png | Bin 368 -> 0 bytes .../nanos/test_settings/multiple1/00002.png | Bin 357 -> 0 bytes .../nanos/test_settings/multiple1/00003.png | Bin 366 -> 0 bytes .../nanos/test_settings/multiple1/00004.png | Bin 361 -> 0 bytes .../nanos/test_settings/multiple1/00005.png | Bin 356 -> 0 bytes .../nanos/test_settings/multiple1/00006.png | Bin 374 -> 0 bytes .../nanos/test_settings/multiple1/00007.png | Bin 364 -> 0 bytes .../nanos/test_settings/multiple1/00008.png | Bin 281 -> 0 bytes .../nanos/test_settings/multiple1/00009.png | Bin 349 -> 0 bytes .../nanos/test_settings/multiple2/00000.png | Bin 349 -> 0 bytes .../nanos/test_settings/multiple2/00001.png | Bin 368 -> 0 bytes .../nanos/test_settings/multiple2/00002.png | Bin 357 -> 0 bytes .../nanos/test_settings/multiple2/00003.png | Bin 366 -> 0 bytes .../nanos/test_settings/multiple2/00004.png | Bin 361 -> 0 bytes .../nanos/test_settings/multiple2/00005.png | Bin 356 -> 0 bytes .../nanos/test_settings/multiple2/00006.png | Bin 374 -> 0 bytes .../nanos/test_settings/multiple2/00007.png | Bin 281 -> 0 bytes .../nanos/test_settings/multiple2/00008.png | Bin 349 -> 0 bytes .../nanos/test_settings/nonce/00000.png | Bin 349 -> 0 bytes .../nanos/test_settings/nonce/00001.png | Bin 368 -> 0 bytes .../nanos/test_settings/nonce/00002.png | Bin 357 -> 0 bytes .../nanos/test_settings/nonce/00003.png | Bin 366 -> 0 bytes .../nanos/test_settings/nonce/00004.png | Bin 356 -> 0 bytes .../nanos/test_settings/nonce/00005.png | Bin 350 -> 0 bytes .../nanos/test_settings/nonce/00006.png | Bin 374 -> 0 bytes .../nanos/test_settings/nonce/00007.png | Bin 281 -> 0 bytes .../nanos/test_settings/nonce/00008.png | Bin 349 -> 0 bytes .../test_settings/trusted_name/00000.png | Bin 349 -> 0 bytes .../test_settings/trusted_name/00001.png | Bin 368 -> 0 bytes .../test_settings/trusted_name/00002.png | Bin 357 -> 0 bytes .../test_settings/trusted_name/00003.png | Bin 366 -> 0 bytes .../test_settings/trusted_name/00004.png | Bin 356 -> 0 bytes .../test_settings/trusted_name/00005.png | Bin 374 -> 0 bytes .../test_settings/trusted_name/00006.png | Bin 281 -> 0 bytes .../test_settings/trusted_name/00007.png | Bin 349 -> 0 bytes tests/ragger/test_blind_sign.py | 21 +- tests/ragger/test_eip191.py | 8 +- tests/ragger/test_eip712.py | 25 +- tests/ragger/test_eip7702.py | 20 +- tests/ragger/test_gcs.py | 32 +- tests/ragger/test_get_address.py | 8 +- tests/ragger/test_nft.py | 3 - tests/ragger/test_sign.py | 5 +- tests/ragger/test_trusted_name.py | 57 +-- tests/ragger/test_tx_simulation.py | 3 +- tests/ragger/usage.md | 6 +- tools/copy_clones.sh | 2 +- 135 files changed, 79 insertions(+), 2206 deletions(-) delete mode 100644 icons/nanos_app_chain_1.gif delete mode 100644 icons/nanos_app_chain_108.gif delete mode 100644 icons/nanos_app_chain_1284.gif delete mode 100644 icons/nanos_app_chain_1285.gif delete mode 100644 icons/nanos_app_chain_1313114.gif delete mode 100644 icons/nanos_app_chain_1620.gif delete mode 100644 icons/nanos_app_chain_1666600000.gif delete mode 100644 icons/nanos_app_chain_19.gif delete mode 100644 icons/nanos_app_chain_1987.gif delete mode 100644 icons/nanos_app_chain_2.gif delete mode 100644 icons/nanos_app_chain_200625.gif delete mode 100644 icons/nanos_app_chain_20531812.gif delete mode 100644 icons/nanos_app_chain_237.gif delete mode 100644 icons/nanos_app_chain_24484.gif delete mode 100644 icons/nanos_app_chain_246.gif delete mode 100644 icons/nanos_app_chain_246529.gif delete mode 100644 icons/nanos_app_chain_248.gif delete mode 100644 icons/nanos_app_chain_269.gif delete mode 100644 icons/nanos_app_chain_2894.gif delete mode 100644 icons/nanos_app_chain_30.gif delete mode 100644 icons/nanos_app_chain_31.gif delete mode 100644 icons/nanos_app_chain_31102.gif delete mode 100644 icons/nanos_app_chain_3125659152.gif delete mode 100644 icons/nanos_app_chain_336.gif delete mode 100644 icons/nanos_app_chain_4689.gif delete mode 100644 icons/nanos_app_chain_50.gif delete mode 100644 icons/nanos_app_chain_592.gif delete mode 100644 icons/nanos_app_chain_60.gif delete mode 100644 icons/nanos_app_chain_61.gif delete mode 100644 icons/nanos_app_chain_64.gif delete mode 100644 icons/nanos_app_chain_76.gif delete mode 100644 icons/nanos_app_chain_7762959.gif delete mode 100644 icons/nanos_app_chain_78.gif delete mode 100644 icons/nanos_app_chain_8.gif delete mode 100644 icons/nanos_app_chain_820.gif delete mode 100644 icons/nanos_app_chain_846000.gif delete mode 100644 icons/nanos_app_chain_88.gif delete mode 100644 icons/nanos_app_chain_888.gif delete mode 100644 src_bagl/common_ui.c delete mode 100644 src_bagl/ui_flow.c delete mode 100644 src_bagl/ui_flow.h delete mode 100644 src_bagl/ui_flow_erc20_approval.c delete mode 100644 src_bagl/ui_flow_getEth2PublicKey.c delete mode 100644 src_bagl/ui_flow_getPublicKey.c delete mode 100644 src_bagl/ui_flow_performPrivacyOperation.c delete mode 100644 src_bagl/ui_flow_signAuthorization7702.c delete mode 100644 src_bagl/ui_flow_signMessage.c delete mode 100644 src_bagl/ui_flow_signMessage712.c delete mode 100644 src_bagl/ui_flow_signMessage712_v0.c delete mode 100644 src_bagl/ui_flow_signTx.c delete mode 100644 src_bagl/ui_gcs.c delete mode 100644 src_bagl/ui_plugin.c delete mode 100644 src_bagl/ui_plugin.h delete mode 100644 src_bagl/ui_trusted_name.c delete mode 100644 src_bagl/ui_trusted_name.h delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00007.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/blind_sign/00008.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00007.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/debug_token/00008.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/eip712_token/00007.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00007.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00008.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple1/00009.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00007.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/multiple2/00008.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00007.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/nonce/00008.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00000.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00001.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00002.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00003.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00004.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00005.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00006.png delete mode 100644 tests/ragger/snapshots/nanos/test_settings/trusted_name/00007.png diff --git a/Makefile b/Makefile index 678282d3eb..b4433cd864 100644 --- a/Makefile +++ b/Makefile @@ -41,12 +41,7 @@ APPVERSION_P = 0 APPVERSION = $(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)-dev # Application source files -APP_SOURCE_PATH += src src_features src_plugins -ifeq ($(TARGET_NAME),TARGET_NANOS) - APP_SOURCE_PATH += src_bagl -else - APP_SOURCE_PATH += src_nbgl -endif +APP_SOURCE_PATH += src src_features src_plugins src_nbgl APP_SOURCE_FILES += $(filter-out ./ethereum-plugin-sdk/src/main.c, $(wildcard ./ethereum-plugin-sdk/src/*.c)) INCLUDES_PATH += ./ethereum-plugin-sdk/src @@ -62,7 +57,6 @@ endif # Application icons following guidelines: # https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon -ICON_NANOS = icons/nanos_app_chain_$(CHAIN_ID).gif ICON_NANOX = icons/nanox_app_chain_$(CHAIN_ID).gif ICON_NANOSP = icons/nanox_app_chain_$(CHAIN_ID).gif ICON_STAX = icons/stax_app_chain_$(CHAIN_ID).gif @@ -132,9 +126,7 @@ endif ENABLE_BLUETOOTH = 1 ENABLE_SWAP = 1 #ENABLE_NFC = 1 -ifneq ($(TARGET_NAME),TARGET_NANOS) ENABLE_NBGL_FOR_NANO_DEVICES = 1 -endif ######################################## # NBGL custom features # diff --git a/README.md b/README.md index 14d991c11a..1621f0d903 100644 --- a/README.md +++ b/README.md @@ -224,10 +224,10 @@ pip install -r tests/ragger/requirements.txt Then you can: -Run the functional tests (here for nanos but available for any device once you have built the binaries): +Run the functional tests (here for flex but available for any device once you have built the binaries): ```shell -pytest tests/ragger/ --tb=short -v --device nanos +pytest tests/ragger/ --tb=short -v --device flex ``` Please see the corresponding ducomentation [USAGE](tests/ragger/usage.md) @@ -235,7 +235,7 @@ Please see the corresponding ducomentation [USAGE](tests/ragger/usage.md) Or run your app directly with Speculos ```shell -speculos --model nanos build/nanos/bin/app.elf +speculos build/flex/bin/app.elf ``` #### macOS / Windows diff --git a/client/src/ledger_app_clients/ethereum/client.py b/client/src/ledger_app_clients/ethereum/client.py index 773585fe66..5d2dc310bb 100644 --- a/client/src/ledger_app_clients/ethereum/client.py +++ b/client/src/ledger_app_clients/ethereum/client.py @@ -100,9 +100,7 @@ def __init__(self, client: BackendInterface): self._firmware = client.firmware self._cmd_builder = CommandBuilder() self._pki_client: Optional[PKIClient] = None - if self._firmware != Firmware.NANOS: - # LedgerPKI not supported on Nanos - self._pki_client = PKIClient(self._client) + self._pki_client = PKIClient(self._client) def _exchange_async(self, payload: bytes): return self._client.exchange_async_raw(payload) diff --git a/client/src/ledger_app_clients/ethereum/settings.py b/client/src/ledger_app_clients/ethereum/settings.py index 21dc79f822..258dd43a1f 100644 --- a/client/src/ledger_app_clients/ethereum/settings.py +++ b/client/src/ledger_app_clients/ethereum/settings.py @@ -16,12 +16,6 @@ class SettingID(Enum): def get_device_settings(firmware: Firmware) -> list[SettingID]: """Get the list of settings available on the device""" - if firmware == Firmware.NANOS: - return [ - SettingID.BLIND_SIGNING, - SettingID.NONCE, - SettingID.DEBUG_DATA, - ] if firmware.is_nano: return [ SettingID.BLIND_SIGNING, @@ -95,10 +89,7 @@ def get_settings_moves(firmware: Firmware, settings = get_device_settings(firmware) # Assume the app is on the 1st page of Settings if firmware.is_nano: - moves += [NavInsID.RIGHT_CLICK] - if firmware == Firmware.NANOS: - moves += [NavInsID.RIGHT_CLICK] - moves += [NavInsID.BOTH_CLICK] + moves += [NavInsID.RIGHT_CLICK, NavInsID.BOTH_CLICK] for setting in settings: if setting in to_toggle: moves += [NavInsID.BOTH_CLICK] diff --git a/icons/nanos_app_chain_1.gif b/icons/nanos_app_chain_1.gif deleted file mode 100644 index 8f8fa310bac0bf66875ff867705033cf5c9331ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1125 zcmZ?wbhEHb6krfwXkcLY|NlP&1B2p!?g-xi1((Eh+i z#(Mch>H3D2mX`VkM*2oZx|Z5PB_f>IEf;+ybD@E~!PCWvMA{Mftf3V2@j6VsVS1 zi=~sRi7RgNpn6lVxCN@$5vN=9fsWA!MK4lx!-Rlo2*iXZULXga{8RIQX}$=UxEcTd z`}^njub)4@fBX97^QVs=-oJbM=Jl(WFP=Yp`sDGWhY#-GyL;#Mt(!NlU%Ptc@}-Lx z&YwGb=JctPCypOGdgSn-g9rBS+q-A?uAMu!Z`-%OrteG>WPn$Yr@}!9q`ulo&y1P0%+S^)NnwuIM>g#H2s;eq1%F9Yiii-*h z^7C?Yva>QX($i8?l9Lh>;^SgtqN5@s!oxyCf`bAB{QZ1=yuCa<+}&JVoShsU?CorA ztgS39%*{+qjExKp^!0Rgw6!!f)YVi~l$8_}jEB+I7E=o--Nlj5G&n(GMaQE~LV9)_cf|M~ZDfaZQ mJpGn&QAyD}DPKQ{jQu(C%1#S{rg>Bq>3+5QB&gM%`%*{=-HPACL z1wjTKkZO=V1}4=W-j&A}?!Phl;?lB5M=Q1)_ F0|3nABh3H+ diff --git a/icons/nanos_app_chain_1285.gif b/icons/nanos_app_chain_1285.gif deleted file mode 100644 index 0f7d89aa45d0726442685ff4caf09d9ab1468186..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80 zcmZ?wbhEHb6krfw_`t{j1poj4SNzGszyW0HfcPL81}60$-j&A}?!Phl;?lB5MWv~VSvo#xR diff --git a/icons/nanos_app_chain_1313114.gif b/icons/nanos_app_chain_1313114.gif deleted file mode 100644 index 0acfb1e127e405ed11606fa1e5ef3fd44b125d42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1128 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdy!!qw8y+|tPjsLRmR!pYp#$jQ;k%*oNz z)X>e)45rs5Ke;qFHLnDwHwB^B5vN{Ig2*iZ+U$~Alv$RV;#QQOs{r=6RVHq?nBz1L zsy79RVB%){|L^ag-@ktT`2Owd zm(QO*et7@x?VH!HUcPw#?CF!oj~+g_fA8*{+qZ7sxPI;GmCKhdUO0d5?3vT2PM$b^ z?C6ohhYlXtzi;oJ-Me<~*uHJ+md%?sZdku=?V8oAR<2mSZ0VB4ixw`JKX2}w*|TQO zm_BXll*yAOPU!FJ?dk67>}YRmZE0?5Y^blRt*Nf6tSB!lEh#Q4EXdEx&B@Nn%t%j5 zO-W8lOo)$*jfswmj0g`44G9hk4Dk2!_3`%d^l*1`b#Zobbg;LxwXwFcv@ka_H8D0a zG|<=6)zQ|{)KFJbRZ&(_RFIdGm64W`ln@sa6%iH^6yWFM<>BVy|kJ$?de~6`Ypqq#(6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdOQ%-Gb_($Ue}(bdq<)xyHk$;{H#)!D_! z)YRD2(Fms3B|o_|H#M&WrZ)wl*9oUyP=d%U0NU)5T9jFqn&MWJpQ`}&xK$=@w^-mb z52`l>w_7Z6>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)m9c=D}yxvFq)13 diff --git a/icons/nanos_app_chain_1666600000.gif b/icons/nanos_app_chain_1666600000.gif deleted file mode 100644 index 6e4e96d16e967ecc97c772d6f57724d524585013..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87 zcmZ?wbhEHb6krfwXkY+=|Ns9h{$v3&bwDIYhJi`1r@!(*!&{z|qHEF_eSyEe*3P|_ isj>wsvG2m_ORPyfo(ZyD}%HrgdewtW3GC+EVl(B$yC P>ngnqSdJGmGFSruU0xO@ diff --git a/icons/nanos_app_chain_2.gif b/icons/nanos_app_chain_2.gif deleted file mode 100644 index 5cff1ed1a5aef48bb4ac344dc5440c0d4f1bea6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1134 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdFS*vQnv+}PaB($LV*)!f3#z{JJL$w_A*G>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)K@1Gm E0F!2qIRF3v diff --git a/icons/nanos_app_chain_200625.gif b/icons/nanos_app_chain_200625.gif deleted file mode 100644 index 1ea56c56153600dd1bbcbd1537e250302c77d88c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1134 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md#f#l^(L+1%0G$<)x$)xyHk$;{H#)!D_! z)YRD2(Fms3B|o_|H#M&WrZ)wl*8-|M!9x%-p0TVal z|9^k~{QmXx$MeX-RQW zVL^UgZccVqW=48iYD#iaVnTdeY)o`iWJGvaXh?8SV1U1$uaCEvr-!?ntBbRfql3Mj zt&O#nrG>efsfn?Xp@F`hu8y{rriQwjs*19bqJq4ftc!t(`y-Ix&*Aebr(0jzZWW>;nFRc#UHgP PICa--t*d3R3=Gx)z{idr diff --git a/icons/nanos_app_chain_20531812.gif b/icons/nanos_app_chain_20531812.gif deleted file mode 100644 index 8f94d1db8668d44eb9792183ff12f7d28825591d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1124 zcmZ?wbhEHb6krfw_`t{j1poj4SNzEWVlgQG=dQ>tP)JEENd(gW?JEirle1Gx6p~WY zGxKbf-tXS8q>!0ns}yePYv5bpoSKp8QB{;0T;&&%T$P<{nWAKGr(jcI1=O2clBiIT zo0C^;Rbi`?n3A8AY6WEHrj{h?D=C0glw{i~If5h3^Q z^-@z3jgpMh5|eclj0}tn^$mf@T-VUt%E;Kt&{6>clz`S1rKDK}xwt`X1M+N@GD=Dc ztn~HE%k|2Q_413-^$jg8E%gnI^o@*kfeLhsEAxOJ)Xghah8f_JTAW;zSx}OhpQiva zFfl2=wB*07640#>PvjQBjm<081A9m>IX_pwBC$Z1t|uF zOmRt2D#Eo`6&Ht87NqJ2r55Lx7A2aDv3%LmC5sm=Trhv$+&Qyn&73iP+SDnNCrzBt z-`CsI-PPIA-qzaE+|<}mUsqdGT~%38URGLCTvS+)pO>4Hot2r9o|c-DoRpXl9~T=F z9Tgc79u^uB926Mf@8|2|?d9p=?&j*^?BwWRZ)a;`ZDna;Zf0s?Y-DJlucxb{t);1< zuBNJ@tfZ(QFDEM_EhQ--E+#4>EF>tv&&SKd&CSKh!Oq6Y!psCLCv-sN1E|noU{dJm nUwQhj07J=!bD_z5G@?5*=Re9-(3~~p)snRb_kOw~#$XKqcgB+7 diff --git a/icons/nanos_app_chain_237.gif b/icons/nanos_app_chain_237.gif deleted file mode 100644 index e028a0f685050287bdcac2fbd5491b9d6f2255cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 75 zcmZ?wbhEHb6krfw_`t{j1poj4SNzEWVln7|2#^c|lTuIr%F|~B7+P}ANu7j>wsvG2m_N$Pyfo(Z}S@_bt}y-NU{2&%(&3G_sO>@ M7fx-6v-9O7C~? zS5nAKu~iB;^)>JzK!Rz^k&P@n{~ttchUD#*nRY8Q}atCUevQedU8UtV6WS8lAA zUzDzIXlZGwZ(yWvWTXpJp<7&;SCUwvn^&w1Gr=XbIJqdZpd>RtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md>m)Y!?~+}O~?%-PV;)zZnx(%IR`&CJ}{ z&CSrs)flGNB|o_|H#M&WrZ)wl*950tP=d%U0NU)5T9jFqn&MWJpQ`}&xK$=@w;19y z52`l>w_A*G>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)Op6HPajEIq9`rCjxK;UuXW3w^q`J=pE}tyi9v!5RQ* CA0hPs diff --git a/icons/nanos_app_chain_269.gif b/icons/nanos_app_chain_269.gif deleted file mode 100644 index 958c6607f12141fc4434756f4413cd8302b9a36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmZ?wbhEHb6krfw_{abP|Ns97(+r9~SvWu}9S{MMXJAt3>0f#JEyJD0fMZgUrqQ7# Xm5yc;A6(ZB|FL8(%kiQh1_o;Y^I;a1 diff --git a/icons/nanos_app_chain_2894.gif b/icons/nanos_app_chain_2894.gif deleted file mode 100644 index 23e27e94512f595a2c23682ca2522a8db9c436b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1134 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md6f$i>*e$=S`w$e{#TBO4B|o_|H#M&WrZ)wl*9E6uP=d%U0NU)5T9jFqn&MWJpQ`}&xK$=@w>aW7 z52`l>w_BWW>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)ICGr?ErUcAdrTx0=vGetBfeZ}R E0GNf3`~Uy| diff --git a/icons/nanos_app_chain_30.gif b/icons/nanos_app_chain_30.gif deleted file mode 100644 index 9a8693a30e5e745bf2c98208e648092e22f4c177..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1128 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md;!)Wyie(%j6z+||&~)xyc#%*?{b#L>{$ z(ACV**aD{4B|o_|H#M&WrZ)wl*8-w_D6`>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)j>wsvG2m_N+Pyfo(YZ-WW43~K=-Mc%l#dn7Dv;{9} S+piktZriZN^SU1+gEatph!(T} diff --git a/icons/nanos_app_chain_31102.gif b/icons/nanos_app_chain_31102.gif deleted file mode 100644 index 8e3a9f512d4630bdea0d8237647adee4c389f5ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1129 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdaY$;H6Y*vQGr*x1m})xyc#)yT=w$;`>o z)YQ<;&P=d%U0NU)5T9jFqn&MWJpQ`}&xK$<=x0o7R zxLO*TyE!=leSp<15WOi_+yc>SVSrPwKF~4xpy)-4ZkP}-4S|^O#0%uWlYeR+FwGYM z6F1}ke}Dh{{`K?6_itaneE#(D!~1t{-@JbH^2PIKPoF$~^zgy`dw1{LzIF4)^=ntJ zT)uSi!ufM&&zwGW^2G6DM~@snbnw9beS7!p-nDbb_HA3YY~HkS!}@h=*Q{Q(a>epx zOP4HOv~a=vd2{E?o;7pE^l4M4OrA7xLVsUxPj^>mM|)dqOLJ3WLw#LsO?6deMR{3i zNpVqOL4ICtPIgviMtWLmN^(+SLVR3oOmtLaM0i+eNN`YKfWM!wkGGenhr64ri?frX zgT0-tjkT4fg}IrjiLsHPfxe!uj<%MjhPs-nin5ZTg1nrpjI@-bgt(Zfh_H~L06!lu z4>uPl2Rj=p3o{cV1B2pE7I0yq10q3X2LqE_Pyfo(ZyD}1ez@uoJ}>;DhNS%FPT5UU OXWg3fkh`6g!5RRlC61W@ diff --git a/icons/nanos_app_chain_3125659152.gif b/icons/nanos_app_chain_3125659152.gif deleted file mode 100644 index 852d4d5e7353e772ea52a67e3a29cd6b533e16ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1131 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdCV$koWg!ral^$;r^r)xyHk$;{H#)!D_! z)YRD2(Fms3B|o_|H#M&WrZ)wl*8-w_D6`>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)tum7T!_3zsz-hdQ-oo*%X%JMnMb=)&LKs Bj`IKj diff --git a/icons/nanos_app_chain_336.gif b/icons/nanos_app_chain_336.gif deleted file mode 100644 index c3b91d475f6fe19b06bc9b40d9a087dd6924b3ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95 zcmZ?wbhEHb6krfwXkcLY|NlP&1B2p!Za>$MU}whwS0gP$p8QV diff --git a/icons/nanos_app_chain_4689.gif b/icons/nanos_app_chain_4689.gif deleted file mode 100644 index 4eb701b5c79d14891cf65fc75611782121a784a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1178 zcmZ?wbhEHb6krfwSj51fprGLH?!INqmS4YqUAuPe?%liR&!7MQ|G(mY?g-xi1((E< zL?CTrUr~^loSj;tkd&I9nP;o?e)oPQh0GLNrEpVU1K$GY)Qn7zs-o23D!-8As_bOT z6eW8*1)B=1irj+S)RIJnirk#MVyg;UrNor{q*N;)8zii+qySb@l5MNx2$E0$+3B2L zl&WB=XQrEMXkwvYZmDNzW@2D$rlVkFU}&jtV4-hltZQIsWngAyY7TTh7$^a4D@sYT z3UYCS+6Cmw&$amzVPg@)As; zuP=V3xw&xF#U(+h2=`(&xHzP;AXPsowK%`DC^;3VTp46lft7PnYGO%#QAmD%4lEP{ zGV)9Ei!<^I6pVmQQqb^COwP;$iD-hg`1)FT<`tJD<|U_ky4WfK4bjWYOtCUEakX%D zHFq^PGB-Cgbak_|Fmkalc5}9HadmPuGjxXOb;(aI%}vcKf$2>_=yk)X7nB-u3xGDe zq!wkCrKY$Q<>xAZeQlMA+bzyG&4cPq!R;0ooO<VgsyL#pFrHdENpF4Zz^r@34jvqUEVojbN~+qz}*ri~lcuUorj z^{SOCmM>enWbvYf3+B(8J7@N+nKPzOn>uCkq=^&y`+9r2yE;4C+ge+in;IMH>uPJN zt12tX%Sua%iwXi?qaq{1!$L!Xg8~Em{d|4Ay*xeK z-CSLqog5wP?QCtVtt>6f%}h;lT#wKO%<)l^lKl@t}^UHyC^{b?fqPzhsbVq0*7vvRYu()HP)j85pbq D=ew)T diff --git a/icons/nanos_app_chain_50.gif b/icons/nanos_app_chain_50.gif deleted file mode 100644 index f9d105ac0951972f67cba8144470b5d27e794006..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmZ?wbhEHb6krfw_{abP|G@yrQ2faP7SI8aAbAERk)HmQr{D5FW^Qvz$S*59&EK{t If`P#r0D{F6y#N3J diff --git a/icons/nanos_app_chain_592.gif b/icons/nanos_app_chain_592.gif deleted file mode 100644 index d656968c04da929083d73ee442b276d1ee1ef21b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmZ?wbhEHb6krfwXkcLY|NlP&1B2p!Za>$MU}whwS0g9P7F>dtc!FLRTfpB%kTMH%#&t^k{|b?8-g--GPz88UXNJ9Nz!{ diff --git a/icons/nanos_app_chain_60.gif b/icons/nanos_app_chain_60.gif deleted file mode 100644 index 6542de884e5d8b3a508b42e690baa912b626582b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1125 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdp##n{}{&Cw_7Z5>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)Qbf8nXpvh39?F$QY@xt)!F diff --git a/icons/nanos_app_chain_61.gif b/icons/nanos_app_chain_61.gif deleted file mode 100644 index ecd60cdc6a250dbd7a00cb4f0ee3064d9cec659c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58 zcmZ?wbhEHb6krfwXkcXc|NlP&1A`6_1Nj0B3`~+O{VPwu6_jbZ6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md0d)Y#I+&C=D}$i&dl)xycq%*Dyf+|9_< z&CJNu&;_Q~B|o_|H#M&WrZ)wl*Ab^)P=d%U0NU)5T9jFqn&MWJpQ`}&xK$=@x0vHJ z52`l>w_7Z5>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)6v-9O7C~? zS5nAKu~iB;^)>JzK!Rz^k&P@n{~ttchUD#*nRY8Q}atCUevQedU8UtV6WS8lAA zUzDzIXlZGwZ(yWvWTXpJp<7&;SCUwvn^&w1Gr=XbIJqdZpd>RtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdsn$kox=$<4*U+``b%)xycy$kNit+}Pa6 z&BfHo%>bs?B|o_|H#M&WrZ)wy*VzE4UQmL_Edbi=l3J8mmYU*Ll%J~r_PA9hZnwDL zG!Lpb1*cn_Tyg5v2RcR{6un5%4HE*UArKRuc!3;v@=whJruiaZ;%5B+@9&@AzkdGs z{_X3R&!0Yic>nJ0o7b;izIguZ>66Eg9zM8#@9v%3w{G6Je(ma&%a<-*IDhW!nbW6E zo;ZH&=#j&R4j$OQZ||PnyLRr_zHRH4&6_rESif%Vn$@dTu2{Zo>5|2Z7A}}SZ|F(<6Xm4w6X>Mw4sIRN7sjjN5C@(85DK083$j{5o$mNlr>kh>weniH?el2oDPl2@VPj@b~le@%HlcaCdWcadvWau(z|dv9_|bFgG(b zF*Y(Z(AU$|(bm$`P*+n`QC3n^ke8E{k(QE_5El~_5f%~@;OFDz;pXDxU}s}xVP;}v zU{L(Y0xm3cKqRQ_U|>?|>0f#JE<+>tq$su37d@O$=iYQvyXx7RP_;t*<)Np-zTbM4 HSsAPWS96gg diff --git a/icons/nanos_app_chain_7762959.gif b/icons/nanos_app_chain_7762959.gif deleted file mode 100644 index 34778b215fb8c079973c996461d0797dbf1d23f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1124 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md#m#lqRi)WXr+$w_D6{>eUB2MjsTtNYM=w0;VAl6P|d19C-3i%>$zB`;K7M%r?(Lh`uU@`*{_N?K$B!O9xPR~No!hr=-nf44>XplvE?zi)?(CVz2)%Hf~tIZta@Yt5&X9zHI4|#fug$m_KjsoY}Kx z&X_)J>XgZoCQj(@>+R|8>g;H5Yi((6YHX;ltF5W7s;nq4D=jH5DlEv)%gxEo%FIYl zOHD~mN=%54i;annii`*k3k?Yl3Jmb~^Y!ue^7L?bb9Hfca&)k_v$e6dva~QaGc_?b zGBnWF)78<|($r8_Q&mw`QdE$ala-N{l9Uh^6BQ8_5)|O)h+i z#(Mch>H3D2mX`VkM*2oZxf(^ff>iyW z)Z+ZoqU2Pda%GriVA$ce2&53`8Y};zOkkuW=D6f1m*%GCm3X??DgkBmQZiGlER!tF zEle#8bd62ZjC3tbOw4sH%q=W+lP!!BEiF@05)+M+Vdh}d?`mXf>S*TX;%shWXlUr_ zXlZF~>FR1^>}uiYWZ-IP0@Lf6S6q^qmz)Z-I}>O(RIf8$y;jaesfi`|MIrh5Ij~d^ zkda@KU!0L&pkQREXQZGJo|%`DUtX*UiX(`ZT~doO%TiO^it=+6z=3R)iNyh?rp75| z<|fIyK#!*C8XK4->RMVPrRXME8k;1UrI{vLBw8pz^{0>4Q=VQp$k|0h1$$ z3C{;W4m>BN<^i)$5ip-H{{Q#)&+lJ9e|-P;^~>i^A3wZ*_x8=}S1(^YfA;jr<3|r4 z+`o7C&h1+_Z(P52^~&W-7cZPYclONbQzuUxKX&xU;X?-x?BBO{&+c72cWmFbb<5^W z8#k<9w|33yRV!C4U$%6~;zbJ=%%3-R&g@w;XH1_qb;{&P6DRcd_4agkb#}D3wYD@j zH8#}O)z(y3RaTUjm6jA26&B>@<>q8(WoD$OrKTh&B__nj#l}QOMMi{&g@yzN1qS&0 z`TBT!d3w0Jxw<$zIXc+e+1glJSz4HznVJ|I85-#8>FQ`}X=X%Qf#{U(l;t%soaUJs?xCmxz1<$L>R0A&Zw*4 diff --git a/icons/nanos_app_chain_8.gif b/icons/nanos_app_chain_8.gif deleted file mode 100644 index 2c5a47a70c4bb4174c187971c7701a295a54fe19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1210 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Wn$Y4bCgp1A9m>IX_pwBC$Z$_i>(q+MlU5Z#VXmr$RyFo zBvscuEhSag#4O2J*V4iwQ8y{o($FZy#30esG!bSFHvP^nhAw8t25ydymQIF-uI3iz zE{1MKW^QgqP9|pNP8Kk|o_WP3iFwJXFuOB>c0={L;?-;AT$Gwvl3x^(pPvIu1pyiP zCHch}`2`Bj&Y)N~SJ3cHOwP;$32K5O3gT~<)S}F?)D*X({9FZaNLyuMaRqT90MVa9 zZV2iF9i9{rvI$+t)9jKYjf0 z{@vR*uV1}<@%-7-CyyUJd~pBX-8;8$-Mn%A+SMzUFI~KF{@mF!r%#aDv3%LmC5sm=Trhv$+&Qyn&73iP+SDnN zCrzBt-`CsI-PPIA-qzaE+|<}mUsqdGT~%38URGLCTvS+)pO>4Hot2r9o|c-DoRpXl z9~T=F9Tgc79u^uB926Mf@8|2|?d9p=?&j*^?BwWRZ)a;`ZDna;Zf0s?Y-DJlucxb{ zt);1EF>tv&&SKd&Be*V&c@2Z%*4pRp!kyoT=?jK tNKjeCz$D+(zw-3k2LcTr&KBI<6a9T(%>tz~#nh|_(Zsjh#~m3NtO1ySs-ge@ diff --git a/icons/nanos_app_chain_820.gif b/icons/nanos_app_chain_820.gif deleted file mode 100644 index b48abb8bb4c078d82a6935cc58bca9c4bb574c8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1129 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#md~!(ah1w#MQ~j(a_M))xycb(#^%m+{nPh z#L3Xe$P}j6B|o_|H#M&WrZ)wl*A1s$P=d%U0NU)5T9jFqn&MWJpQ`}&xK$<=w>X-+ z7@NDg0nM{?!|oP{-V`iu0qb=$FuHM;rzL?XHK6wdE)r7qel)OI(T6JzP)>P@7lRz`?jrHHgDRvVg0(bYgVsXxnlXU zrArnsTDV~Tyt#8`&zd=7`n0K2CQq6;p}()Ur@O1OqrI)QrMaoGp}wxRrn;)KqP(oM zq`0WCAU`iRCp#-MBRwrOB{?ZEAwDiPCORrIB0MZKBseHAz~9f;$J@)(!`;o*#o5Wx z!QRf+#@fo#!raW%#MsEtKwnQ+M_Wr%LtRZ(MOjHvL0(Q)Mp{ZzLR?H#L|8~rfS-?- zhntI&gPo0)g_((wfkE*n3%Ib*0g<4xgMmq|r+?+?y$p956;F9&HqX4jQgg=ll&P0J Or+!`ej$4_P!5RQae~xtk diff --git a/icons/nanos_app_chain_846000.gif b/icons/nanos_app_chain_846000.gif deleted file mode 100644 index 1fbb57a16f6c474c46f6c71f94b2e40eedb10038..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 75 zcmZ?wbhEHb6krfw_`t{j1poj4SNzGs0%Gcb2#^c|lTuIr%F}P<89FxUdG`8Bygun0 YCpPKX#m49Ec^*+KFZf*dXJoJj00z+*D*ylh diff --git a/icons/nanos_app_chain_88.gif b/icons/nanos_app_chain_88.gif deleted file mode 100644 index a1124f710f61f1f8dcf3173f2ebf6b835e88fad4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61 zcmZ?wbhEHb6krfwXkcUjg8%>j>wsvG2m_N$Pyfo(XBlLgj1F{*-|G#Nu8lM8JC!!? L=J9QQj11NQ^t=;i diff --git a/icons/nanos_app_chain_888.gif b/icons/nanos_app_chain_888.gif deleted file mode 100644 index d6eb360fc58b5dd9204d6d490307aef0c93e258e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1133 zcmZ?wbhEHb6krfwXkY+=|Ns9h{^ySH4N!1NEJ*~?Hue<-iOJciB??KY>6v-9O7C~? zS5nAKu~iB;^)>JRtPXT0NVp4u-iLDaQ zr4TRV7Ql_oE7k*hM=v=)SHB{$K;KZ$0OTc@LSJ9}N^^7Js*6j4QW5UOYH)E#WkITb zP-=00X;E@2P`NV5ssbzLqSVBa{GyQj{2W*)24v)yucqiS6q^qmz?V9Vygr+M=vuo#mdRhz|zgl)y>k-$nJ0o7b;izIguZ>66Eg9zM8#@9v%3w{G6Je(ma&%a<-*IDhW!nbW6E zo;ZH&=#j&R4j$OQZ||PnyLRr_zHRH4&6_rESif%Vn$@dTu2{Zo>5|2Z7A}}SZ|F(<6Xm4w6X>Mw4sIRN7sjjN5C@(85DK083$j{5o$mNlr>kh>weniH?el2oDPl2@VPj@b~le@%HlcaCdWcadvWau(z|dv9_|bFgG(b zF*Y(Z(AU$|(bm$`P*+n`QC3n^ke8E{k(QE_5El~_5f%~@;OFDz;pXDxU}s}xVP;}v zU{L(Y0xm3cKqRQ_U|>?}>0f#JEyJD8Mx%}mmu{ZRtYmZTi=MiWlYL&+%?+1)t~)X^ GSOWlb$&ph4 diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 44c1d4c5bb..0476f29cce 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -13,33 +13,25 @@ ifneq ($(SET_PLUGIN_TEST_KEY),0) endif # NFTs -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_NFT_SUPPORT - NFT_TEST_KEY ?= 0 - ifneq ($(NFT_TEST_KEY),0) - DEFINES += HAVE_NFT_TEST_KEY - endif - NFT_STAGING_KEY ?= 0 - ifneq ($(NFT_STAGING_KEY),0) - # Key used by the staging backend - DEFINES += HAVE_NFT_STAGING_KEY - endif +DEFINES += HAVE_NFT_SUPPORT +NFT_TEST_KEY ?= 0 +ifneq ($(NFT_TEST_KEY),0) + DEFINES += HAVE_NFT_TEST_KEY +endif +NFT_STAGING_KEY ?= 0 +ifneq ($(NFT_STAGING_KEY),0) + # Key used by the staging backend + DEFINES += HAVE_NFT_STAGING_KEY endif # Dynamic memory allocator -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_DYN_MEM_ALLOC -endif +DEFINES += HAVE_DYN_MEM_ALLOC # EIP-712 -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_EIP712_FULL_SUPPORT -endif +DEFINES += HAVE_EIP712_FULL_SUPPORT -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_ENUM_VALUE - DEFINES += HAVE_GENERIC_TX_PARSER -endif +DEFINES += HAVE_ENUM_VALUE +DEFINES += HAVE_GENERIC_TX_PARSER # CryptoAssetsList key CAL_TEST_KEY ?= 0 @@ -54,35 +46,28 @@ ifneq ($(CAL_STAGING_KEY),0) endif # ENS -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_TRUSTED_NAME - TRUSTED_NAME_TEST_KEY ?= 0 - ifneq ($(TRUSTED_NAME_TEST_KEY),0) - DEFINES += HAVE_TRUSTED_NAME_TEST_KEY - endif +DEFINES += HAVE_TRUSTED_NAME +TRUSTED_NAME_TEST_KEY ?= 0 +ifneq ($(TRUSTED_NAME_TEST_KEY),0) + DEFINES += HAVE_TRUSTED_NAME_TEST_KEY endif # Dynamic networks -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_DYNAMIC_NETWORKS -endif +DEFINES += HAVE_DYNAMIC_NETWORKS -# Web3 Checks +# Transaction Checks # TODO: remove this check once the web3 checks are implemented on all targets -# ifneq ($(TARGET_NAME),TARGET_NANOS) ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX)) DEFINES += HAVE_WEB3_CHECKS endif # EIP 7702 -ifneq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_EIP7702 - DEFINES += HAVE_EIP7702_WHITELIST +DEFINES += HAVE_EIP7702 +DEFINES += HAVE_EIP7702_WHITELIST - EIP7702_TEST_WHITELIST ?= 0 - ifneq ($(EIP7702_TEST_WHITELIST),0) - DEFINES += HAVE_EIP7702_WHITELIST_TEST - endif +EIP7702_TEST_WHITELIST ?= 0 +ifneq ($(EIP7702_TEST_WHITELIST),0) + DEFINES += HAVE_EIP7702_WHITELIST_TEST endif # Check features incompatibilities diff --git a/src/shared_context.h b/src/shared_context.h index e3aa44b759..29c6d50998 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -149,15 +149,11 @@ typedef struct txStringProperties_s { char tx_hash[2 + (INT256_LENGTH * 2) + 1]; } txStringProperties_t; -#ifdef TARGET_NANOS -#define SHARED_CTX_FIELD_1_SIZE 100 -#else #ifdef SCREEN_SIZE_WALLET #define SHARED_CTX_FIELD_1_SIZE 380 #else #define SHARED_CTX_FIELD_1_SIZE 256 #endif -#endif #define SHARED_CTX_FIELD_2_SIZE 40 typedef struct strDataTmp_s { diff --git a/src_bagl/common_ui.c b/src_bagl/common_ui.c deleted file mode 100644 index 42d707b93f..0000000000 --- a/src_bagl/common_ui.c +++ /dev/null @@ -1,90 +0,0 @@ -#ifdef HAVE_BAGL - -#include "common_ui.h" -#include "ux.h" -#include "ui_flow.h" -#include "ui_callbacks.h" - -void ui_idle(void) { - // reserve a display stack slot if none yet - if (G_ux.stack_count == 0) { - ux_stack_push(); - } - ux_flow_init(0, ux_idle_flow, NULL); -} - -void ui_error_blind_signing(void) { - ux_flow_init(0, ux_error_blind_signing_flow, NULL); -} - -void ui_warning_blind_signing(void) { - ux_flow_init(0, ux_warning_blind_signing_flow, NULL); -} - -void ui_display_public_eth2(void) { - ux_flow_init(0, ux_display_public_eth2_flow, NULL); -} - -void ui_display_privacy_public_key(void) { - ux_flow_init(0, ux_display_privacy_public_key_flow, NULL); -} - -void ui_display_privacy_shared_secret(void) { - ux_flow_init(0, ux_display_privacy_shared_secret_flow, NULL); -} - -void ui_display_public_key(const uint64_t *chain_id) { - (void) chain_id; - ux_flow_init(0, ux_display_public_flow, NULL); -} - -void ui_sign_712_v0(void) { - ux_flow_init(0, ux_sign_712_v0_flow, NULL); -} - -void ui_confirm_selector(void) { - ux_flow_init(0, ux_confirm_selector_flow, NULL); -} - -void ui_confirm_parameter(void) { - ux_flow_init(0, ux_confirm_parameter_flow, NULL); -} - -unsigned int address_cancel_cb(void) { - ui_idle(); - return io_seproxyhal_touch_address_cancel(); -} - -unsigned int tx_ok_cb(void) { - ui_idle(); - return io_seproxyhal_touch_tx_ok(); -} - -unsigned int tx_cancel_cb(void) { - ui_idle(); - return io_seproxyhal_touch_tx_cancel(); -} - -#ifdef HAVE_EIP7702 - -void ui_sign_7702_auth(void) { - ux_flow_init(0, ux_auth7702_flow, NULL); -} - -void ui_sign_7702_revocation(void) { - ux_flow_init(0, ux_revocation7702_flow, NULL); -} - -void ui_error_no_7702(void) { - ux_flow_init(0, ux_error_7702_not_enabled_flow, NULL); -} - -#ifdef HAVE_EIP7702_WHITELIST -void ui_error_no_7702_whitelist(void) { - ux_flow_init(0, ux_error_7702_not_whitelisted_flow, NULL); -} -#endif // HAVE_EIP7702_WHITELIST - -#endif // HAVE_EIP7702 - -#endif // HAVE_BAGL diff --git a/src_bagl/ui_flow.c b/src_bagl/ui_flow.c deleted file mode 100644 index 31ebd633f7..0000000000 --- a/src_bagl/ui_flow.c +++ /dev/null @@ -1,343 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" -#include "common_ui.h" -#include "common_utils.h" -#include "feature_signTx.h" - -#define ENABLED_STR "Enabled" -#define DISABLED_STR "Disabled" -#define BUF_INCREMENT (MAX(strlen(ENABLED_STR), strlen(DISABLED_STR)) + 1) - -// Reuse the strings.common.fullAmount buffer for settings displaying. -// No risk of collision as this buffer is unused in the settings menu -#define SETTING_BLIND_SIGNING_STATE (strings.common.fullAmount + (BUF_INCREMENT * 0)) -#define SETTING_VERBOSE_TRUSTED_NAME_STATE (strings.common.fullAmount + (BUF_INCREMENT * 1)) -#define SETTING_DISPLAY_NONCE_STATE (strings.common.fullAmount + (BUF_INCREMENT * 2)) -#define SETTING_VERBOSE_EIP712_STATE (strings.common.fullAmount + (BUF_INCREMENT * 3)) -#define SETTING_DISPLAY_DATA_STATE (strings.common.fullAmount + (BUF_INCREMENT * 4)) -#define SETTING_EIP7702_STATE (strings.common.fullAmount + (BUF_INCREMENT * 5)) - -#define BOOL_TO_STATE_STR(b) (b ? ENABLED_STR : DISABLED_STR) - -static void display_settings(const ux_flow_step_t* const start_step); -static void switch_settings_blind_signing(void); -#ifdef HAVE_TRUSTED_NAME -static void switch_settings_verbose_trusted_name(void); -#endif // HAVE_TRUSTED_NAME -static void switch_settings_display_data(void); -static void switch_settings_display_nonce(void); -#ifdef HAVE_EIP712_FULL_SUPPORT -static void switch_settings_verbose_eip712(void); -#endif // HAVE_EIP712_FULL_SUPPORT -#ifdef HAVE_EIP7702 -static void switch_settings_eip7702(void); -#endif // HAVE_EIP7702 - -////////////////////////////////////////////////////////////////////// -// clang-format off -UX_STEP_NOCB( - ux_idle_flow_1_step, - nn, //pnn, - { - //"", //&C_icon_dashboard, - "Application", - "is ready", - }); -UX_STEP_NOCB( - ux_idle_flow_2_step, - bn, - { - "Version", - APPVERSION, - }); -UX_STEP_CB( - ux_idle_flow_3_step, - pb, - display_settings(NULL), - { - &C_icon_eye, - "Settings", - }); -UX_STEP_CB( - ux_idle_flow_4_step, - pb, - app_exit(), - { - &C_icon_dashboard_x, - "Quit", - }); -// clang-format on - -UX_FLOW(ux_idle_flow, - &ux_idle_flow_1_step, - &ux_idle_flow_2_step, - &ux_idle_flow_3_step, - &ux_idle_flow_4_step, - FLOW_LOOP); - -// clang-format off -UX_STEP_CB( - ux_settings_flow_blind_signing_step, -#ifdef TARGET_NANOS - bnnn_paging, -#else - bnnn, -#endif - switch_settings_blind_signing(), - { -#ifdef TARGET_NANOS - .title = "Blind signing", - .text = -#else - "Blind signing", - "Enables transaction", - "blind signing", -#endif - SETTING_BLIND_SIGNING_STATE - }); - -#ifdef HAVE_TRUSTED_NAME -UX_STEP_CB( - ux_settings_flow_verbose_trusted_name_step, - bnnn, - switch_settings_verbose_trusted_name(), - { - "ENS addresses", - "Displays resolved", - "addresses from ENS", - SETTING_VERBOSE_TRUSTED_NAME_STATE - }); -#endif // HAVE_TRUSTED_NAME - -UX_STEP_CB( - ux_settings_flow_display_nonce_step, -#ifdef TARGET_NANOS - bnnn_paging, -#else - bnnn, -#endif - switch_settings_display_nonce(), - { -#ifdef TARGET_NANOS - .title = "Account nonce", - .text = -#else - "Nonce", - "Displays nonce", - "in transactions", -#endif - SETTING_DISPLAY_NONCE_STATE - }); - -#ifdef HAVE_EIP712_FULL_SUPPORT -UX_STEP_CB( - ux_settings_flow_verbose_eip712_step, - bnnn, - switch_settings_verbose_eip712(), - { - "Raw messages", - "Displays raw content", - "from EIP712 messages", - SETTING_VERBOSE_EIP712_STATE - }); -#endif // HAVE_EIP712_FULL_SUPPORT - -#ifdef HAVE_EIP7702 -UX_STEP_CB( - ux_settings_flow_7702_step, - bnnn, - switch_settings_eip7702(), - { - "Smart accounts", - "Enable EIP7702", - "authorizations", - SETTING_EIP7702_STATE - }); -#endif // HAVE_EIP7702 - - -UX_STEP_CB( - ux_settings_flow_display_data_step, -#ifdef TARGET_NANOS - bnnn_paging, -#else - bnnn, -#endif - switch_settings_display_data(), - { -#ifdef TARGET_NANOS - .title = "Debug data", - .text = -#else - "Debug contracts", - "Displays contract", - "data details", -#endif - SETTING_DISPLAY_DATA_STATE - }); - -UX_STEP_CB( - ux_settings_flow_back_step, - pb, - ui_idle(), - { - &C_icon_back_x, - "Back", - }); -// clang-format on - -UX_FLOW(ux_settings_flow, - &ux_settings_flow_blind_signing_step, -#ifdef HAVE_TRUSTED_NAME - &ux_settings_flow_verbose_trusted_name_step, -#endif // HAVE_TRUSTED_NAME - &ux_settings_flow_display_nonce_step, -#ifdef HAVE_EIP712_FULL_SUPPORT - &ux_settings_flow_verbose_eip712_step, -#endif // HAVE_EIP712_FULL_SUPPORT - &ux_settings_flow_display_data_step, -#ifdef HAVE_EIP7702 - &ux_settings_flow_7702_step, -#endif // HAVE_EIP7702 - &ux_settings_flow_back_step); - -static void display_settings(const ux_flow_step_t* const start_step) { - strlcpy(SETTING_BLIND_SIGNING_STATE, BOOL_TO_STATE_STR(N_storage.dataAllowed), BUF_INCREMENT); - strlcpy(SETTING_DISPLAY_DATA_STATE, - BOOL_TO_STATE_STR(N_storage.contractDetails), - BUF_INCREMENT); - strlcpy(SETTING_DISPLAY_NONCE_STATE, BOOL_TO_STATE_STR(N_storage.displayNonce), BUF_INCREMENT); -#ifdef HAVE_EIP712_FULL_SUPPORT - strlcpy(SETTING_VERBOSE_EIP712_STATE, - BOOL_TO_STATE_STR(N_storage.verbose_eip712), - BUF_INCREMENT); -#endif // HAVE_EIP712_FULL_SUPPORT -#ifdef HAVE_TRUSTED_NAME - strlcpy(SETTING_VERBOSE_TRUSTED_NAME_STATE, - BOOL_TO_STATE_STR(N_storage.verbose_trusted_name), - BUF_INCREMENT); -#endif // HAVE_TRUSTED_NAME -#ifdef HAVE_EIP7702 - strlcpy(SETTING_EIP7702_STATE, BOOL_TO_STATE_STR(N_storage.eip7702_enable), BUF_INCREMENT); -#endif // HAVE_EIP7702 - - ux_flow_init(0, ux_settings_flow, start_step); -} - -static void toggle_setting(volatile bool* setting, const ux_flow_step_t* ui_step) { - bool value = !*setting; - nvm_write((void*) setting, (void*) &value, sizeof(value)); - display_settings(ui_step); -} - -static void switch_settings_blind_signing(void) { - toggle_setting(&N_storage.dataAllowed, &ux_settings_flow_blind_signing_step); -} - -static void switch_settings_display_data(void) { - toggle_setting(&N_storage.contractDetails, &ux_settings_flow_display_data_step); -} - -static void switch_settings_display_nonce(void) { - toggle_setting(&N_storage.displayNonce, &ux_settings_flow_display_nonce_step); -} - -#ifdef HAVE_EIP712_FULL_SUPPORT -static void switch_settings_verbose_eip712(void) { - toggle_setting(&N_storage.verbose_eip712, &ux_settings_flow_verbose_eip712_step); -} -#endif // HAVE_EIP712_FULL_SUPPORT - -#ifdef HAVE_TRUSTED_NAME -static void switch_settings_verbose_trusted_name(void) { - toggle_setting(&N_storage.verbose_trusted_name, &ux_settings_flow_verbose_trusted_name_step); -} -#endif // HAVE_TRUSTED_NAME - -#ifdef HAVE_EIP7702 -static void switch_settings_eip7702(void) { - toggle_setting(&N_storage.eip7702_enable, &ux_settings_flow_7702_step); -} -#endif // HAVE_EIP7702 - -////////////////////////////////////////////////////////////////////// -// clang-format off -#ifdef TARGET_NANOS -UX_STEP_CB( - ux_error_blind_signing_step, - bnnn_paging, - ui_idle(), - { - "Error", - "Blind signing must be enabled in Settings", - }); -#else -UX_STEP_CB( - ux_error_blind_signing_step, - pnn, - ui_idle(), - { - &C_icon_crossmark, - "Blind signing must be", - "enabled in Settings", - }); -#endif - -UX_STEP_NOCB( - ux_warning_blind_signing_warn_step, - pbb, - { - &C_icon_warning, - "Blind", - "signing", - }); -UX_STEP_INIT( - ux_warning_blind_signing_jump_step, - NULL, - NULL, - { - start_signature_flow(); - } -); -// clang-format on - -UX_FLOW(ux_error_blind_signing_flow, &ux_error_blind_signing_step); -UX_FLOW(ux_warning_blind_signing_flow, - &ux_warning_blind_signing_warn_step, - &ux_warning_blind_signing_jump_step); - -#ifdef HAVE_EIP7702 - -////////////////////////////////////////////////////////////////////// -// clang-format off -UX_STEP_CB( - ux_error_7702_not_enabled_step, - pnn, - ui_idle(), - { - &C_icon_crossmark, - "Smart accounts must", - "be enabled in Settings", - }); - -#ifdef HAVE_EIP7702_WHITELIST -UX_STEP_CB( - ux_error_7702_not_whitelisted_step, - pnn, - ui_idle(), - { - &C_icon_crossmark, - "Authorization to non", - "whitelisted contract", - }); -#endif //HAVE_EIP7702_WHITELIST - -// clang-format on - -UX_FLOW(ux_error_7702_not_enabled_flow, &ux_error_7702_not_enabled_step); - -#ifdef HAVE_EIP7702_WHITELIST -UX_FLOW(ux_error_7702_not_whitelisted_flow, &ux_error_7702_not_whitelisted_step); -#endif // HAVE_EIP7702_WHITELIST - -#endif // HAVE_EIP7702 diff --git a/src_bagl/ui_flow.h b/src_bagl/ui_flow.h deleted file mode 100644 index 85c548c2cd..0000000000 --- a/src_bagl/ui_flow.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _UI_FLOW_H_ -#define _UI_FLOW_H_ - -#include "shared_context.h" - -#include "os_io_seproxyhal.h" -#include "ux.h" - -extern const ux_flow_step_t* const ux_idle_flow[]; - -extern const ux_flow_step_t* const ux_error_blind_signing_flow[]; - -extern const ux_flow_step_t* const ux_warning_blind_signing_flow[]; - -extern const ux_flow_step_t* const ux_settings_flow[]; - -extern const ux_flow_step_t* const ux_display_public_flow[]; - -extern const ux_flow_step_t* const ux_confirm_selector_flow[]; - -extern const ux_flow_step_t* const ux_confirm_parameter_flow[]; - -extern const ux_flow_step_t* const ux_approval_allowance_flow[]; - -extern const ux_flow_step_t* const ux_sign_712_v0_flow[]; - -extern const ux_flow_step_t* const ux_display_public_eth2_flow[]; - -extern const ux_flow_step_t* const ux_display_privacy_public_key_flow[]; - -extern const ux_flow_step_t* const ux_display_privacy_shared_secret_flow[]; - -extern const ux_flow_step_t* ux_approval_tx_flow[15]; - -extern const ux_flow_step_t ux_warning_blind_signing_warn_step; - -#ifdef HAVE_EIP7702 - -extern const ux_flow_step_t* const ux_auth7702_flow[]; - -extern const ux_flow_step_t* const ux_revocation7702_flow[]; - -extern const ux_flow_step_t* const ux_error_7702_not_enabled_flow[]; - -#ifdef HAVE_EIP7702_WHITELIST -extern const ux_flow_step_t* const ux_error_7702_not_whitelisted_flow[]; -#endif // HAVE_EIP7702_WHITELIST - -#endif // HAVE_EIP7702 - -#endif // _UI_FLOW_H_ diff --git a/src_bagl/ui_flow_erc20_approval.c b/src_bagl/ui_flow_erc20_approval.c deleted file mode 100644 index 28ed3f7bb8..0000000000 --- a/src_bagl/ui_flow_erc20_approval.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" - -// clang-format off -UX_STEP_NOCB(ux_approval_allowance_1_step, - pnn, - { - &C_icon_eye, - "Review", - "transaction", - }); - -UX_STEP_NOCB( - ux_approval_allowance_2_step, - bnnn_paging, - { - .title = "Allowance", - .text = " " - }); - -UX_STEP_NOCB( - ux_approval_allowance_3_step, - bnnn_paging, - { - .title = "Contract Name", - .text = strings.common.toAddress, - }); - -UX_STEP_NOCB( - ux_approval_allowance_4_step, - bnnn_paging, - { - .title = "Amount", - .text = strings.common.fullAmount - }); - -UX_STEP_NOCB( - ux_approval_allowance_5_step, - bnnn_paging, - { - .title = "Max Fees", - .text = strings.common.maxFee, - }); - -UX_STEP_CB( - ux_approval_allowance_6_step, - pbb, - tx_ok_cb(), - { - &C_icon_validate_14, - "Accept", - "and send", - }); - -UX_STEP_CB( - ux_approval_allowance_7_step, - pb, - tx_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); -// clang-format on - -UX_FLOW(ux_approval_allowance_flow, - &ux_approval_allowance_1_step, - &ux_approval_allowance_2_step, - &ux_approval_allowance_3_step, - &ux_approval_allowance_4_step, - &ux_approval_allowance_5_step, - &ux_approval_allowance_6_step, - &ux_approval_allowance_7_step); diff --git a/src_bagl/ui_flow_getEth2PublicKey.c b/src_bagl/ui_flow_getEth2PublicKey.c deleted file mode 100644 index 9d21226550..0000000000 --- a/src_bagl/ui_flow_getEth2PublicKey.c +++ /dev/null @@ -1,55 +0,0 @@ -#ifdef HAVE_ETH2 - -#include "shared_context.h" -#include "ui_callbacks.h" -#include "uint_common.h" - -void prepare_eth2_public_key() { - array_bytes_string(strings.tmp.tmp, - sizeof(strings.tmp.tmp), - tmpCtx.publicKeyContext.publicKey.W, - 48); -} - -// clang-format off -UX_STEP_NOCB( - ux_display_public_eth2_flow_1_step, - pnn, - { - &C_icon_eye, - "Verify ETH2", - "public key", - }); -UX_STEP_NOCB_INIT( - ux_display_public_eth2_flow_2_step, - bnnn_paging, - prepare_eth2_public_key(), - { - .title = "Public Key", - .text = strings.tmp.tmp, - }); -UX_STEP_CB( - ux_display_public_eth2_flow_3_step, - pb, - io_seproxyhal_touch_eth2_address_ok(), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB( - ux_display_public_eth2_flow_4_step, - pb, - address_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); -// clang-format on - -UX_FLOW(ux_display_public_eth2_flow, - &ux_display_public_eth2_flow_1_step, - &ux_display_public_eth2_flow_2_step, - &ux_display_public_eth2_flow_3_step, - &ux_display_public_eth2_flow_4_step); - -#endif diff --git a/src_bagl/ui_flow_getPublicKey.c b/src_bagl/ui_flow_getPublicKey.c deleted file mode 100644 index d70396d75d..0000000000 --- a/src_bagl/ui_flow_getPublicKey.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" -#include "common_ui.h" - -static unsigned int address_ok_cb(void) { - ui_idle(); - return io_seproxyhal_touch_address_ok(); -} - -// clang-format off -UX_STEP_NOCB( - ux_display_public_flow_1_step, - pnn, - { - &C_icon_eye, - "Verify", - "address", - }); -UX_STEP_NOCB( - ux_display_public_flow_2_step, - bnnn_paging, - { - .title = "Address", - .text = strings.common.toAddress, - }); -UX_STEP_CB( - ux_display_public_flow_3_step, - pb, - address_ok_cb(), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB( - ux_display_public_flow_4_step, - pb, - address_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); -// clang-format on - -UX_FLOW(ux_display_public_flow, - &ux_display_public_flow_1_step, - &ux_display_public_flow_2_step, - &ux_display_public_flow_3_step, - &ux_display_public_flow_4_step); diff --git a/src_bagl/ui_flow_performPrivacyOperation.c b/src_bagl/ui_flow_performPrivacyOperation.c deleted file mode 100644 index 2fd411fadd..0000000000 --- a/src_bagl/ui_flow_performPrivacyOperation.c +++ /dev/null @@ -1,67 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" - -// clang-format off -UX_STEP_NOCB( - ux_display_privacy_public_key_flow_1_step, - pnn, - { - &C_icon_eye, - "Provide public", - "privacy key", - }); -UX_STEP_NOCB( - ux_display_privacy_public_key_flow_2_step, - bnnn_paging, - { - .title = "Address", - .text = strings.common.toAddress, - }); -UX_STEP_NOCB( - ux_display_privacy_public_key_flow_3_step, - bnnn_paging, - { - .title = "Key", - .text = strings.common.fullAmount, - }); -UX_STEP_CB( - ux_display_privacy_public_key_flow_4_step, - pb, - io_seproxyhal_touch_privacy_ok(), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB( - ux_display_privacy_public_key_flow_5_step, - pb, - io_seproxyhal_touch_privacy_cancel(), - { - &C_icon_crossmark, - "Reject", - }); - -UX_STEP_NOCB( - ux_display_privacy_shared_secret_flow_1_step, - pnn, - { - &C_icon_eye, - "Provide privacy", - "secret key", - }); - -// clang-format on - -UX_FLOW(ux_display_privacy_public_key_flow, - &ux_display_privacy_public_key_flow_1_step, - &ux_display_privacy_public_key_flow_2_step, - &ux_display_privacy_public_key_flow_3_step, - &ux_display_privacy_public_key_flow_4_step, - &ux_display_privacy_public_key_flow_5_step); - -UX_FLOW(ux_display_privacy_shared_secret_flow, - &ux_display_privacy_shared_secret_flow_1_step, - &ux_display_privacy_public_key_flow_2_step, - &ux_display_privacy_public_key_flow_3_step, - &ux_display_privacy_public_key_flow_4_step, - &ux_display_privacy_public_key_flow_5_step); diff --git a/src_bagl/ui_flow_signAuthorization7702.c b/src_bagl/ui_flow_signAuthorization7702.c deleted file mode 100644 index 9bdbc08054..0000000000 --- a/src_bagl/ui_flow_signAuthorization7702.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "ui_callbacks.h" - -// clang-format off -UX_STEP_NOCB(ux_7702_review_step, - pnn, - { - &C_icon_eye, - "Review", - "authorization", - }); -UX_STEP_NOCB(ux_7702_account_step, - bnnn_paging, - { - .title = "Account", - .text = strings.common.fromAddress - }); -UX_STEP_NOCB(ux_7702_delegate_step, - bnnn_paging, - { - .title = "Delegate to", - .text = strings.common.toAddress - }); -UX_STEP_NOCB(ux_7702_network_step, - bnnn_paging, - { - .title = "Delegate on network", - .text = strings.common.network_name - }); -UX_STEP_CB( - ux_7702_accept_step, - pbb, - auth_7702_ok_cb(), - { - &C_icon_validate_14, - "Accept", - "and send", - }); -UX_STEP_CB( - ux_7702_reject_step, - pb, - auth_7702_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); -// clang-format off - -UX_FLOW(ux_auth7702_flow, - &ux_7702_review_step, - &ux_7702_account_step, - &ux_7702_delegate_step, - &ux_7702_network_step, - &ux_7702_accept_step, - &ux_7702_reject_step); - -UX_FLOW(ux_revocation7702_flow, - &ux_7702_review_step, - &ux_7702_account_step, - &ux_7702_network_step, - &ux_7702_accept_step, - &ux_7702_reject_step); diff --git a/src_bagl/ui_flow_signMessage.c b/src_bagl/ui_flow_signMessage.c deleted file mode 100644 index 561bb6cde2..0000000000 --- a/src_bagl/ui_flow_signMessage.c +++ /dev/null @@ -1,142 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" -#include "common_ui.h" -#include "sign_message.h" - -typedef enum { UI_191_POS_REVIEW, UI_191_POS_QUESTION, UI_191_POS_END } e_ui_191_position; - -static uint8_t ui_pos; - -static void dummy_pre_cb(void) { - if (ui_pos == UI_191_POS_REVIEW) { - question_switcher(); - } else { - ux_flow_prev(); - ui_pos = UI_191_POS_REVIEW; - } -} - -static void dummy_post_cb(void) { - if (ui_pos == UI_191_POS_QUESTION) { - // temporarily disable button clicks, they will be re-enabled as soon as new data - // is received and the page is redrawn with ux_flow_init() - G_ux.stack[0].button_push_callback = NULL; - continue_displaying_message(); - } else // UI_191_END - { - ui_191_switch_to_message_end(); - } -} - -static unsigned int signMessage_ok_cb(void) { - ui_idle(); - return io_seproxyhal_touch_signMessage_ok(); -} - -static unsigned int signMessage_cancel_cb(void) { - ui_idle(); - return io_seproxyhal_touch_signMessage_cancel(); -} - -// clang-format off -UX_STEP_NOCB( - ux_191_step_review, - pnn, - { - &C_icon_certificate, - "Review", - "message", - }); -UX_STEP_NOCB( - ux_191_step_message, - bnnn_paging, - { - .title = "Message", - .text = strings.tmp.tmp, - }); -UX_STEP_INIT( - ux_191_step_dummy_pre, - NULL, - NULL, - { - dummy_pre_cb(); - }); -UX_STEP_CB( - ux_191_step_theres_more, -#ifdef TARGET_NANOS - nn, -#else - nnn, -#endif - G_ux.stack[0].button_push_callback = NULL; // disable button clicks - skip_rest_of_message(), - { -#ifndef TARGET_NANOS - "Press right to", - "continue message", -#else - "Press right to read", -#endif - "Double-press to skip" - }); -UX_STEP_INIT( - ux_191_step_dummy_post, - NULL, - NULL, - { - dummy_post_cb(); - }); -UX_STEP_CB( - ux_191_step_sign, - pbb, - signMessage_ok_cb(), - { - &C_icon_validate_14, - "Sign", - "message", - }); -UX_STEP_CB( - ux_191_step_cancel, - pbb, - signMessage_cancel_cb(), - { - &C_icon_crossmark, - "Cancel", - "signature", - }); -// clang-format on - -UX_FLOW(ux_191_flow, - &ux_191_step_review, - &ux_191_step_message, - &ux_191_step_dummy_pre, - &ux_191_step_theres_more, - &ux_191_step_dummy_post, - &ux_191_step_sign, - &ux_191_step_cancel); - -void ui_191_start(void) { - ux_flow_init(0, ux_191_flow, NULL); - ui_pos = UI_191_POS_REVIEW; -} - -void ui_191_switch_to_message(void) { - ux_flow_init(0, ux_191_flow, &ux_191_step_message); - ui_pos = UI_191_POS_REVIEW; -} - -void ui_191_switch_to_message_end(void) { - // Force it to a value that will make it automatically do a prev() - ui_pos = UI_191_POS_QUESTION; - ux_flow_init(0, ux_191_flow, &ux_191_step_dummy_pre); -} - -void ui_191_switch_to_sign(void) { - ux_flow_init(0, ux_191_flow, &ux_191_step_sign); - ui_pos = UI_191_POS_END; -} - -void ui_191_switch_to_question(void) { - ux_flow_init(0, ux_191_flow, &ux_191_step_theres_more); - ui_pos = UI_191_POS_QUESTION; -} diff --git a/src_bagl/ui_flow_signMessage712.c b/src_bagl/ui_flow_signMessage712.c deleted file mode 100644 index 1596abdc0d..0000000000 --- a/src_bagl/ui_flow_signMessage712.c +++ /dev/null @@ -1,152 +0,0 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - -#include "ui_logic.h" -#include "shared_context.h" // strings -#include "common_ui.h" -#include "ui_flow.h" // ux_warning_blind_signing_warn_step - -enum { UI_712_POS_REVIEW, UI_712_POS_END }; -static uint8_t ui_pos; -static bool filtered; - -// forward declaration for the BAGL step -static void ui_712_start_flow(void); - -static void dummy_cb(void) { - switch (ui_712_next_field()) { - case EIP712_NO_MORE_FIELD: - if (ui_pos == UI_712_POS_REVIEW) { - ux_flow_next(); - ui_pos = UI_712_POS_END; - } else { - // Keep user at the end of the flow - ux_flow_next(); - } - break; - case EIP712_FIELD_INCOMING: - // temporarily disable button clicks, they will be re-enabled as soon as new data - // is received and the page is redrawn with ux_flow_init() - G_ux.stack[0].button_push_callback = NULL; - break; - case EIP712_FIELD_LATER: - default: - break; - } -} - -static unsigned int _approve_cb(void) { - ui_idle(); - return ui_712_approve(); -} - -static unsigned int _reject_cb(void) { - ui_idle(); - return ui_712_reject(); -} - -// clang-format off -UX_STEP_NOCB( - ux_712_step_review, - pnn, - { - &C_icon_eye, - "Review", - "typed message", - }); -UX_STEP_NOCB( - ux_712_step_dynamic, - bnnn_paging, - { - .title = strings.tmp.tmp2, - .text = strings.tmp.tmp, - } -); -UX_STEP_INIT( - ux_712_step_dummy, - NULL, - NULL, - { - dummy_cb(); - } -); -UX_STEP_CB( - ux_712_step_approve, - pb, - _approve_cb(), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB( - ux_712_step_approve_risky, - pbb, - _approve_cb(), - { - &C_icon_validate_14, - "Accept risk", - "and sign", - }); -UX_STEP_CB( - ux_712_step_reject, - pb, - _reject_cb(), - { - &C_icon_crossmark, - "Reject", - }); - -UX_STEP_INIT( - ux_712_warning_blind_signing_jump_step, - NULL, - NULL, - { - ui_712_start_flow(); - } -); -// clang-format on - -UX_FLOW(ux_712_flow, - &ux_712_step_review, - &ux_712_step_dynamic, - &ux_712_step_dummy, - &ux_712_step_approve, - &ux_712_step_reject); - -UX_FLOW(ux_712_flow_unfiltered, - &ux_712_step_review, - &ux_712_step_dynamic, - &ux_712_step_dummy, - &ux_712_step_approve_risky, - &ux_712_step_reject); - -UX_FLOW(ux_712_warning_blind_signing_flow, - &ux_warning_blind_signing_warn_step, - &ux_712_warning_blind_signing_jump_step); - -static void ui_712_start_flow(void) { - ux_flow_init(0, filtered ? ux_712_flow : ux_712_flow_unfiltered, NULL); - ui_pos = UI_712_POS_REVIEW; -} -void ui_712_start(void) { - filtered = true; - ui_712_start_flow(); -} - -void ui_712_start_unfiltered(void) { - filtered = false; - ux_flow_init(0, ux_712_warning_blind_signing_flow, NULL); -} - -void ui_712_switch_to_message(void) { - ux_flow_init(0, filtered ? ux_712_flow : ux_712_flow_unfiltered, &ux_712_step_dynamic); - ui_pos = UI_712_POS_REVIEW; -} - -void ui_712_switch_to_sign(void) { - ux_flow_init(0, - filtered ? ux_712_flow : ux_712_flow_unfiltered, - filtered ? &ux_712_step_approve : &ux_712_step_approve_risky); - ui_pos = UI_712_POS_END; -} - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_bagl/ui_flow_signMessage712_v0.c b/src_bagl/ui_flow_signMessage712_v0.c deleted file mode 100644 index e6ee1b359c..0000000000 --- a/src_bagl/ui_flow_signMessage712_v0.c +++ /dev/null @@ -1,83 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" -#include "common_712.h" -#include "uint_common.h" -#include "common_ui.h" -#include "ui_flow.h" // ux_warning_blind_signing_warn_step - -void prepare_domain_hash_v0() { - array_bytes_string(strings.tmp.tmp, - sizeof(strings.tmp.tmp), - tmpCtx.messageSigningContext712.domainHash, - KECCAK256_HASH_BYTESIZE); -} - -void prepare_message_hash_v0() { - array_bytes_string(strings.tmp.tmp, - sizeof(strings.tmp.tmp), - tmpCtx.messageSigningContext712.messageHash, - KECCAK256_HASH_BYTESIZE); -} - -static unsigned int _approve_cb(void) { - ui_idle(); - return ui_712_approve_cb(); -} - -static unsigned int _reject_cb(void) { - ui_idle(); - return ui_712_reject_cb(); -} - -// clang-format off -UX_STEP_NOCB( - ux_sign_712_v0_flow_1_step, - pnn, - { - &C_icon_certificate, - "Review", - "typed message", - }); -UX_STEP_NOCB_INIT( - ux_sign_712_v0_flow_2_step, - bnnn_paging, - prepare_domain_hash_v0(), - { - .title = "Domain hash", - .text = strings.tmp.tmp, - }); -UX_STEP_NOCB_INIT( - ux_sign_712_v0_flow_3_step, - bnnn_paging, - prepare_message_hash_v0(), - { - .title = "Message hash", - .text = strings.tmp.tmp, - }); -UX_STEP_CB( - ux_sign_712_v0_flow_4_step, - pbb, - _approve_cb(), - { - &C_icon_validate_14, - "Accept risk", - "and sign", - }); -UX_STEP_CB( - ux_sign_712_v0_flow_5_step, - pbb, - _reject_cb(), - { - &C_icon_crossmark, - "Cancel", - "signature", - }); -// clang-format on - -UX_FLOW(ux_sign_712_v0_flow, - &ux_warning_blind_signing_warn_step, - &ux_sign_712_v0_flow_1_step, - &ux_sign_712_v0_flow_2_step, - &ux_sign_712_v0_flow_3_step, - &ux_sign_712_v0_flow_4_step, - &ux_sign_712_v0_flow_5_step); diff --git a/src_bagl/ui_flow_signTx.c b/src_bagl/ui_flow_signTx.c deleted file mode 100644 index 0279ad7480..0000000000 --- a/src_bagl/ui_flow_signTx.c +++ /dev/null @@ -1,304 +0,0 @@ -#include "shared_context.h" -#include "ui_callbacks.h" -#include "chainConfig.h" -#include "common_utils.h" -#include "network.h" -#include "eth_plugin_handler.h" -#include "ui_plugin.h" -#include "common_ui.h" -#include "plugins.h" -#include "trusted_name.h" -#include "ui_trusted_name.h" - -static unsigned int data_ok_cb(void) { - ui_idle(); - return io_seproxyhal_touch_data_ok(); -} - -static unsigned int data_cancel_cb(void) { - ui_idle(); - return io_seproxyhal_touch_data_cancel(); -} - -// clang-format off -UX_STEP_NOCB( - ux_confirm_selector_flow_1_step, - pnn, - { - &C_icon_eye, - "Verify", - "selector", - }); - -UX_STEP_NOCB( - ux_confirm_selector_flow_2_step, - bn, - { - "Selector", - strings.tmp.tmp - }); -UX_STEP_CB( - ux_confirm_selector_flow_3_step, - pb, - data_ok_cb(), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB( - ux_confirm_selector_flow_4_step, - pb, - data_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); -// clang-format on - -UX_FLOW(ux_confirm_selector_flow, - &ux_confirm_selector_flow_1_step, - &ux_confirm_selector_flow_2_step, - &ux_confirm_selector_flow_3_step, - &ux_confirm_selector_flow_4_step); - -////////////////////////////////////////////////////////////////////// -// clang-format off -UX_STEP_NOCB( - ux_confirm_parameter_flow_1_step, - pnn, - { - &C_icon_eye, - "Verify", - strings.tmp.tmp2 - }); -UX_STEP_NOCB( - ux_confirm_parameter_flow_2_step, - bnnn_paging, - { - .title = "Parameter", - .text = strings.tmp.tmp, - }); -UX_STEP_CB( - ux_confirm_parameter_flow_3_step, - pb, - data_ok_cb(), - { - &C_icon_validate_14, - "Approve", - }); -UX_STEP_CB( - ux_confirm_parameter_flow_4_step, - pb, - data_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); -// clang-format on - -UX_FLOW(ux_confirm_parameter_flow, - &ux_confirm_parameter_flow_1_step, - &ux_confirm_parameter_flow_2_step, - &ux_confirm_parameter_flow_3_step, - &ux_confirm_parameter_flow_4_step); - -////////////////////////////////////////////////////////////////////// -// clang-format off -UX_STEP_NOCB(ux_approval_review_step, - pnn, - { - &C_icon_eye, - "Review", - "transaction", - }); -UX_STEP_NOCB(ux_approval_tx_hash_step, - bnnn_paging, - { -#ifdef TARGET_NANOS - .title = "TX hash", -#else - .title = "Transaction hash", -#endif - .text = strings.common.tx_hash - }); -UX_STEP_NOCB( - ux_approval_amount_step, - bnnn_paging, - { - .title = "Amount", - .text = strings.common.fullAmount - }); -UX_STEP_NOCB( - ux_approval_from_step, - bnnn_paging, - { - .title = "From", - .text = strings.common.fromAddress, - }); -UX_STEP_NOCB( - ux_approval_to_step, - bnnn_paging, - { - .title = "To", - .text = strings.common.toAddress, - }); - -UX_STEP_NOCB_INIT( - ux_plugin_approval_id_step, - bnnn_paging, - plugin_ui_get_id(), - { - .title = strings.common.toAddress, - .text = strings.common.fullAmount - }); - -UX_STEP_INIT( - ux_plugin_approval_before_step, - NULL, - NULL, - { - display_next_plugin_item(true); - }); - -UX_FLOW_DEF_NOCB( - ux_plugin_approval_display_step, - bnnn_paging, - { - .title = strings.common.toAddress, - .text = strings.common.fullAmount - }); - -UX_STEP_INIT( - ux_plugin_approval_after_step, - NULL, - NULL, - { - display_next_plugin_item(false); - }); - -UX_STEP_NOCB( - ux_approval_fees_step, - bnnn_paging, - { - .title = "Max Fees", - .text = strings.common.maxFee, - }); - -UX_STEP_NOCB( - ux_approval_network_step, - bnnn_paging, - { - .title = "Network", - .text = strings.common.network_name, - }); - -UX_STEP_CB( - ux_approval_accept_step, - pbb, - tx_ok_cb(), - { - &C_icon_validate_14, - "Accept", - "and send", - }); -UX_STEP_CB( - ux_approval_accept_blind_step, - pbb, - tx_ok_cb(), - { - &C_icon_validate_14, - "Accept risk", - "and send", - }); -UX_STEP_CB( - ux_approval_reject_step, - pb, - tx_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - }); - -UX_STEP_NOCB( - ux_approval_nonce_step, - bnnn_paging, - { - .title = "Nonce", - .text = strings.common.nonce, - }); -// clang-format on - -const ux_flow_step_t *ux_approval_tx_flow[15]; - -void ux_approve_tx(bool fromPlugin) { - int step = 0; - ux_approval_tx_flow[step++] = &ux_approval_review_step; - - if (fromPlugin) { - // Add the special dynamic display logic - ux_approval_tx_flow[step++] = &ux_plugin_approval_id_step; - if (pluginType != EXTERNAL) { - if (strings.common.fromAddress[0] != 0) { - ux_approval_tx_flow[step++] = &ux_approval_from_step; - } - } - ux_approval_tx_flow[step++] = &ux_plugin_approval_before_step; - ux_approval_tx_flow[step++] = &ux_plugin_approval_display_step; - ux_approval_tx_flow[step++] = &ux_plugin_approval_after_step; - } else { - if (tmpContent.txContent.dataPresent) { -#pragma GCC diagnostic ignored "-Wformat" - snprintf(strings.common.tx_hash, - sizeof(strings.common.tx_hash), - "0x%.*h", - sizeof(tmpCtx.transactionContext.hash), - tmpCtx.transactionContext.hash); -#pragma GCC diagnostic warning "-Wformat" - ux_approval_tx_flow[step++] = &ux_approval_tx_hash_step; - } - // We're in a regular transaction, just show the amount and the address - if (strings.common.fromAddress[0] != 0) { - ux_approval_tx_flow[step++] = &ux_approval_from_step; - } - if (!tmpContent.txContent.dataPresent || - !allzeroes(tmpContent.txContent.value.value, tmpContent.txContent.value.length)) { - ux_approval_tx_flow[step++] = &ux_approval_amount_step; - } -#ifdef HAVE_TRUSTED_NAME - uint64_t chain_id = get_tx_chain_id(); - e_name_type type = TN_TYPE_ACCOUNT; - e_name_source source = TN_SOURCE_ENS; - if (get_trusted_name(1, &type, 1, &source, &chain_id, tmpContent.txContent.destination) != - NULL) { - ux_approval_tx_flow[step++] = &ux_trusted_name_step; - if (N_storage.verbose_trusted_name) { - ux_approval_tx_flow[step++] = &ux_approval_to_step; - } - } else { -#endif // HAVE_TRUSTED_NAME - ux_approval_tx_flow[step++] = &ux_approval_to_step; -#ifdef HAVE_TRUSTED_NAME - } -#endif // HAVE_TRUSTED_NAME - } - - if (N_storage.displayNonce) { - ux_approval_tx_flow[step++] = &ux_approval_nonce_step; - } - - uint64_t chain_id = get_tx_chain_id(); - if ((chainConfig->chainId == ETHEREUM_MAINNET_CHAINID) && (chain_id != chainConfig->chainId)) { - ux_approval_tx_flow[step++] = &ux_approval_network_step; - } - - ux_approval_tx_flow[step++] = &ux_approval_fees_step; - if (tmpContent.txContent.dataPresent) { - ux_approval_tx_flow[step++] = &ux_approval_accept_blind_step; - } else { - ux_approval_tx_flow[step++] = &ux_approval_accept_step; - } - ux_approval_tx_flow[step++] = &ux_approval_reject_step; - ux_approval_tx_flow[step++] = FLOW_END_STEP; - - ux_flow_init(0, ux_approval_tx_flow, NULL); -} diff --git a/src_bagl/ui_gcs.c b/src_bagl/ui_gcs.c deleted file mode 100644 index ca0505bf76..0000000000 --- a/src_bagl/ui_gcs.c +++ /dev/null @@ -1,445 +0,0 @@ -#ifdef HAVE_GENERIC_TX_PARSER - -#include "ux.h" -#include "gtp_field_table.h" -#include "gtp_tx_info.h" -#include "feature_signTx.h" -#include "ui_callbacks.h" -#include "network.h" -#include "apdu_constants.h" - -// forward declaration for BAGL step -static void review_contract_info(void); -static void review(int index); -static void dyn_prev(void); -static void dyn_next(void); -static void switch_pre_dyn(void); -static void switch_post_dyn(void); -static void prepare_review_title(void); -static void switch_network(bool forward); -static void network_prev(void); -static void network_next(void); - -static void format_network(void) { - if (get_network_as_string(strings.tmp.tmp, sizeof(strings.tmp.tmp)) != APDU_RESPONSE_OK) { - PRINTF("Error: Could not format the network!\n"); - } -} - -static void format_fees(void) { - if (max_transaction_fee_to_string(&tmpContent.txContent.gasprice, - &tmpContent.txContent.startgas, - strings.tmp.tmp, - sizeof(strings.tmp.tmp)) == false) { - PRINTF("Error: Could not format the max fees!\n"); - } -} - -// clang-format off -UX_STEP_NOCB_INIT( - ui_gcs_review_step, - pnn, - prepare_review_title(), - { - &C_icon_eye, - strings.tmp.tmp2, - strings.tmp.tmp, - } -); -UX_STEP_CB( - ui_gcs_contract_info_btn_step, - pbb, - review_contract_info(), - { - &C_icon_certificate, - "See contract", - "information", - } -); -UX_STEP_CB( - ui_gcs_back_step, - pb, - review(1), - { - &C_icon_back_x, - "Back", - } -); -UX_STEP_INIT( - ui_gcs_switch_pre_network_step, - NULL, - NULL, - { - switch_network(true); - } -); -UX_STEP_INIT( - ui_gcs_network_prev_step, - NULL, - NULL, - { - network_prev(); - } -); -UX_STEP_NOCB_INIT( - ui_gcs_network_step, - bnnn_paging, - format_network(), - { - .title = "Network", - .text = strings.tmp.tmp, - } -); -UX_STEP_INIT( - ui_gcs_network_next_step, - NULL, - NULL, - { - network_next(); - } -); -UX_STEP_INIT( - ui_gcs_switch_post_network_step, - NULL, - NULL, - { - switch_network(false); - } -); -UX_STEP_NOCB_INIT( - ui_gcs_fees_step, - bnnn_paging, - format_fees(), - { - .title = "Max fees", - .text = strings.tmp.tmp, - } -); -UX_STEP_CB( - ui_gcs_accept_step, - pb, - tx_ok_cb(), - { - &C_icon_validate_14, - "Sign transaction", - } -); -UX_STEP_CB( - ui_gcs_reject_step, - pb, - tx_cancel_cb(), - { - &C_icon_crossmark, - "Reject", - } -); - -UX_STEP_INIT( - ui_gcs_dyn_prev_step, - NULL, - NULL, - { - dyn_prev(); - } -); -UX_STEP_NOCB( - ui_gcs_dyn_step, - bnnn_paging, - { - .title = strings.tmp.tmp2, - .text = strings.tmp.tmp, - } -); -UX_STEP_INIT( - ui_gcs_dyn_next_step, - NULL, - NULL, - { - dyn_next(); - } -); - -UX_STEP_INIT( - ui_gcs_switch_pre_dyn_step, - NULL, - NULL, - { - switch_pre_dyn(); - } -); -UX_STEP_INIT( - ui_gcs_switch_post_dyn_step, - NULL, - NULL, - { - switch_post_dyn(); - } -); -// clang-format on - -UX_FLOW(ui_gcs_flow, - &ui_gcs_review_step, - &ui_gcs_contract_info_btn_step, - - // dynamic field handling - &ui_gcs_switch_pre_dyn_step, - &ui_gcs_dyn_prev_step, - &ui_gcs_dyn_step, - &ui_gcs_dyn_next_step, - &ui_gcs_switch_post_dyn_step, - - // network handling - &ui_gcs_switch_pre_network_step, - &ui_gcs_network_prev_step, - &ui_gcs_network_step, - &ui_gcs_network_next_step, - &ui_gcs_switch_post_network_step, - - &ui_gcs_fees_step, - &ui_gcs_accept_step, - &ui_gcs_reject_step); - -UX_FLOW(ui_gcs_contract_info_beg_flow, &ui_gcs_switch_pre_dyn_step); - -UX_FLOW(ui_gcs_dyn_beg_flow, &ui_gcs_dyn_step, &ui_gcs_dyn_next_step); - -UX_FLOW(ui_gcs_dyn_middle_flow, &ui_gcs_dyn_prev_step, &ui_gcs_dyn_step, &ui_gcs_dyn_next_step); - -UX_FLOW(ui_gcs_contract_info_end_flow, &ui_gcs_switch_post_dyn_step, &ui_gcs_back_step); - -typedef enum { - TOP_LEVEL, - TX_INFO, -} e_level; - -static e_level level; -static uint8_t dyn_idx; - -static void prepare_review_title(void) { - const char *op_type; - - snprintf(strings.tmp.tmp2, sizeof(strings.tmp.tmp2), "Review transaction to"); - if ((op_type = get_operation_type()) != NULL) { - snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%s", op_type); - } -} - -static bool prepare_kv_info(uint8_t idx) { - bool found = false; - uint8_t count = 0; - const char *value; - - const char *value2; - if ((value = get_creator_legal_name()) != NULL) { - count += 1; - if (count == idx) { - snprintf(strings.tmp.tmp2, sizeof(strings.tmp.tmp2), "Contract owner"); - if ((value2 = get_creator_url()) != NULL) { - snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%s\n%s", value, value2); - } else { - snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%s", value); - } - found = true; - } - } - - if ((value = get_contract_name()) != NULL) { - count += 1; - if (count == idx) { - snprintf(strings.tmp.tmp2, sizeof(strings.tmp.tmp2), "Contract"); - snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%s", value); - found = true; - } - } - - const uint8_t *addr = get_contract_addr(); - count += 1; - if (count == idx) { - snprintf(strings.tmp.tmp2, sizeof(strings.tmp.tmp2), "Contract address"); - if (!getEthDisplayableAddress((uint8_t *) addr, - strings.tmp.tmp, - sizeof(strings.tmp.tmp), - chainConfig->chainId)) { - return false; - } - found = true; - } - - if ((value = get_deploy_date()) != NULL) { - count += 1; - if (count == idx) { - snprintf(strings.tmp.tmp2, sizeof(strings.tmp.tmp2), "Deployed on"); - snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "%s", value); - found = true; - } - } - return found; -} - -static bool prepare_key_value(uint8_t idx) { - bool found = false; - s_field_table_entry field; - - switch (level) { - case TX_INFO: - found = prepare_kv_info(idx); - break; - case TOP_LEVEL: - if ((found = get_from_field_table(idx - 1, &field))) { - strncpy(strings.tmp.tmp2, field.key, sizeof(strings.tmp.tmp2)); - strncpy(strings.tmp.tmp, field.value, sizeof(strings.tmp.tmp)); - } - break; - default: - break; - } - return found; -} - -static void dyn_prev(void) { - const ux_flow_step_t *const *flow = NULL; - const ux_flow_step_t *step = NULL; - - dyn_idx -= 1; - if (prepare_key_value(dyn_idx)) { - // found - switch (level) { - case TX_INFO: - flow = (dyn_idx == 1) ? ui_gcs_dyn_beg_flow : ui_gcs_dyn_middle_flow; - break; - case TOP_LEVEL: - flow = ui_gcs_flow; - break; - default: - break; - } - step = &ui_gcs_dyn_step; - } else { - // not found - switch (level) { - case TX_INFO: - flow = ui_gcs_contract_info_end_flow; - step = &ui_gcs_back_step; - break; - case TOP_LEVEL: - flow = ui_gcs_flow; - step = &ui_gcs_contract_info_btn_step; - break; - default: - break; - } - } - ux_flow_init(0, flow, step); -} - -static void dyn_next(void) { - const ux_flow_step_t *const *flow = NULL; - const ux_flow_step_t *step = NULL; - - dyn_idx += 1; - if (prepare_key_value(dyn_idx)) { - // found - switch (level) { - case TX_INFO: - flow = (dyn_idx == 1) ? ui_gcs_dyn_beg_flow : ui_gcs_dyn_middle_flow; - step = &ui_gcs_dyn_step; - break; - case TOP_LEVEL: - flow = ui_gcs_flow; - step = &ui_gcs_dyn_step; - break; - default: - break; - } - } else { - // not found - dyn_idx -= 1; - switch (level) { - case TX_INFO: - flow = ui_gcs_contract_info_end_flow; - step = &ui_gcs_back_step; - break; - case TOP_LEVEL: - flow = ui_gcs_flow; - step = &ui_gcs_switch_pre_network_step; - break; - default: - break; - } - } - ux_flow_init(0, flow, step); -} - -static void switch_pre_dyn(void) { - ux_flow_init(0, ui_gcs_flow, &ui_gcs_dyn_next_step); -} - -static void switch_post_dyn(void) { - const ux_flow_step_t *const *flow = NULL; - const ux_flow_step_t *step = NULL; - - switch (level) { - case TX_INFO: - flow = ui_gcs_dyn_middle_flow; - step = &ui_gcs_dyn_step; - break; - case TOP_LEVEL: - if (dyn_idx == 0) { - // no field has been shown - step = &ui_gcs_contract_info_btn_step; - } else { - // artificially lower the index then ask for the next one - dyn_idx -= 1; - step = &ui_gcs_dyn_next_step; - } - flow = ui_gcs_flow; - break; - default: - break; - } - ux_flow_init(0, flow, step); -} - -static void network_prev(void) { - ux_flow_init(0, ui_gcs_flow, &ui_gcs_switch_post_dyn_step); -} - -static void network_next(void) { - ux_flow_init(0, ui_gcs_flow, &ui_gcs_fees_step); -} - -static void switch_network(bool forward) { - uint64_t chain_id = get_tx_chain_id(); - - if (chain_id != chainConfig->chainId) { - ux_flow_init(0, ui_gcs_flow, &ui_gcs_network_step); - } else { - if (forward) { - network_next(); - } else { - network_prev(); - } - } -} - -static void review_contract_info(void) { - dyn_idx = 0; - level = TX_INFO; - ux_flow_init(0, ui_gcs_dyn_middle_flow, &ui_gcs_dyn_next_step); -} - -static void review(int index) { - dyn_idx = 0; - level = TOP_LEVEL; - ux_flow_init(0, ui_gcs_flow, ui_gcs_flow[index]); -} - -bool ui_gcs(void) { - review(0); - return true; -} - -void ui_gcs_cleanup(void) { -} - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_bagl/ui_plugin.c b/src_bagl/ui_plugin.c deleted file mode 100644 index e493bd9032..0000000000 --- a/src_bagl/ui_plugin.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "feature_signTx.h" -#include "ux.h" -#include "eth_plugin_handler.h" -#include "ui_callbacks.h" -#include "ui_plugin.h" -#include "plugins.h" - -// This function is not exported by the SDK -void ux_layout_paging_redisplay_by_addr(unsigned int stack_slot); - -void display_next_plugin_item(bool entering) { - if (entering) { - if (dataContext.tokenContext.pluginUiState == PLUGIN_UI_OUTSIDE) { - dataContext.tokenContext.pluginUiState = PLUGIN_UI_INSIDE; - dataContext.tokenContext.pluginUiCurrentItem = 0; - plugin_ui_get_item(); - ux_flow_next(); - } else { - if (dataContext.tokenContext.pluginUiCurrentItem > 0) { - dataContext.tokenContext.pluginUiCurrentItem--; - plugin_ui_get_item(); - ux_flow_next(); - } else { - dataContext.tokenContext.pluginUiState = PLUGIN_UI_OUTSIDE; - dataContext.tokenContext.pluginUiCurrentItem = 0; - ux_flow_prev(); - } - } - } else { - if (dataContext.tokenContext.pluginUiState == PLUGIN_UI_OUTSIDE) { - dataContext.tokenContext.pluginUiState = PLUGIN_UI_INSIDE; - plugin_ui_get_item(); - ux_flow_prev(); - } else { - if (dataContext.tokenContext.pluginUiCurrentItem < - dataContext.tokenContext.pluginUiMaxItems - 1) { - dataContext.tokenContext.pluginUiCurrentItem++; - plugin_ui_get_item(); - ux_flow_prev(); - // Reset multi page layout to the first page - G_ux.layout_paging.current = 0; - ux_layout_paging_redisplay_by_addr(G_ux.stack_count - 1); - } else { - dataContext.tokenContext.pluginUiState = PLUGIN_UI_OUTSIDE; - ux_flow_next(); - } - } - } -} diff --git a/src_bagl/ui_plugin.h b/src_bagl/ui_plugin.h deleted file mode 100644 index 2f9fe607e5..0000000000 --- a/src_bagl/ui_plugin.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _UI_PLUGIN_H_ -#define _UI_PLUGIN_H_ - -void display_next_plugin_item(bool entering); - -#endif // _UI_PLUGIN_H_ diff --git a/src_bagl/ui_trusted_name.c b/src_bagl/ui_trusted_name.c deleted file mode 100644 index c756520dfe..0000000000 --- a/src_bagl/ui_trusted_name.c +++ /dev/null @@ -1,17 +0,0 @@ -#ifdef HAVE_TRUSTED_NAME - -#include "ui_trusted_name.h" -#include "trusted_name.h" - -////////////////////////////////////////////////////////////////////// -// clang-format off -UX_STEP_NOCB( - ux_trusted_name_step, - bnnn_paging, - { - .title = "To (domain)", - .text = g_trusted_name - }); -// clang-format on - -#endif // HAVE_TRUSTED_NAME diff --git a/src_bagl/ui_trusted_name.h b/src_bagl/ui_trusted_name.h deleted file mode 100644 index ac76dcaaef..0000000000 --- a/src_bagl/ui_trusted_name.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef HAVE_TRUSTED_NAME - -#ifndef UI_TRUSTED_NAME_H_ -#define UI_TRUSTED_NAME_H_ - -#include "ux.h" - -extern const ux_flow_step_t ux_trusted_name_step; - -#endif // UI_TRUSTED_NAME_H_ - -#endif // HAVE_TRUSTED_NAME diff --git a/tests/ragger/snapshots/nanos/test_settings/blind_sign/00000.png b/tests/ragger/snapshots/nanos/test_settings/blind_sign/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/blind_sign/00001.png b/tests/ragger/snapshots/nanos/test_settings/blind_sign/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/blind_sign/00004.png b/tests/ragger/snapshots/nanos/test_settings/blind_sign/00004.png deleted file mode 100644 index cabccc8c58fb713305cb81db58e08c26d8209d14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 361 zcmV-v0ha!WP)sUIA$Cm zguQYpjyDWS5z3f}0AcAda~{x%apA@H_P7)R000000N42eVf)O!2GIiW00000NkvXX Hu0mjfMX{B- diff --git a/tests/ragger/snapshots/nanos/test_settings/blind_sign/00005.png b/tests/ragger/snapshots/nanos/test_settings/blind_sign/00005.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q0000Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/debug_token/00000.png b/tests/ragger/snapshots/nanos/test_settings/debug_token/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/debug_token/00001.png b/tests/ragger/snapshots/nanos/test_settings/debug_token/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/debug_token/00004.png b/tests/ragger/snapshots/nanos/test_settings/debug_token/00004.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q0000Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^Dq}JhqdG$Jqc#(L|?n0 zOA-Slx5BAQMBggwAYWba6HyECe_9;Lud!F<%3Y3h{dD{PjEa9#j|K=}pI#2IWE|#?BMQ6qb$|yz8))*VDC7={dAK^1 zpJ^m$opeoB2WZtb&g&^D*)gqF!o`ve4;D=bN<1=?hoFjHrlh@!m({?G2S`Fth01Jb z8DPc$LXLK9%%_%*_6FXL84tj@G=EI;!@SSB)gmQ?5JCtcZTSHV_|BkKg(u+v0000< KMNUMnLSTXyeVbwc diff --git a/tests/ragger/snapshots/nanos/test_settings/debug_token/00007.png b/tests/ragger/snapshots/nanos/test_settings/debug_token/00007.png deleted file mode 100644 index 70c9092564341e43d7d59a19a5caa26e875807e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmV+!0p|XRP)!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/eip712_token/00000.png b/tests/ragger/snapshots/nanos/test_settings/eip712_token/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/eip712_token/00001.png b/tests/ragger/snapshots/nanos/test_settings/eip712_token/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/eip712_token/00004.png b/tests/ragger/snapshots/nanos/test_settings/eip712_token/00004.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q0000Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple1/00000.png b/tests/ragger/snapshots/nanos/test_settings/multiple1/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple1/00001.png b/tests/ragger/snapshots/nanos/test_settings/multiple1/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple1/00004.png b/tests/ragger/snapshots/nanos/test_settings/multiple1/00004.png deleted file mode 100644 index cabccc8c58fb713305cb81db58e08c26d8209d14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 361 zcmV-v0ha!WP)sUIA$Cm zguQYpjyDWS5z3f}0AcAda~{x%apA@H_P7)R000000N42eVf)O!2GIiW00000NkvXX Hu0mjfMX{B- diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple1/00005.png b/tests/ragger/snapshots/nanos/test_settings/multiple1/00005.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q0000Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^Dq}JhqdG$Jqc#(L|?n0 zOA-Slx5BAQMBggwAYWba6HyECe_9;Lud!F<%3Y3h{dD{PjEa9#j|K=}pI#2IWE|#?BMQ6qb$|yz8))*VDC7={dAK^1 zpJ^m$opeoB2WZtb&g&^D*)gqF!o`ve4;D=bN<1=?hoFjHrlh@!m({?G2S`Fth01Jb z8DPc$LXLK9%%_%*_6FXL84tj@G=EI;!@SSB)gmQ?5JCtcZTSHV_|BkKg(u+v0000< KMNUMnLSTXyeVbwc diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple1/00008.png b/tests/ragger/snapshots/nanos/test_settings/multiple1/00008.png deleted file mode 100644 index 70c9092564341e43d7d59a19a5caa26e875807e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmV+!0p|XRP)!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple2/00000.png b/tests/ragger/snapshots/nanos/test_settings/multiple2/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple2/00001.png b/tests/ragger/snapshots/nanos/test_settings/multiple2/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple2/00004.png b/tests/ragger/snapshots/nanos/test_settings/multiple2/00004.png deleted file mode 100644 index cabccc8c58fb713305cb81db58e08c26d8209d14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 361 zcmV-v0ha!WP)sUIA$Cm zguQYpjyDWS5z3f}0AcAda~{x%apA@H_P7)R000000N42eVf)O!2GIiW00000NkvXX Hu0mjfMX{B- diff --git a/tests/ragger/snapshots/nanos/test_settings/multiple2/00005.png b/tests/ragger/snapshots/nanos/test_settings/multiple2/00005.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q0000Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/nonce/00000.png b/tests/ragger/snapshots/nanos/test_settings/nonce/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/nonce/00001.png b/tests/ragger/snapshots/nanos/test_settings/nonce/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/nonce/00004.png b/tests/ragger/snapshots/nanos/test_settings/nonce/00004.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q000091ifeB0K>~02tx<~0001}%)0cR!IO#VH?zUW#(uXO zD#0Il)Bz{wUwkA6beNEcXFLVcN7O9X;>2rlfead59;8nM~5VF-e%|knf zE$d?OJ2o!pPP!*-Jdce5SoaDzY8xOwIm6EjP4k~SDrWQE^y3D_BHbIPSX1BdDp<3o z6y$~a4cHYK>NkUt8tOL&Hs}ewP)|Ib!|{@N;;LB;LL6;t4H=Z&1A0Z828eLgfc$2| zXy_r>2&G)enoy2?f-lqs36a#iL=I#M3AWoFxY+?37j!~0A1VvDF@O^KETgIK7=!l! wa0E9yKpATk&I8(zhA?mTMg#x=001y7AJZDh<+Fa$dH?_b07*qoM6N<$f<Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/trusted_name/00000.png b/tests/ragger/snapshots/nanos/test_settings/trusted_name/00000.png deleted file mode 100644 index ce795f34e8569e986af689fded3b59c9a8af2961..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/snapshots/nanos/test_settings/trusted_name/00001.png b/tests/ragger/snapshots/nanos/test_settings/trusted_name/00001.png deleted file mode 100644 index 783d3053742268f33c113030b13ae32c95771cbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmV-$0gwKPP)C_6G=d8VVUlCqWoCg4G~d<5JCtU#=gnE70O>;Y7*X~C-5lC zI(i0|0X9I#a#D8RWLb~;TreF(*^oQv8a)ueu-E7bIAkfcvLb~HllypAFr$(OFaWH8 z6p}hB1G(iCwkGPmfnd6401OC-B{Nn*>RSae1+`1*<)3pUsy!G6WOYm-r6zA@sark8 zy;fXi+ec4EMP91k0as+I-;ILQRKGLyU?j{!BSCo%SNE6Zr`Nyn1QaB;K&Elb!xJ=a zD%MnQ4CT%(gN`DCH=}1?nqni1YxI z+A~AT;SW-hnZ$s0ZiuVDvULZ>fJ;xm+&R|He6~DSA}s|%2qA=!zv2TPgSj=#-b1SZ O0000zb zYUyh@!@w4RqJAy6Yb4==Uce=c(1f~kvM!tcvwukfX9XlMdTGv?{=!-TMr%&#m1Y;T zF41Qi^)~cCUZPaep2OIAx(lXz5?&msQ~kkY43K0OLUJH-#^6y>-e?3k4ZVM|uO2Ag z1Hy4~BmWoYZZ7BwaFf^6#J<+$26dvZn&t~Z>%q9iRZonwAd}r9GR+%76*Zbm*PCmv z|5zKLy$c0xmr(P`|^*xxJp zcRsK?tMekhljq;Ju&n1zB0fnSDr58htW<1e#p_d35wFnv6Sz>g4HW8$;z>obW$M9^ z_Zg~wvaILT{bT&+rP(Q{g(CChM8`DdjV>a0cy>S}23BFFE>=^?`zj82oG9v9t5}4E zO>(-3{2f;-v%ZK#S!odl2@=!GtT!3R)saG9q#};AHW~jLXwSg diff --git a/tests/ragger/snapshots/nanos/test_settings/trusted_name/00004.png b/tests/ragger/snapshots/nanos/test_settings/trusted_name/00004.png deleted file mode 100644 index e615d310ff279a75b89fb03d84eb47700c8839a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmV-q0h|7bP)JK9#HPjyrd@vJ4p_!;Vhus?{eHvy`Ohw%7D~HA#565BY${q8bY-5x5T! z;$^oB7dm!8>QXTHH4}w0hcHiMzSNfh000003vmLRk=(JeQa|?q0000Bu5MViJfU5JCv~SEl|8$c6%r*n4y!O|oihjax6kh60Y@+*#kNfMS%B(GLXSu;s54O(a1T z3?gl)_om3g4AkiNwRYH;q>E>WcvL_D^YronlGpP6IifIIUk@+<)Im>%@2#%0wyd-wDGOAW1$3 z?6}=39uyEgk4zthmSr`ZuzU2LfSOuz%{ewK0DlYAgisKK^K9#&x+H`ULI`oh8`far UY)XF^!K+QeHhma8fajIMn6j5mW;$e;{O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA diff --git a/tests/ragger/test_blind_sign.py b/tests/ragger/test_blind_sign.py index ec208170dc..451e62fddb 100644 --- a/tests/ragger/test_blind_sign.py +++ b/tests/ragger/test_blind_sign.py @@ -1,7 +1,6 @@ from pathlib import Path import json from typing import Optional -import time import pytest from web3 import Web3 @@ -153,9 +152,6 @@ def test_blind_sign_reject_in_risk_review(firmware: Firmware, navigator: Navigator): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on Nano S devices") - settings_toggle(firmware, navigator, [SettingID.BLIND_SIGNING]) moves = [] @@ -192,16 +188,10 @@ def test_sign_parameter_selector(firmware: Firmware, if firmware.is_nano: # verify | selector moves += [NavInsID.RIGHT_CLICK] * 2 + [NavInsID.BOTH_CLICK] - if firmware == Firmware.NANOS: - moves += ([NavInsID.RIGHT_CLICK] * 4 + [NavInsID.BOTH_CLICK]) * params - # blind signing | review | tx hash | from | to | fees - moves += [NavInsID.RIGHT_CLICK] * 13 - else: - # (verify | parameter) * flows - moves += ([NavInsID.RIGHT_CLICK] * 2 + [NavInsID.BOTH_CLICK]) * params - # blind signing | review | from | amount | to | fees - moves += [NavInsID.BOTH_CLICK] + [NavInsID.RIGHT_CLICK] * 6 - moves += [NavInsID.BOTH_CLICK] + # (verify | parameter) * flows + moves += ([NavInsID.RIGHT_CLICK] * 2 + [NavInsID.BOTH_CLICK]) * params + # blind signing | review | from | amount | to | fees + moves += [NavInsID.BOTH_CLICK] + [NavInsID.RIGHT_CLICK] * 6 + [NavInsID.BOTH_CLICK] else: moves += ([NavInsID.SWIPE_CENTER_TO_LEFT] * 2 + [NavInsID.USE_CASE_REVIEW_CONFIRM]) * (1 + params) moves += [NavInsID.USE_CASE_CHOICE_REJECT] @@ -229,9 +219,6 @@ def test_blind_sign_not_enabled_error(firmware: Firmware, with app_client.sign(BIP32_PATH, common_tx_params(0.0)): moves = [] if firmware.is_nano: - if firmware == Firmware.NANOS: - time.sleep(0.5) # seems to take some time - moves += [NavInsID.RIGHT_CLICK] moves += [NavInsID.BOTH_CLICK] else: moves += [NavInsID.USE_CASE_CHOICE_REJECT] diff --git a/tests/ragger/test_eip191.py b/tests/ragger/test_eip191.py index b7fbda65a9..5a06dd0738 100644 --- a/tests/ragger/test_eip191.py +++ b/tests/ragger/test_eip191.py @@ -1,11 +1,9 @@ from pathlib import Path from typing import Optional -import pytest from Crypto.Hash import keccak from ragger.error import ExceptionRAPDU from ragger.backend import BackendInterface -from ragger.firmware import Firmware from ragger.navigator import Navigator, NavInsID from ragger.navigator.navigation_scenario import NavigateWithScenario @@ -94,16 +92,12 @@ def test_personal_sign_non_ascii(backend: BackendInterface, common(backend, navigator, scenario_navigator, default_screenshot_path, test_name, msg) -def test_personal_sign_opensea(firmware: Firmware, - backend: BackendInterface, +def test_personal_sign_opensea(backend: BackendInterface, navigator: Navigator, scenario_navigator: NavigateWithScenario, default_screenshot_path: Path, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - msg = "Welcome to OpenSea!\n\n" msg += "Click to sign in and accept the OpenSea Terms of Service: https://opensea.io/tos\n\n" msg += "This request will not trigger a blockchain transaction or cost any gas fees.\n\n" diff --git a/tests/ragger/test_eip712.py b/tests/ragger/test_eip712.py index dc717dd0c2..87b2b2ee34 100644 --- a/tests/ragger/test_eip712.py +++ b/tests/ragger/test_eip712.py @@ -96,11 +96,8 @@ def test_eip712_v0(firmware: Firmware, with app_client.eip712_sign_legacy(BIP32_PATH, smsg.header, smsg.body): moves = [] if firmware.is_nano: - if firmware == Firmware.NANOS: - moves += [NavInsID.RIGHT_CLICK] * 10 - else: - moves += [NavInsID.BOTH_CLICK] - moves += [NavInsID.RIGHT_CLICK] * 5 + moves += [NavInsID.BOTH_CLICK] + moves += [NavInsID.RIGHT_CLICK] * 5 moves += [NavInsID.BOTH_CLICK] else: moves += [NavInsID.USE_CASE_CHOICE_REJECT] @@ -117,7 +114,7 @@ def autonext(firmware: Firmware, navigator: Navigator, default_screenshot_path: moves = [] if firmware.is_nano: - if firmware != Firmware.NANOS and autonext_idx == 0 and validate_warning: + if autonext_idx == 0 and validate_warning: moves = [NavInsID.BOTH_CLICK] else: moves = [NavInsID.RIGHT_CLICK] @@ -170,7 +167,7 @@ def eip712_new_common(firmware: Firmware, if firmware.is_nano: nav_ins = NavInsID.RIGHT_CLICK val_ins = NavInsID.BOTH_CLICK - text = "Approve" if firmware == Firmware.NANOS else "Sign message" + text = "Sign message" else: nav_ins = NavInsID.SWIPE_CENTER_TO_LEFT val_ins = NavInsID.USE_CASE_REVIEW_CONFIRM @@ -208,8 +205,6 @@ def test_eip712_new(firmware: Firmware, settings_to_toggle: list[SettingID] = [] app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") filters = None if filtering: @@ -474,8 +469,6 @@ def test_eip712_advanced_filtering(firmware: Firmware, global snapshots_dirname app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") snapshots_dirname = test_name + data_set.suffix @@ -503,8 +496,6 @@ def test_eip712_filtering_empty_array(firmware: Firmware, global validate_warning app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") snapshots_dirname = test_name @@ -633,8 +624,6 @@ def test_eip712_advanced_missing_token(firmware: Firmware, snapshots_dirname = test_name app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") data = { "types": { @@ -742,8 +731,6 @@ def test_eip712_advanced_trusted_name(firmware: Firmware, snapshots_dirname = test_name app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") data = { "types": { @@ -816,8 +803,6 @@ def test_eip712_bs_not_activated_error(firmware: Firmware, navigator: Navigator, default_screenshot_path: Path): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") with pytest.raises(ExceptionRAPDU) as e: eip712_new_common(firmware, @@ -866,8 +851,6 @@ def test_eip712_proxy(firmware: Firmware, navigator: Navigator, default_screenshot_path: Path): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") input_file = input_files()[0] with open(input_file, encoding="utf-8") as file: diff --git a/tests/ragger/test_eip7702.py b/tests/ragger/test_eip7702.py index 1c261204b8..54c126a932 100644 --- a/tests/ragger/test_eip7702.py +++ b/tests/ragger/test_eip7702.py @@ -1,5 +1,4 @@ from typing import Optional -import pytest from ragger.error import ExceptionRAPDU from ragger.backend import BackendInterface @@ -72,8 +71,7 @@ def common_rejected(firmware: Firmware, with app_client.sign_eip7702_authorization(BIP32_PATH, auth_params): moves = [] if firmware.is_nano: - if firmware != Firmware.NANOS: - moves += [NavInsID.RIGHT_CLICK] * 3 + moves += [NavInsID.RIGHT_CLICK] * 3 moves += [NavInsID.BOTH_CLICK] else: moves += [NavInsID.USE_CASE_CHOICE_REJECT] @@ -91,8 +89,6 @@ def test_eip7702_in_whitelist(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common(backend, scenario_navigator, @@ -106,8 +102,6 @@ def test_eip7702_in_whitelist_all_chain_whitelisted(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common(backend, scenario_navigator, @@ -122,8 +116,6 @@ def test_eip7702_in_whitelist_all_chain_param(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common(backend, scenario_navigator, @@ -137,8 +129,6 @@ def test_eip7702_in_whitelist_max(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common(backend, scenario_navigator, @@ -152,8 +142,6 @@ def test_eip7702_in_whitelist_wrong_chain(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common_rejected(firmware, backend, scenario_navigator, test_name, TEST_ADDRESS_2, NONCE, CHAIN_ID_1) @@ -162,8 +150,6 @@ def test_eip7702_not_in_whitelist(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common_rejected(firmware, backend, scenario_navigator, test_name, TEST_ADDRESS_NO_WHITELIST, NONCE, CHAIN_ID_1) @@ -172,8 +158,6 @@ def test_eip7702_not_enabled(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") common_rejected(firmware, backend, scenario_navigator, test_name, TEST_ADDRESS_1, NONCE, CHAIN_ID_1) @@ -181,8 +165,6 @@ def test_eip7702_revocation(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") settings_toggle(firmware, scenario_navigator.navigator, [SettingID.EIP7702]) common(backend, scenario_navigator, diff --git a/tests/ragger/test_gcs.py b/tests/ragger/test_gcs.py index 28d54b6e9e..367bf676bd 100644 --- a/tests/ragger/test_gcs.py +++ b/tests/ragger/test_gcs.py @@ -2,11 +2,9 @@ import struct import json import hashlib -import pytest from web3 import Web3 from ragger.backend import BackendInterface -from ragger.firmware import Firmware from ragger.navigator.navigation_scenario import NavigateWithScenario @@ -24,15 +22,11 @@ from client.proxy_info import ProxyInfo -def test_gcs_nft(firmware: Firmware, - backend: BackendInterface, +def test_gcs_nft(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - with open(f"{ABIS_FOLDER}/erc1155.json", encoding="utf-8") as file: contract = Web3().eth.contract( abi=json.load(file), @@ -226,16 +220,12 @@ def test_gcs_nft(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_gcs_poap(firmware: Firmware, - backend: BackendInterface, +def test_gcs_poap(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str, simu_params: Optional[TxSimu] = None): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - with open(f"{ABIS_FOLDER}/poap.abi.json", encoding="utf-8") as file: contract = Web3().eth.contract( abi=json.load(file), @@ -406,15 +396,11 @@ def test_gcs_poap(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_gcs_1inch(firmware: Firmware, - backend: BackendInterface, +def test_gcs_1inch(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - with open(f"{ABIS_FOLDER}/1inch.abi.json", encoding="utf-8") as file: contract = Web3().eth.contract( abi=json.load(file), @@ -571,15 +557,11 @@ def test_gcs_1inch(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_gcs_proxy(firmware: Firmware, - backend: BackendInterface, +def test_gcs_proxy(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - new_owner = bytes.fromhex("2222222222222222222222222222222222222222") with open(f"{ABIS_FOLDER}/proxy_implem.abi.json", encoding="utf-8") as file: @@ -685,15 +667,11 @@ def test_gcs_proxy(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_gcs_4226(firmware: Firmware, - backend: BackendInterface, +def test_gcs_4226(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - with open(f"{ABIS_FOLDER}/rSWELL.abi.json", encoding="utf-8") as file: contract = Web3().eth.contract( abi=json.load(file), diff --git a/tests/ragger/test_get_address.py b/tests/ragger/test_get_address.py index a7982ffb54..322ec0e01a 100644 --- a/tests/ragger/test_get_address.py +++ b/tests/ragger/test_get_address.py @@ -74,7 +74,7 @@ def test_get_pk(firmware: Firmware, icon = "400040002188010086011f8b08000000000002ffbd55416ac33010943018422f0e855c42fee01e4b09f94a7a0c3df82b3905440ffd4243a1507ae81b4c1e9047180a2604779d58f6ae7664e8250b0ec613ad7646b3aba6b949fc9a2eee8f105f7bdc14083e653d3e1f4d6f4c82f0ed809b3780e70c5f6ab8a6cf8f1b474175a41a2f8db1d7b47b7a3b2276c9506881d8cd87d7bb10afd8a2356048ec12bfe90130cc59d12d9585166f05ffdcb363295b863f21bb54662bfe85cb8ca522402bec2a92ad8d336936e9b50416e19a55e000f837d2d2a2e3f79a7d39f78aec938eb9bf549ae91378fa16a118ca982ea3febe46aa18ca90f59c14ce1c21fbd3c744e087cc582a921e7bf9552a4a761fb1461f39c5114f75f1b9732f5117499f484f813ec84386416f6f75a30b17689fd519ef3cd6f3b83114c300a7dd66b129a276d3a3a3d20209cdc09ce1fac039c50480738e09b8471dc116c18e1a18d6784eb7453bb773ee19cff9d29b37c3f744cdfc0dedc7ee0968dff7487fe97b0acf8bf3c3b48be236f772f307b129c97400080000" # pylint: enable=line-too-long - if firmware != Firmware.NANOS and name: + if name: app_client.provide_network_information(name, ticker, chain, bytes.fromhex(icon)) test_name += f"_{chain}" @@ -89,8 +89,7 @@ def test_get_pk(firmware: Firmware, assert chaincode.hex() == ref_chaincode -def test_get_eth2_pk(firmware: Firmware, - backend: BackendInterface, +def test_get_eth2_pk(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): @@ -101,8 +100,7 @@ def test_get_eth2_pk(firmware: Firmware, scenario_navigator.address_review_approve(test_name=test_name) pk = app_client.response().data + pk = pk[1:49] ref_pk = bls.SkToPk(mnemonic_and_path_to_key(SPECULOS_MNEMONIC, path)) - if firmware != Firmware.NANOS: - pk = pk[1:49] assert pk == ref_pk diff --git a/tests/ragger/test_nft.py b/tests/ragger/test_nft.py index ff59fc36e8..349ed2a7c1 100644 --- a/tests/ragger/test_nft.py +++ b/tests/ragger/test_nft.py @@ -60,9 +60,6 @@ def common_test_nft(firmware: Firmware, global DEVICE_ADDR app_client = EthAppClient(backend) - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") - data = collec.contract.encode_abi(action.fn_name, action.fn_args) tx_params = { "nonce": NONCE, diff --git a/tests/ragger/test_sign.py b/tests/ragger/test_sign.py index 812d205eca..07f227c55a 100644 --- a/tests/ragger/test_sign.py +++ b/tests/ragger/test_sign.py @@ -1,4 +1,3 @@ -import pytest from web3 import Web3 from ragger.error import ExceptionRAPDU @@ -57,7 +56,7 @@ def common(firmware: Firmware, icon = "4000400021ff0100fd011f8b08000000000002ffdd554b6ac330101d61f0225090307861c81d5c0c5d1482afe20b945c293941aed2e05d21e810012d0c42d58c64eb63d7dd475944d14833f3deccbc18f322ebf190c6e8875f32373f016a6314e32000b8e873fb0580dd8c69c1ad32336b6e0f7bba468b6501141e1e288c5be7d47e07a8aa0feba77bc70fc031b7c71e6db422f75f67d9ded20b6d8268a4649317c9fd69857022f21c85f6e790e4a3683f0a61112a214e84274278a5fd005048ccbd243e0e51720d46e08e960189d66d8470a26488c223e57e4e118eb4bff8ba4ca26a288d258121d8712311809652063617ffd0af3b47b96a5089578527b2d98c6f5d7844e70fef14e08bfacfcc44126ea48d4847070297757815e2166a75899acfb712774de2d0617dafc1cec86fbda0539e7488fa8f88f66ea8bf1c42b7dee8ac0f762c5df4fe38dba77ffcfbaff6148663c9aff4b460ee6b7c7e082c2dcd8a9f3ef0639f157bfc62d8ddfa2860a1bef5babe737fa09d6df4874748ece3466b7a25636d99fbafc0fe149ff6ac0b1a33f1d2786958684d2698e64327f39128c0325f8c8ae44ad144088d9fcf667b3edd7c9b68be674e4388541f783e08a9be3cf34152e9fd21d7a795be65eebfad3e76561fa7aeeb2ad4c7665f5fd9795f9f0bb9a9effa2f7d37231748abe08201dbf87ff0e2f843ddf7f378957f4df30b82b2cf8e00080000" # pylint: enable=line-too-long - if firmware != Firmware.NANOS and name: + if name: app_client.provide_network_information(name, ticker, tx_params["chainId"], bytes.fromhex(icon)) with app_client.get_public_addr(bip32_path=path, display=False): @@ -322,8 +321,6 @@ def test_sign_eip_7702(firmware: Firmware, backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") tx_params = { "chainId": 1, "nonce": 1337, diff --git a/tests/ragger/test_trusted_name.py b/tests/ragger/test_trusted_name.py index da019af5af..df86895e3d 100644 --- a/tests/ragger/test_trusted_name.py +++ b/tests/ragger/test_trusted_name.py @@ -31,10 +31,7 @@ def verbose_ens_fixture(request) -> bool: return request.param -def common(firmware: Firmware, app_client: EthAppClient, get_challenge: bool = True) -> Optional[int]: - - if firmware == Firmware.NANOS: - pytest.skip("Not supported on LNS") +def common(app_client: EthAppClient, get_challenge: bool = True) -> Optional[int]: if get_challenge: challenge = app_client.get_challenge() @@ -49,7 +46,7 @@ def test_trusted_name_v1(firmware: Firmware, verbose_ens: bool, test_name: str): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) if verbose_ens: settings_toggle(firmware, navigator, [SettingID.VERBOSE_ENS]) @@ -69,21 +66,20 @@ def test_trusted_name_v1(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_trusted_name_v1_wrong_challenge(firmware: Firmware, backend: BackendInterface): +def test_trusted_name_v1_wrong_challenge(backend: BackendInterface): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) with pytest.raises(ExceptionRAPDU) as e: app_client.provide_trusted_name_v1(ADDR, NAME, ~challenge & 0xffffffff) assert e.value.status == StatusWord.INVALID_DATA -def test_trusted_name_v1_wrong_addr(firmware: Firmware, - backend: BackendInterface, +def test_trusted_name_v1_wrong_addr(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) app_client.provide_trusted_name_v1(ADDR, NAME, challenge) @@ -108,7 +104,7 @@ def test_trusted_name_v1_non_mainnet(firmware: Firmware, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) chain_id = 5 if firmware.is_nano: @@ -137,12 +133,11 @@ def test_trusted_name_v1_non_mainnet(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_trusted_name_v1_unknown_chain(firmware: Firmware, - backend: BackendInterface, +def test_trusted_name_v1_unknown_chain(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) app_client.provide_trusted_name_v1(ADDR, NAME, challenge) @@ -159,48 +154,47 @@ def test_trusted_name_v1_unknown_chain(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_trusted_name_v1_name_too_long(firmware: Firmware, backend: BackendInterface): +def test_trusted_name_v1_name_too_long(backend: BackendInterface): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) with pytest.raises(ExceptionRAPDU) as e: app_client.provide_trusted_name_v1(ADDR, "ledger" + "0"*25 + ".eth", challenge) assert e.value.status == StatusWord.INVALID_DATA -def test_trusted_name_v1_name_invalid_character(firmware: Firmware, backend: BackendInterface): +def test_trusted_name_v1_name_invalid_character(backend: BackendInterface): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) with pytest.raises(ExceptionRAPDU) as e: app_client.provide_trusted_name_v1(ADDR, "l\xe8dger.eth", challenge) assert e.value.status == StatusWord.INVALID_DATA -def test_trusted_name_v1_uppercase(firmware: Firmware, backend: BackendInterface): +def test_trusted_name_v1_uppercase(backend: BackendInterface): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) with pytest.raises(ExceptionRAPDU) as e: app_client.provide_trusted_name_v1(ADDR, NAME.upper(), challenge) assert e.value.status == StatusWord.INVALID_DATA -def test_trusted_name_v1_name_non_ens(firmware: Firmware, backend: BackendInterface): +def test_trusted_name_v1_name_non_ens(backend: BackendInterface): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) with pytest.raises(ExceptionRAPDU) as e: app_client.provide_trusted_name_v1(ADDR, "ledger.hte", challenge) assert e.value.status == StatusWord.INVALID_DATA -def test_trusted_name_v2(firmware: Firmware, - backend: BackendInterface, +def test_trusted_name_v2(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) app_client.provide_trusted_name_v2(ADDR, NAME, @@ -222,12 +216,11 @@ def test_trusted_name_v2(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_trusted_name_v2_wrong_chainid(firmware: Firmware, - backend: BackendInterface, +def test_trusted_name_v2_wrong_chainid(backend: BackendInterface, scenario_navigator: NavigateWithScenario, test_name: str): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) app_client.provide_trusted_name_v2(ADDR, NAME, @@ -249,9 +242,9 @@ def test_trusted_name_v2_wrong_chainid(firmware: Firmware, scenario_navigator.review_approve(test_name=test_name) -def test_trusted_name_v2_missing_challenge(firmware: Firmware, backend: BackendInterface): +def test_trusted_name_v2_missing_challenge(backend: BackendInterface): app_client = EthAppClient(backend) - common(firmware, app_client, False) + common(app_client, False) with pytest.raises(ExceptionRAPDU) as e: app_client.provide_trusted_name_v2(ADDR, @@ -262,9 +255,9 @@ def test_trusted_name_v2_missing_challenge(firmware: Firmware, backend: BackendI assert e.value.status == StatusWord.INVALID_DATA -def test_trusted_name_v2_expired(firmware: Firmware, backend: BackendInterface, app_version: tuple[int, int, int]): +def test_trusted_name_v2_expired(backend: BackendInterface, app_version: tuple[int, int, int]): app_client = EthAppClient(backend) - challenge = common(firmware, app_client) + challenge = common(app_client) # convert to list and reverse app_version = list(app_version) diff --git a/tests/ragger/test_tx_simulation.py b/tests/ragger/test_tx_simulation.py index 087d521803..55b18602ee 100644 --- a/tests/ragger/test_tx_simulation.py +++ b/tests/ragger/test_tx_simulation.py @@ -369,8 +369,7 @@ def test_tx_simulation_gcs(firmware: Firmware, simu_params = __get_simu_params("warning", SimuType.TRANSACTION) - sign_gcs_poap(firmware, - backend, + sign_gcs_poap(backend, scenario_navigator, test_name, simu_params) diff --git a/tests/ragger/usage.md b/tests/ragger/usage.md index a7f83e1f45..beea2e9287 100644 --- a/tests/ragger/usage.md +++ b/tests/ragger/usage.md @@ -20,7 +20,7 @@ You can use for this the container `ghcr.io/ledgerhq/ledger-app-builder/ledger-a 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 [NANOX, NANOSP, STAX, FLEX] exit ``` @@ -43,7 +43,7 @@ You can use for this the container `ghcr.io/ledgerhq/ledger-app-builder/ledger-a docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest cd app-/ # replace with the name of your app, (eg boilerplate) 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 [NANOX, NANOSP, STAX, FLEX] exit ``` @@ -84,7 +84,7 @@ Custom pytest options ```shell --with_lib_mode run the test(s) dedicated to Library Mode - --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 [nanox,nanosp,stax,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 on Speculos, screen comparison functions will save the current screen instead of comparing diff --git a/tools/copy_clones.sh b/tools/copy_clones.sh index 71c7d043ae..1a065d13e2 100755 --- a/tools/copy_clones.sh +++ b/tools/copy_clones.sh @@ -1,6 +1,6 @@ #!/bin/bash -DEVICES=(nanos nanos2 nanox stax flex) +DEVICES=(nanos2 nanox stax flex) for dev in "${DEVICES[@]}"; do elf_file="build/${dev}/bin/app.elf" From a69953c216e393b780f924887d8127d2b2949cb6 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 08:44:05 +0200 Subject: [PATCH 02/13] Remove useless flag 'HAVE_NFT_SUPPORT' --- makefile_conf/features.mk | 1 - src/eth_plugin_handler.c | 4 ---- src/main.c | 2 -- src_features/generic_tx_parser/gtp_field.c | 8 -------- src_features/generic_tx_parser/gtp_field.h | 2 -- src_features/generic_tx_parser/gtp_param_nft.c | 2 -- src_features/generic_tx_parser/gtp_param_nft.h | 4 ---- src_features/provideNFTInformation/cmd_provideNFTInfo.c | 4 ---- src_features/provide_trusted_name/trusted_name.c | 4 ---- src_features/provide_trusted_name/trusted_name.h | 2 -- src_plugins/erc1155/erc1155_plugin.c | 4 ---- src_plugins/erc1155/erc1155_plugin.h | 4 ---- src_plugins/erc1155/erc1155_provide_parameters.c | 4 ---- src_plugins/erc1155/erc1155_ui.c | 4 ---- src_plugins/erc721/erc721_plugin.c | 4 ---- src_plugins/erc721/erc721_plugin.h | 4 ---- src_plugins/erc721/erc721_provide_parameters.c | 4 ---- src_plugins/erc721/erc721_ui.c | 4 ---- tests/fuzzing/CMakeLists.txt | 1 - 19 files changed, 66 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 0476f29cce..949ecdf17b 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -13,7 +13,6 @@ ifneq ($(SET_PLUGIN_TEST_KEY),0) endif # NFTs -DEFINES += HAVE_NFT_SUPPORT NFT_TEST_KEY ?= 0 ifneq ($(NFT_TEST_KEY),0) DEFINES += HAVE_NFT_TEST_KEY diff --git a/src/eth_plugin_handler.c b/src/eth_plugin_handler.c index 2924ea1883..20a1e7ea58 100644 --- a/src/eth_plugin_handler.c +++ b/src/eth_plugin_handler.c @@ -135,10 +135,8 @@ eth_plugin_result_t eth_plugin_perform_init(uint8_t *contractAddress, PRINTF("Selector %.*H\n", 4, init->selector); switch (pluginType) { -#ifdef HAVE_NFT_SUPPORT case ERC1155: case ERC721: -#endif // HAVE_NFT_SUPPORT case EXTERNAL: PRINTF("eth_plugin_perform_init_default\n"); eth_plugin_perform_init_default(contractAddress, init); @@ -285,7 +283,6 @@ eth_plugin_result_t eth_plugin_call(int method, void *parameter) { swap_with_calldata_plugin_call(method, parameter); break; } -#ifdef HAVE_NFT_SUPPORT case ERC721: { erc721_plugin_call(method, parameter); break; @@ -294,7 +291,6 @@ eth_plugin_result_t eth_plugin_call(int method, void *parameter) { erc1155_plugin_call(method, parameter); break; } -#endif // HAVE_NFT_SUPPORT case OLD_INTERNAL: { // Perform the call for (i = 0;; i++) { diff --git a/src/main.c b/src/main.c index ce29a2376a..c5c278007c 100644 --- a/src/main.c +++ b/src/main.c @@ -160,11 +160,9 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { sw = handleProvideErc20TokenInformation(cmd->data, cmd->lc, tx); break; -#ifdef HAVE_NFT_SUPPORT case INS_PROVIDE_NFT_INFORMATION: sw = handleProvideNFTInformation(cmd->data, cmd->lc, tx); break; -#endif // HAVE_NFT_SUPPORT case INS_SET_EXTERNAL_PLUGIN: sw = handleSetExternalPlugin(cmd->data, cmd->lc); diff --git a/src_features/generic_tx_parser/gtp_field.c b/src_features/generic_tx_parser/gtp_field.c index 4e3e35fd1e..1be34edfc2 100644 --- a/src_features/generic_tx_parser/gtp_field.c +++ b/src_features/generic_tx_parser/gtp_field.c @@ -23,9 +23,7 @@ typedef union { s_param_raw_context raw_ctx; s_param_amount_context amount_ctx; s_param_token_amount_context token_amount_ctx; -#ifdef HAVE_NFT_SUPPORT s_param_nft_context nft_ctx; -#endif s_param_datetime_context datetime_ctx; s_param_duration_context duration_ctx; s_param_unit_context unit_ctx; @@ -69,9 +67,7 @@ static bool handle_param_type(const s_tlv_data *data, s_field_ctx *context) { case PARAM_TYPE_RAW: case PARAM_TYPE_AMOUNT: case PARAM_TYPE_TOKEN_AMOUNT: -#ifdef HAVE_NFT_SUPPORT case PARAM_TYPE_NFT: -#endif case PARAM_TYPE_DATETIME: case PARAM_TYPE_DURATION: case PARAM_TYPE_UNIT: @@ -116,12 +112,10 @@ static bool handle_param(const s_tlv_data *data, s_field_ctx *context) { handler = (f_tlv_data_handler) &handle_param_token_amount_struct; param_ctx.token_amount_ctx.param = &context->field->param_token_amount; break; -#ifdef HAVE_NFT_SUPPORT case PARAM_TYPE_NFT: handler = (f_tlv_data_handler) &handle_param_nft_struct; param_ctx.nft_ctx.param = &context->field->param_nft; break; -#endif case PARAM_TYPE_DATETIME: handler = (f_tlv_data_handler) &handle_param_datetime_struct; param_ctx.datetime_ctx.param = &context->field->param_datetime; @@ -220,11 +214,9 @@ bool format_field(const s_field *field) { case PARAM_TYPE_TOKEN_AMOUNT: ret = format_param_token_amount(&field->param_token_amount, field->name); break; -#ifdef HAVE_NFT_SUPPORT case PARAM_TYPE_NFT: ret = format_param_nft(&field->param_nft, field->name); break; -#endif case PARAM_TYPE_DATETIME: ret = format_param_datetime(&field->param_datetime, field->name); break; diff --git a/src_features/generic_tx_parser/gtp_field.h b/src_features/generic_tx_parser/gtp_field.h index 235f1143f9..43d31dc5ec 100644 --- a/src_features/generic_tx_parser/gtp_field.h +++ b/src_features/generic_tx_parser/gtp_field.h @@ -37,9 +37,7 @@ typedef struct { s_param_raw param_raw; s_param_amount param_amount; s_param_token_amount param_token_amount; -#ifdef HAVE_NFT_SUPPORT s_param_nft param_nft; -#endif s_param_datetime param_datetime; s_param_duration param_duration; s_param_unit param_unit; diff --git a/src_features/generic_tx_parser/gtp_param_nft.c b/src_features/generic_tx_parser/gtp_param_nft.c index 8122d27eee..1726631988 100644 --- a/src_features/generic_tx_parser/gtp_param_nft.c +++ b/src_features/generic_tx_parser/gtp_param_nft.c @@ -1,5 +1,4 @@ #ifdef HAVE_GENERIC_TX_PARSER -#ifdef HAVE_NFT_SUPPORT #include "gtp_param_nft.h" #include "manage_asset_info.h" @@ -102,5 +101,4 @@ bool format_param_nft(const s_param_nft *param, const char *name) { return ret; } -#endif // HAVE_NFT_SUPPORT #endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_nft.h b/src_features/generic_tx_parser/gtp_param_nft.h index f7fcfc1abf..2c41cb195c 100644 --- a/src_features/generic_tx_parser/gtp_param_nft.h +++ b/src_features/generic_tx_parser/gtp_param_nft.h @@ -1,8 +1,6 @@ #ifndef GTP_PARAM_NFT_H_ #define GTP_PARAM_NFT_H_ -#ifdef HAVE_NFT_SUPPORT - #include #include #include "tlv.h" @@ -21,6 +19,4 @@ typedef struct { bool handle_param_nft_struct(const s_tlv_data *data, s_param_nft_context *context); bool format_param_nft(const s_param_nft *param, const char *name); -#endif - #endif // !GTP_PARAM_NFT_H_ diff --git a/src_features/provideNFTInformation/cmd_provideNFTInfo.c b/src_features/provideNFTInformation/cmd_provideNFTInfo.c index 3584e3b412..70acf4f8d0 100644 --- a/src_features/provideNFTInformation/cmd_provideNFTInfo.c +++ b/src_features/provideNFTInformation/cmd_provideNFTInfo.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include "apdu_constants.h" #include "asset_info.h" #include "network.h" @@ -179,5 +177,3 @@ uint16_t handleProvideNFTInformation(const uint8_t *workBuffer, *tx += 1; return APDU_RESPONSE_OK; } - -#endif // HAVE_NFT_SUPPORT diff --git a/src_features/provide_trusted_name/trusted_name.c b/src_features/provide_trusted_name/trusted_name.c index 0888cf553a..b415182af9 100644 --- a/src_features/provide_trusted_name/trusted_name.c +++ b/src_features/provide_trusted_name/trusted_name.c @@ -445,7 +445,6 @@ static bool handle_trusted_name_source(const s_tlv_data *data, s_trusted_name_ct return true; } -#ifdef HAVE_NFT_SUPPORT /** * Handler for tag \ref NFT_ID * @@ -464,7 +463,6 @@ static bool handle_nft_id(const s_tlv_data *data, s_trusted_name_ctx *context) { context->rcv_flags |= SET_BIT(NFT_ID_RCV_BIT); return true; // unhandled for now } -#endif bool handle_trusted_name_struct(const s_tlv_data *data, s_trusted_name_ctx *context) { bool ret; @@ -510,11 +508,9 @@ bool handle_trusted_name_struct(const s_tlv_data *data, s_trusted_name_ctx *cont case TRUSTED_NAME_SOURCE: ret = handle_trusted_name_source(data, context); break; -#ifdef HAVE_NFT_SUPPORT case NFT_ID: ret = handle_nft_id(data, context); break; -#endif default: PRINTF(TLV_TAG_ERROR_MSG, data->tag); ret = false; diff --git a/src_features/provide_trusted_name/trusted_name.h b/src_features/provide_trusted_name/trusted_name.h index a6df693da2..36c4dd57ec 100644 --- a/src_features/provide_trusted_name/trusted_name.h +++ b/src_features/provide_trusted_name/trusted_name.h @@ -45,9 +45,7 @@ typedef struct { uint64_t chain_id; e_name_type name_type; e_name_source name_source; -#ifdef HAVE_NFT_SUPPORT uint8_t nft_id[INT256_LENGTH]; -#endif } s_trusted_name_info; typedef struct { diff --git a/src_plugins/erc1155/erc1155_plugin.c b/src_plugins/erc1155/erc1155_plugin.c index 24ca169b23..2a703c8b0e 100644 --- a/src_plugins/erc1155/erc1155_plugin.c +++ b/src_plugins/erc1155/erc1155_plugin.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include #include "erc1155_plugin.h" #include "plugin_utils.h" @@ -148,5 +146,3 @@ void erc1155_plugin_call(int message, void *parameters) { break; } } - -#endif // HAVE_NFT_SUPPORT diff --git a/src_plugins/erc1155/erc1155_plugin.h b/src_plugins/erc1155/erc1155_plugin.h index 56908b2e95..06f491a964 100644 --- a/src_plugins/erc1155/erc1155_plugin.h +++ b/src_plugins/erc1155/erc1155_plugin.h @@ -1,8 +1,6 @@ #ifndef _ERC1155_PLUGIN_H_ #define _ERC1155_PLUGIN_H_ -#ifdef HAVE_NFT_SUPPORT - #include #include #include "uint256.h" @@ -51,6 +49,4 @@ typedef struct erc1155_context_t { void handle_provide_parameter_1155(ethPluginProvideParameter_t *parameters); void handle_query_contract_ui_1155(ethQueryContractUI_t *parameters); -#endif // HAVE_NFT_SUPPORT - #endif // _ERC1155_PLUGIN_H_ diff --git a/src_plugins/erc1155/erc1155_provide_parameters.c b/src_plugins/erc1155/erc1155_provide_parameters.c index 3a9f7bb884..9f258a99b2 100644 --- a/src_plugins/erc1155/erc1155_provide_parameters.c +++ b/src_plugins/erc1155/erc1155_provide_parameters.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include #include "erc1155_plugin.h" #include "plugin_utils.h" @@ -145,5 +143,3 @@ void handle_provide_parameter_1155(ethPluginProvideParameter_t *msg) { break; } } - -#endif // HAVE_NFT_SUPPORT diff --git a/src_plugins/erc1155/erc1155_ui.c b/src_plugins/erc1155/erc1155_ui.c index f566ad5f70..3dd2c246a9 100644 --- a/src_plugins/erc1155/erc1155_ui.c +++ b/src_plugins/erc1155/erc1155_ui.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include #include "erc1155_plugin.h" #include "eth_plugin_internal.h" @@ -152,5 +150,3 @@ void handle_query_contract_ui_1155(ethQueryContractUI_t *msg) { break; } } - -#endif // HAVE_NFT_SUPPORT diff --git a/src_plugins/erc721/erc721_plugin.c b/src_plugins/erc721/erc721_plugin.c index 10fb28cecf..62f3347ffc 100644 --- a/src_plugins/erc721/erc721_plugin.c +++ b/src_plugins/erc721/erc721_plugin.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include #include "plugin_utils.h" #include "erc721_plugin.h" @@ -155,5 +153,3 @@ void erc721_plugin_call(int message, void *parameters) { break; } } - -#endif // HAVE_NFT_SUPPORT diff --git a/src_plugins/erc721/erc721_plugin.h b/src_plugins/erc721/erc721_plugin.h index bf1d1edeb5..bb332a14ff 100644 --- a/src_plugins/erc721/erc721_plugin.h +++ b/src_plugins/erc721/erc721_plugin.h @@ -1,8 +1,6 @@ #ifndef _ERC721_PLUGIN_H_ #define _ERC721_PLUGIN_H_ -#ifdef HAVE_NFT_SUPPORT - #include #include #include "asset_info.h" @@ -42,6 +40,4 @@ typedef struct erc721_context_t { void handle_provide_parameter_721(ethPluginProvideParameter_t *parameters); void handle_query_contract_ui_721(ethQueryContractUI_t *parameters); -#endif // HAVE_NFT_SUPPORT - #endif // _ERC721_PLUGIN_H_ diff --git a/src_plugins/erc721/erc721_provide_parameters.c b/src_plugins/erc721/erc721_provide_parameters.c index d5577db6d7..f2f0ad6d1f 100644 --- a/src_plugins/erc721/erc721_provide_parameters.c +++ b/src_plugins/erc721/erc721_provide_parameters.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include "erc721_plugin.h" #include "plugin_utils.h" #include "eth_plugin_internal.h" @@ -93,5 +91,3 @@ void handle_provide_parameter_721(ethPluginProvideParameter_t *msg) { break; } } - -#endif // HAVE_NFT_SUPPORT diff --git a/src_plugins/erc721/erc721_ui.c b/src_plugins/erc721/erc721_ui.c index d27643108a..8f307d25ac 100644 --- a/src_plugins/erc721/erc721_ui.c +++ b/src_plugins/erc721/erc721_ui.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NFT_SUPPORT - #include #include "erc721_plugin.h" #include "eth_plugin_internal.h" @@ -143,5 +141,3 @@ void handle_query_contract_ui_721(ethQueryContractUI_t *msg) { break; } } - -#endif // HAVE_NFT_SUPPORT diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index c6e2fdd438..c1bbd76390 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -156,7 +156,6 @@ set(DEFINES HAVE_DYN_MEM_ALLOC HAVE_SWAP HAVE_ENUM_VALUE - HAVE_NFT_SUPPORT HAVE_DYNAMIC_NETWORKS HAVE_WEB3_CHECKS HAVE_EIP7702 From 4cbe3151de9f6cc23234f96a6beb3aff946b717e Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 08:48:12 +0200 Subject: [PATCH 03/13] Remove useless flag 'HAVE_DYN_MEM_ALLOC' --- makefile_conf/features.mk | 3 --- src/main.c | 4 ---- src/mem.c | 4 ---- src/mem.h | 4 ---- src/mem_utils.c | 4 ---- src/mem_utils.h | 4 ---- src/tlv_apdu.c | 25 ------------------------- tests/fuzzing/CMakeLists.txt | 1 - 8 files changed, 49 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 949ecdf17b..37170337c9 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -23,9 +23,6 @@ ifneq ($(NFT_STAGING_KEY),0) DEFINES += HAVE_NFT_STAGING_KEY endif -# Dynamic memory allocator -DEFINES += HAVE_DYN_MEM_ALLOC - # EIP-712 DEFINES += HAVE_EIP712_FULL_SUPPORT diff --git a/src/main.c b/src/main.c index c5c278007c..c441f1b3c2 100644 --- a/src/main.c +++ b/src/main.c @@ -37,9 +37,7 @@ #include "crypto_helpers.h" #include "manage_asset_info.h" #include "cmd_network_info.h" -#ifdef HAVE_DYN_MEM_ALLOC #include "mem.h" -#endif #include "cmd_enum_value.h" #include "cmd_tx_info.h" #include "cmd_field.h" @@ -414,9 +412,7 @@ void coin_main(eth_libargs_t *args) { io_init(); ui_idle(); -#ifdef HAVE_DYN_MEM_ALLOC mem_init(); -#endif #ifdef HAVE_TRUSTED_NAME // to prevent it from having a fixed value at boot diff --git a/src/mem.c b/src/mem.c index cf105069d4..8eaa42a0c6 100644 --- a/src/mem.c +++ b/src/mem.c @@ -6,8 +6,6 @@ * during the transaction but discarded right after. */ -#ifdef HAVE_DYN_MEM_ALLOC - #include #include "mem.h" #include "os_print.h" @@ -113,5 +111,3 @@ void mem_rev_dealloc(size_t size) { mem_rev_idx -= size; } } - -#endif // HAVE_DYN_MEM_ALLOC diff --git a/src/mem.h b/src/mem.h index e83e252166..1cfcb52d5a 100644 --- a/src/mem.h +++ b/src/mem.h @@ -1,8 +1,6 @@ #ifndef MEM_H_ #define MEM_H_ -#ifdef HAVE_DYN_MEM_ALLOC - #include void mem_init(void); @@ -12,6 +10,4 @@ void mem_dealloc(size_t size); void *mem_rev_alloc(size_t size); void mem_rev_dealloc(size_t size); -#endif // HAVE_DYN_MEM_ALLOC - #endif // MEM_H_ diff --git a/src/mem_utils.c b/src/mem_utils.c index 8bfc7617bd..7ecf153ada 100644 --- a/src/mem_utils.c +++ b/src/mem_utils.c @@ -1,5 +1,3 @@ -#ifdef HAVE_DYN_MEM_ALLOC - #include #include #include @@ -65,5 +63,3 @@ void *mem_alloc_and_align(size_t size, size_t alignment) { mem_align(alignment); return mem_alloc(size); } - -#endif // HAVE_DYN_MEM_ALLOC diff --git a/src/mem_utils.h b/src/mem_utils.h index 55d1ae2c3c..ead185584d 100644 --- a/src/mem_utils.h +++ b/src/mem_utils.h @@ -1,8 +1,6 @@ #ifndef MEM_UTILS_H_ #define MEM_UTILS_H_ -#ifdef HAVE_DYN_MEM_ALLOC - #include #define MEM_ALLOC_AND_ALIGN_TYPE(type) mem_alloc_and_align(sizeof(type), __alignof__(type)) @@ -11,6 +9,4 @@ char *mem_alloc_and_format_uint(uint32_t value, uint8_t *const written_chars); uint8_t mem_align(size_t alignment); void *mem_alloc_and_align(size_t size, size_t alignment); -#endif // HAVE_DYN_MEM_ALLOC - #endif // MEM_UTILS_H_ diff --git a/src/tlv_apdu.c b/src/tlv_apdu.c index 939c9166e8..c9439214da 100644 --- a/src/tlv_apdu.c +++ b/src/tlv_apdu.c @@ -1,12 +1,9 @@ #include #include "tlv_apdu.h" #include "read.h" -#ifdef HAVE_DYN_MEM_ALLOC #include "mem.h" -#endif #include "os_print.h" -#ifdef HAVE_DYN_MEM_ALLOC static uint8_t *g_tlv_payload = NULL; static uint16_t g_tlv_size = 0; static uint16_t g_tlv_pos = 0; @@ -21,16 +18,11 @@ static void reset_state(bool free) { g_tlv_pos = 0; g_dyn = false; } -#endif bool tlv_from_apdu(bool first_chunk, uint8_t lc, const uint8_t *payload, f_tlv_payload_handler handler) { -#ifndef HAVE_DYN_MEM_ALLOC - uint16_t g_tlv_size = 0; - uint16_t g_tlv_pos = 0; -#endif bool ret = true; uint8_t offset = 0; uint8_t chunk_length; @@ -43,7 +35,6 @@ bool tlv_from_apdu(bool first_chunk, offset += sizeof(g_tlv_size); g_tlv_pos = 0; if (g_tlv_size > (lc - offset)) { -#ifdef HAVE_DYN_MEM_ALLOC if (g_tlv_payload != NULL) { PRINTF("Error: remnants from an incomplete TLV payload!\n"); reset_state(true); @@ -54,44 +45,28 @@ bool tlv_from_apdu(bool first_chunk, g_tlv_payload = mem_alloc(g_tlv_size); } else { g_dyn = false; -#else - PRINTF( - "Error: cannot handle a TLV payload accross multiple APDUs without dynamic memory " - "allocator\n"); - return false; -#endif } } -#ifdef HAVE_DYN_MEM_ALLOC if (g_dyn && (g_tlv_payload == NULL)) { reset_state(true); return false; } -#endif chunk_length = lc - offset; if ((g_tlv_pos + chunk_length) > g_tlv_size) { PRINTF("TLV payload bigger than expected!\n"); -#ifdef HAVE_DYN_MEM_ALLOC reset_state(true); -#endif return false; } -#ifdef HAVE_DYN_MEM_ALLOC if (g_dyn) { memcpy(g_tlv_payload + g_tlv_pos, payload + offset, chunk_length); } -#endif g_tlv_pos += chunk_length; if (g_tlv_pos == g_tlv_size) { -#ifdef HAVE_DYN_MEM_ALLOC ret = (*handler)(g_dyn ? g_tlv_payload : &payload[offset], g_tlv_size, g_dyn); reset_state(false); // already deallocated in the handler -#else - ret = (*handler)(&payload[offset], g_tlv_size, false); -#endif } return ret; } diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index c1bbd76390..098c3b5b64 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -153,7 +153,6 @@ set(DEFINES STANDARD_APP_SYNC_RAPDU HAVE_GENERIC_TX_PARSER HAVE_TRUSTED_NAME - HAVE_DYN_MEM_ALLOC HAVE_SWAP HAVE_ENUM_VALUE HAVE_DYNAMIC_NETWORKS From f9efcd6f1a1c42c5211fa771bb4eab9fb2a61373 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 09:01:50 +0200 Subject: [PATCH 04/13] Remove useless flag 'HAVE_EIP712_FULL_SUPPORT' --- makefile_conf/features.mk | 3 --- src/main.c | 6 +----- src/shared_context.h | 2 -- src_features/provide_proxy_info/cmd_proxy_info.c | 2 +- src_features/provide_proxy_info/cmd_proxy_info.h | 2 +- src_features/provide_proxy_info/proxy_info.c | 2 +- src_features/provide_proxy_info/proxy_info.h | 2 +- src_features/signMessageEIP712/commands_712.c | 4 ---- src_features/signMessageEIP712/commands_712.h | 4 ---- src_features/signMessageEIP712/context_712.c | 4 ---- src_features/signMessageEIP712/context_712.h | 4 ---- src_features/signMessageEIP712/encode_field.c | 4 ---- src_features/signMessageEIP712/encode_field.h | 4 ---- src_features/signMessageEIP712/field_hash.c | 4 ---- src_features/signMessageEIP712/field_hash.h | 4 ---- src_features/signMessageEIP712/filtering.c | 4 ---- src_features/signMessageEIP712/filtering.h | 4 ---- src_features/signMessageEIP712/format_hash_field_type.c | 4 ---- src_features/signMessageEIP712/format_hash_field_type.h | 4 ---- src_features/signMessageEIP712/path.c | 4 ---- src_features/signMessageEIP712/path.h | 4 ---- src_features/signMessageEIP712/schema_hash.c | 4 ---- src_features/signMessageEIP712/schema_hash.h | 4 ---- src_features/signMessageEIP712/sol_typenames.c | 4 ---- src_features/signMessageEIP712/sol_typenames.h | 4 ---- src_features/signMessageEIP712/type_hash.c | 4 ---- src_features/signMessageEIP712/type_hash.h | 4 ---- src_features/signMessageEIP712/typed_data.c | 4 ---- src_features/signMessageEIP712/typed_data.h | 4 ---- src_features/signMessageEIP712/ui_logic.c | 4 ---- src_features/signMessageEIP712/ui_logic.h | 4 ---- src_nbgl/ui_home.c | 8 -------- src_nbgl/ui_message_signing.c | 2 -- src_nbgl/ui_message_signing.h | 2 -- src_nbgl/ui_sign_712.c | 4 ---- 35 files changed, 5 insertions(+), 126 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 37170337c9..dd3b245010 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -23,9 +23,6 @@ ifneq ($(NFT_STAGING_KEY),0) DEFINES += HAVE_NFT_STAGING_KEY endif -# EIP-712 -DEFINES += HAVE_EIP712_FULL_SUPPORT - DEFINES += HAVE_ENUM_VALUE DEFINES += HAVE_GENERIC_TX_PARSER diff --git a/src/main.c b/src/main.c index c441f1b3c2..8e32cbddfb 100644 --- a/src/main.c +++ b/src/main.c @@ -193,11 +193,9 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { forget_known_assets(); sw = handleSignEIP712Message_v0(cmd->p1, cmd->data, cmd->lc, flags); break; -#ifdef HAVE_EIP712_FULL_SUPPORT case P2_EIP712_FULL_IMPLEM: sw = handle_eip712_sign(cmd->data, cmd->lc, flags); break; -#endif // HAVE_EIP712_FULL_SUPPORT default: sw = APDU_RESPONSE_INVALID_P1_P2; } @@ -214,7 +212,6 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { break; #endif // HAVE_ETH2 -#ifdef HAVE_EIP712_FULL_SUPPORT case INS_EIP712_STRUCT_DEF: sw = handle_eip712_struct_def(cmd->p2, cmd->data, cmd->lc); break; @@ -226,7 +223,6 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { case INS_EIP712_FILTERING: sw = handle_eip712_filtering(cmd->p1, cmd->p2, cmd->data, cmd->lc, flags); break; -#endif // HAVE_EIP712_FULL_SUPPORT #ifdef HAVE_TRUSTED_NAME case INS_ENS_GET_CHALLENGE: @@ -254,7 +250,7 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { break; #endif // HAVE_GENERIC_TX_PARSER -#if defined(HAVE_EIP712_FULL_SUPPORT) || defined(HAVE_GENERIC_TX_PARSER) +#ifdef HAVE_GENERIC_TX_PARSER case INS_PROVIDE_PROXY_INFO: sw = handle_proxy_info(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; diff --git a/src/shared_context.h b/src/shared_context.h index 29c6d50998..f71eb9faf0 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -21,9 +21,7 @@ typedef struct internalStorage_t { bool dataAllowed; bool contractDetails; bool displayNonce; -#ifdef HAVE_EIP712_FULL_SUPPORT bool verbose_eip712; -#endif // HAVE_EIP712_FULL_SUPPORT #ifdef HAVE_TRUSTED_NAME bool verbose_trusted_name; #endif // HAVE_TRUSTED_NAME diff --git a/src_features/provide_proxy_info/cmd_proxy_info.c b/src_features/provide_proxy_info/cmd_proxy_info.c index 3a126327cf..84f6870692 100644 --- a/src_features/provide_proxy_info/cmd_proxy_info.c +++ b/src_features/provide_proxy_info/cmd_proxy_info.c @@ -1,4 +1,4 @@ -#if defined(HAVE_EIP712_FULL_SUPPORT) || defined(HAVE_GENERIC_TX_PARSER) +#ifdef HAVE_GENERIC_TX_PARSER #include "cmd_proxy_info.h" #include "proxy_info.h" diff --git a/src_features/provide_proxy_info/cmd_proxy_info.h b/src_features/provide_proxy_info/cmd_proxy_info.h index 02e45135b4..75e72cd92f 100644 --- a/src_features/provide_proxy_info/cmd_proxy_info.h +++ b/src_features/provide_proxy_info/cmd_proxy_info.h @@ -1,4 +1,4 @@ -#if defined(HAVE_EIP712_FULL_SUPPORT) || defined(HAVE_GENERIC_TX_PARSER) +#ifdef HAVE_GENERIC_TX_PARSER #ifndef CMD_PROXY_INFO_H_ #define CMD_PROXY_INFO_H_ diff --git a/src_features/provide_proxy_info/proxy_info.c b/src_features/provide_proxy_info/proxy_info.c index 1b1cbe8b9b..89ae5bdd91 100644 --- a/src_features/provide_proxy_info/proxy_info.c +++ b/src_features/provide_proxy_info/proxy_info.c @@ -1,4 +1,4 @@ -#if defined(HAVE_EIP712_FULL_SUPPORT) || defined(HAVE_GENERIC_TX_PARSER) +#ifdef HAVE_GENERIC_TX_PARSER #include "proxy_info.h" #include "read.h" diff --git a/src_features/provide_proxy_info/proxy_info.h b/src_features/provide_proxy_info/proxy_info.h index eff788a88e..43d341ad81 100644 --- a/src_features/provide_proxy_info/proxy_info.h +++ b/src_features/provide_proxy_info/proxy_info.h @@ -1,4 +1,4 @@ -#if defined(HAVE_EIP712_FULL_SUPPORT) || defined(HAVE_GENERIC_TX_PARSER) +#ifdef HAVE_GENERIC_TX_PARSER #ifndef PROXY_INFO_H_ #define PROXY_INFO_H_ diff --git a/src_features/signMessageEIP712/commands_712.c b/src_features/signMessageEIP712/commands_712.c index c8f44ba187..133d3c4bc5 100644 --- a/src_features/signMessageEIP712/commands_712.c +++ b/src_features/signMessageEIP712/commands_712.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "apdu_constants.h" // APDU response codes #include "context_712.h" #include "field_hash.h" @@ -286,5 +284,3 @@ uint16_t handle_eip712_sign(const uint8_t *cdata, uint8_t length, uint32_t *flag *flags |= IO_ASYNCH_REPLY; return APDU_NO_RESPONSE; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/commands_712.h b/src_features/signMessageEIP712/commands_712.h index 3bc3377f7c..05ddea7e15 100644 --- a/src_features/signMessageEIP712/commands_712.h +++ b/src_features/signMessageEIP712/commands_712.h @@ -1,8 +1,6 @@ #ifndef EIP712_H_ #define EIP712_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -22,6 +20,4 @@ uint16_t handle_eip712_filtering(uint8_t p1, uint32_t *flags); void handle_eip712_return_code(bool success); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // EIP712_H_ diff --git a/src_features/signMessageEIP712/context_712.c b/src_features/signMessageEIP712/context_712.c index 79d3bed647..f28d29590f 100644 --- a/src_features/signMessageEIP712/context_712.c +++ b/src_features/signMessageEIP712/context_712.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "context_712.h" #include "mem.h" #include "mem_utils.h" @@ -72,5 +70,3 @@ void eip712_context_deinit(void) { eip712_context = NULL; reset_app_context(); } - -#endif diff --git a/src_features/signMessageEIP712/context_712.h b/src_features/signMessageEIP712/context_712.h index b017074849..934a4f6372 100644 --- a/src_features/signMessageEIP712/context_712.h +++ b/src_features/signMessageEIP712/context_712.h @@ -1,8 +1,6 @@ #ifndef EIP712_CTX_H_ #define EIP712_CTX_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include "common_utils.h" @@ -21,6 +19,4 @@ void eip712_context_deinit(void); typedef enum { NOT_INITIALIZED, INITIALIZED, DEFINED } e_struct_init; extern e_struct_init struct_state; -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // EIP712_CTX_H_ diff --git a/src_features/signMessageEIP712/encode_field.c b/src_features/signMessageEIP712/encode_field.c index bffade56d3..403073486a 100644 --- a/src_features/signMessageEIP712/encode_field.c +++ b/src_features/signMessageEIP712/encode_field.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "encode_field.h" #include "mem.h" #include "apdu_constants.h" // APDU response codes @@ -129,5 +127,3 @@ void *encode_address(const uint8_t *const value, uint8_t length) { } return encode_uint(value, length); } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/encode_field.h b/src_features/signMessageEIP712/encode_field.h index f3a684a9a0..ece6feb6cc 100644 --- a/src_features/signMessageEIP712/encode_field.h +++ b/src_features/signMessageEIP712/encode_field.h @@ -1,8 +1,6 @@ #ifndef ENCODE_FIELD_H_ #define ENCODE_FIELD_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -14,6 +12,4 @@ void *encode_boolean(const bool *const value, uint8_t length); void *encode_address(const uint8_t *const value, uint8_t length); void *encode_bytes(const uint8_t *const value, uint8_t length); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // ENCODE_FIELD_H_ diff --git a/src_features/signMessageEIP712/field_hash.c b/src_features/signMessageEIP712/field_hash.c index 73d9e06a4a..0b81234f50 100644 --- a/src_features/signMessageEIP712/field_hash.c +++ b/src_features/signMessageEIP712/field_hash.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include "field_hash.h" #include "encode_field.h" @@ -310,5 +308,3 @@ bool field_hash(const uint8_t *data, uint8_t data_length, bool partial) { } return true; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/field_hash.h b/src_features/signMessageEIP712/field_hash.h index 448dbd8d6b..701f1398fa 100644 --- a/src_features/signMessageEIP712/field_hash.h +++ b/src_features/signMessageEIP712/field_hash.h @@ -1,8 +1,6 @@ #ifndef FIELD_HASH_H_ #define FIELD_HASH_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -19,6 +17,4 @@ bool field_hash_init(void); void field_hash_deinit(void); bool field_hash(const uint8_t *data, uint8_t data_length, bool partial); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // FIELD_HASH_H_ diff --git a/src_features/signMessageEIP712/filtering.c b/src_features/signMessageEIP712/filtering.c index dfd4a651bc..7351642b10 100644 --- a/src_features/signMessageEIP712/filtering.c +++ b/src_features/signMessageEIP712/filtering.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "filtering.h" #include "hash_bytes.h" #include "apdu_constants.h" // APDU return codes @@ -701,5 +699,3 @@ bool filtering_raw_field(const uint8_t *payload, } return true; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/filtering.h b/src_features/signMessageEIP712/filtering.h index 71e8a98072..805186cfe2 100644 --- a/src_features/signMessageEIP712/filtering.h +++ b/src_features/signMessageEIP712/filtering.h @@ -1,8 +1,6 @@ #ifndef FILTERING_H_ #define FILTERING_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -31,6 +29,4 @@ bool filtering_raw_field(const uint8_t *payload, uint32_t *path_crc); bool filtering_discarded_path(const uint8_t *payload, uint8_t length); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // FILTERING_H_ diff --git a/src_features/signMessageEIP712/format_hash_field_type.c b/src_features/signMessageEIP712/format_hash_field_type.c index 1760c7d7d3..e1d882403c 100644 --- a/src_features/signMessageEIP712/format_hash_field_type.c +++ b/src_features/signMessageEIP712/format_hash_field_type.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "format_hash_field_type.h" #include "mem.h" #include "mem_utils.h" @@ -113,5 +111,3 @@ bool format_hash_field_type(const void *const field_ptr, cx_hash_t *hash_ctx) { } return true; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/format_hash_field_type.h b/src_features/signMessageEIP712/format_hash_field_type.h index b6d635fddf..f2f7fd1270 100644 --- a/src_features/signMessageEIP712/format_hash_field_type.h +++ b/src_features/signMessageEIP712/format_hash_field_type.h @@ -1,12 +1,8 @@ #ifndef FORMAT_HASH_FIELD_TYPE_H_ #define FORMAT_HASH_FIELD_TYPE_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "cx.h" bool format_hash_field_type(const void *const field_ptr, cx_hash_t *hash_ctx); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // FORMAT_HASH_FIELD_TYPE_H_ diff --git a/src_features/signMessageEIP712/path.c b/src_features/signMessageEIP712/path.c index e186279e55..f01ae7f770 100644 --- a/src_features/signMessageEIP712/path.c +++ b/src_features/signMessageEIP712/path.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include "path.h" #include "mem.h" @@ -775,5 +773,3 @@ bool path_init(void) { void path_deinit(void) { path_struct = NULL; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/path.h b/src_features/signMessageEIP712/path.h index deb43ad398..f949eb9fca 100644 --- a/src_features/signMessageEIP712/path.h +++ b/src_features/signMessageEIP712/path.h @@ -1,8 +1,6 @@ #ifndef PATH_H_ #define PATH_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -41,6 +39,4 @@ const void *path_get_nth_field_to_last(uint8_t n); uint8_t path_get_depth_count(void); uint8_t path_backup_get_depth_count(void); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // PATH_H_ diff --git a/src_features/signMessageEIP712/schema_hash.c b/src_features/signMessageEIP712/schema_hash.c index 5b8e1bfb66..06ab84dce4 100644 --- a/src_features/signMessageEIP712/schema_hash.c +++ b/src_features/signMessageEIP712/schema_hash.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "schema_hash.h" #include "hash_bytes.h" #include "typed_data.h" @@ -72,5 +70,3 @@ bool compute_schema_hash(void) { end: return false; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/schema_hash.h b/src_features/signMessageEIP712/schema_hash.h index 562d445742..69ed1967cd 100644 --- a/src_features/signMessageEIP712/schema_hash.h +++ b/src_features/signMessageEIP712/schema_hash.h @@ -1,12 +1,8 @@ #ifndef SCHEMA_HASH_H_ #define SCHEMA_HASH_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include bool compute_schema_hash(void); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // SCHEMA_HASH_H_ diff --git a/src_features/signMessageEIP712/sol_typenames.c b/src_features/signMessageEIP712/sol_typenames.c index 0d09e56bd1..edc0d9c575 100644 --- a/src_features/signMessageEIP712/sol_typenames.c +++ b/src_features/signMessageEIP712/sol_typenames.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "sol_typenames.h" #include "mem.h" #include "os_pic.h" @@ -130,5 +128,3 @@ const char *get_struct_field_sol_typename(const uint8_t *field_ptr, uint8_t *con apdu_response_code = APDU_RESPONSE_INVALID_DATA; return NULL; // Not found } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/sol_typenames.h b/src_features/signMessageEIP712/sol_typenames.h index c2229b77a8..12832717dd 100644 --- a/src_features/signMessageEIP712/sol_typenames.h +++ b/src_features/signMessageEIP712/sol_typenames.h @@ -1,8 +1,6 @@ #ifndef SOL_TYPENAMES_H_ #define SOL_TYPENAMES_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -10,6 +8,4 @@ bool sol_typenames_init(void); const char *get_struct_field_sol_typename(const uint8_t *ptr, uint8_t *const length); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // SOL_TYPENAMES_H_ diff --git a/src_features/signMessageEIP712/type_hash.c b/src_features/signMessageEIP712/type_hash.c index a005718d7d..d5c2ea9d7e 100644 --- a/src_features/signMessageEIP712/type_hash.c +++ b/src_features/signMessageEIP712/type_hash.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "mem.h" #include "mem_utils.h" #include "type_hash.h" @@ -209,5 +207,3 @@ bool type_hash(const char *const struct_name, const uint8_t struct_name_length, end: return false; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/type_hash.h b/src_features/signMessageEIP712/type_hash.h index ad6f0706f5..bff0eec169 100644 --- a/src_features/signMessageEIP712/type_hash.h +++ b/src_features/signMessageEIP712/type_hash.h @@ -1,13 +1,9 @@ #ifndef TYPE_HASH_H_ #define TYPE_HASH_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include bool type_hash(const char *const struct_name, const uint8_t struct_name_length, uint8_t *hash_buf); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // TYPE_HASH_H_ diff --git a/src_features/signMessageEIP712/typed_data.c b/src_features/signMessageEIP712/typed_data.c index 703223758f..18912dd8bf 100644 --- a/src_features/signMessageEIP712/typed_data.c +++ b/src_features/signMessageEIP712/typed_data.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "typed_data.h" #include "sol_typenames.h" #include "apdu_constants.h" // APDU response codes @@ -744,5 +742,3 @@ bool set_struct_field(uint8_t length, const uint8_t *const data) { } return true; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/typed_data.h b/src_features/signMessageEIP712/typed_data.h index 9cfb68eafa..d2f53ede91 100644 --- a/src_features/signMessageEIP712/typed_data.h +++ b/src_features/signMessageEIP712/typed_data.h @@ -1,8 +1,6 @@ #ifndef TYPED_DATA_H_ #define TYPED_DATA_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include @@ -60,6 +58,4 @@ bool set_struct_field(uint8_t length, const uint8_t *const data); bool typed_data_init(void); void typed_data_deinit(void); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // TYPED_DATA_H_ diff --git a/src_features/signMessageEIP712/ui_logic.c b/src_features/signMessageEIP712/ui_logic.c index 4703fd1e92..f3de36e367 100644 --- a/src_features/signMessageEIP712/ui_logic.c +++ b/src_features/signMessageEIP712/ui_logic.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "ui_logic.h" #include "mem.h" #include "mem_utils.h" @@ -918,5 +916,3 @@ char *get_ui_pairs_buffer(size_t *size) { *size = sizeof(ui_ctx->ui_pairs_buffer); return ui_ctx->ui_pairs_buffer; } - -#endif // HAVE_EIP712_FULL_SUPPORT diff --git a/src_features/signMessageEIP712/ui_logic.h b/src_features/signMessageEIP712/ui_logic.h index 36d69ca5a3..416e142854 100644 --- a/src_features/signMessageEIP712/ui_logic.h +++ b/src_features/signMessageEIP712/ui_logic.h @@ -1,8 +1,6 @@ #ifndef UI_LOGIC_712_H_ #define UI_LOGIC_712_H_ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include #include "ux.h" #include "uint256.h" @@ -59,6 +57,4 @@ void ui_712_set_trusted_name_requirements(uint8_t type_count, #endif char *get_ui_pairs_buffer(size_t *size); -#endif // HAVE_EIP712_FULL_SUPPORT - #endif // UI_LOGIC_712_H_ diff --git a/src_nbgl/ui_home.c b/src_nbgl/ui_home.c index f1931c8e44..60fd981902 100644 --- a/src_nbgl/ui_home.c +++ b/src_nbgl/ui_home.c @@ -22,9 +22,7 @@ enum { TRUSTED_NAME_VERBOSE_TOKEN, #endif NONCE_TOKEN, -#ifdef HAVE_EIP712_FULL_SUPPORT EIP712_VERBOSE_TOKEN, -#endif #ifdef HAVE_EIP7702 EIP7702_TOKEN, #endif // HAVE_EIP7702 @@ -40,9 +38,7 @@ enum { TRUSTED_NAME_VERBOSE_ID, #endif NONCE_ID, -#ifdef HAVE_EIP712_FULL_SUPPORT EIP712_VERBOSE_ID, -#endif DEBUG_ID, #ifdef HAVE_EIP7702 EIP7702_ID, @@ -93,13 +89,11 @@ static void setting_toggle_callback(int token, uint8_t index, int page) { switches[NONCE_ID].initState = (nbgl_state_t) value; nvm_write((void *) &N_storage.displayNonce, (void *) &value, sizeof(value)); break; -#ifdef HAVE_EIP712_FULL_SUPPORT case EIP712_VERBOSE_TOKEN: value = !N_storage.verbose_eip712; switches[EIP712_VERBOSE_ID].initState = (nbgl_state_t) value; nvm_write((void *) &N_storage.verbose_eip712, (void *) &value, sizeof(value)); break; -#endif // HAVE_EIP712_FULL_SUPPORT #ifdef HAVE_EIP7702 case EIP7702_TOKEN: value = !N_storage.eip7702_enable; @@ -170,7 +164,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u switches[NONCE_ID].tuneId = TUNE_TAP_CASUAL; #endif -#ifdef HAVE_EIP712_FULL_SUPPORT switches[EIP712_VERBOSE_ID].initState = N_storage.verbose_eip712 ? ON_STATE : OFF_STATE; switches[EIP712_VERBOSE_ID].text = "Raw messages"; switches[EIP712_VERBOSE_ID].subText = "Displays raw content of EIP712 messages"; @@ -178,7 +171,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u #ifdef HAVE_PIEZO_SOUND switches[EIP712_VERBOSE_ID].tuneId = TUNE_TAP_CASUAL; #endif -#endif // HAVE_EIP712_FULL_SUPPORT #ifdef HAVE_EIP7702 switches[EIP7702_ID].initState = N_storage.eip7702_enable ? ON_STATE : OFF_STATE; diff --git a/src_nbgl/ui_message_signing.c b/src_nbgl/ui_message_signing.c index ed4fd8a571..ca2ba4a039 100644 --- a/src_nbgl/ui_message_signing.c +++ b/src_nbgl/ui_message_signing.c @@ -18,8 +18,6 @@ void ui_typed_message_review_choice_v0(bool confirm) { ui_typed_message_review_choice_common(confirm, ui_712_approve_cb, ui_712_reject_cb); } -#ifdef HAVE_EIP712_FULL_SUPPORT void ui_typed_message_review_choice(bool confirm) { ui_typed_message_review_choice_common(confirm, ui_712_approve, ui_712_reject); } -#endif diff --git a/src_nbgl/ui_message_signing.h b/src_nbgl/ui_message_signing.h index c20d4ef5f2..cd35c8fa77 100644 --- a/src_nbgl/ui_message_signing.h +++ b/src_nbgl/ui_message_signing.h @@ -4,8 +4,6 @@ #include void ui_typed_message_review_choice_v0(bool confirm); -#ifdef HAVE_EIP712_FULL_SUPPORT void ui_typed_message_review_choice(bool confirm); -#endif #endif // UI_MESSAGE_SIGNING_H_ diff --git a/src_nbgl/ui_sign_712.c b/src_nbgl/ui_sign_712.c index 1779ffa51d..787c8c1d47 100644 --- a/src_nbgl/ui_sign_712.c +++ b/src_nbgl/ui_sign_712.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP712_FULL_SUPPORT - #include "common_ui.h" #include "ui_nbgl.h" #include "ui_logic.h" @@ -170,5 +168,3 @@ void ui_712_switch_to_sign(void) { nbgl_useCaseReviewStreamingFinish(g_stax_shared_buffer, ui_typed_message_review_choice); } } - -#endif // HAVE_EIP712_FULL_SUPPORT From 8e3f413d93ab23403b9a98c462c2602c1e283e1a Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 09:04:24 +0200 Subject: [PATCH 05/13] Remove useless flag 'HAVE_ENUM_VALUE' --- makefile_conf/features.mk | 1 - src/main.c | 2 -- src_features/generic_tx_parser/gtp_field.c | 8 -------- src_features/generic_tx_parser/gtp_field.h | 2 -- src_features/generic_tx_parser/gtp_param_enum.c | 2 -- src_features/generic_tx_parser/gtp_param_enum.h | 4 ---- src_features/provide_enum_value/cmd_enum_value.c | 4 ---- src_features/provide_enum_value/enum_value.c | 4 ---- tests/fuzzing/CMakeLists.txt | 1 - 9 files changed, 28 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index dd3b245010..fb07887cef 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -23,7 +23,6 @@ ifneq ($(NFT_STAGING_KEY),0) DEFINES += HAVE_NFT_STAGING_KEY endif -DEFINES += HAVE_ENUM_VALUE DEFINES += HAVE_GENERIC_TX_PARSER # CryptoAssetsList key diff --git a/src/main.c b/src/main.c index 8e32cbddfb..9a1ea043e5 100644 --- a/src/main.c +++ b/src/main.c @@ -234,11 +234,9 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { break; #endif // HAVE_TRUSTED_NAME -#ifdef HAVE_ENUM_VALUE case INS_PROVIDE_ENUM_VALUE: sw = handle_enum_value(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; -#endif // HAVE_ENUM_VALUE #ifdef HAVE_GENERIC_TX_PARSER case INS_GTP_TRANSACTION_INFO: diff --git a/src_features/generic_tx_parser/gtp_field.c b/src_features/generic_tx_parser/gtp_field.c index 1be34edfc2..069afe8dbe 100644 --- a/src_features/generic_tx_parser/gtp_field.c +++ b/src_features/generic_tx_parser/gtp_field.c @@ -27,9 +27,7 @@ typedef union { s_param_datetime_context datetime_ctx; s_param_duration_context duration_ctx; s_param_unit_context unit_ctx; -#ifdef HAVE_ENUM_VALUE s_param_enum_context enum_ctx; -#endif #ifdef HAVE_TRUSTED_NAME s_param_trusted_name_context trusted_name_ctx; #endif @@ -71,9 +69,7 @@ static bool handle_param_type(const s_tlv_data *data, s_field_ctx *context) { case PARAM_TYPE_DATETIME: case PARAM_TYPE_DURATION: case PARAM_TYPE_UNIT: -#ifdef HAVE_ENUM_VALUE case PARAM_TYPE_ENUM: -#endif #ifdef HAVE_TRUSTED_NAME case PARAM_TYPE_TRUSTED_NAME: #endif @@ -128,12 +124,10 @@ static bool handle_param(const s_tlv_data *data, s_field_ctx *context) { handler = (f_tlv_data_handler) &handle_param_unit_struct; param_ctx.unit_ctx.param = &context->field->param_unit; break; -#ifdef HAVE_ENUM_VALUE case PARAM_TYPE_ENUM: handler = (f_tlv_data_handler) &handle_param_enum_struct; param_ctx.enum_ctx.param = &context->field->param_enum; break; -#endif #ifdef HAVE_TRUSTED_NAME case PARAM_TYPE_TRUSTED_NAME: handler = (f_tlv_data_handler) &handle_param_trusted_name_struct; @@ -226,11 +220,9 @@ bool format_field(const s_field *field) { case PARAM_TYPE_UNIT: ret = format_param_unit(&field->param_unit, field->name); break; -#ifdef HAVE_ENUM_VALUE case PARAM_TYPE_ENUM: ret = format_param_enum(&field->param_enum, field->name); break; -#endif #ifdef HAVE_TRUSTED_NAME case PARAM_TYPE_TRUSTED_NAME: ret = format_param_trusted_name(&field->param_trusted_name, field->name); diff --git a/src_features/generic_tx_parser/gtp_field.h b/src_features/generic_tx_parser/gtp_field.h index 43d31dc5ec..dc9679c861 100644 --- a/src_features/generic_tx_parser/gtp_field.h +++ b/src_features/generic_tx_parser/gtp_field.h @@ -41,9 +41,7 @@ typedef struct { s_param_datetime param_datetime; s_param_duration param_duration; s_param_unit param_unit; -#ifdef HAVE_ENUM_VALUE s_param_enum param_enum; -#endif #ifdef HAVE_TRUSTED_NAME s_param_trusted_name param_trusted_name; #endif diff --git a/src_features/generic_tx_parser/gtp_param_enum.c b/src_features/generic_tx_parser/gtp_param_enum.c index e1369f7b83..2707ef9479 100644 --- a/src_features/generic_tx_parser/gtp_param_enum.c +++ b/src_features/generic_tx_parser/gtp_param_enum.c @@ -1,5 +1,4 @@ #ifdef HAVE_GENERIC_TX_PARSER -#ifdef HAVE_ENUM_VALUE #include "gtp_param_enum.h" #include "network.h" @@ -92,5 +91,4 @@ bool format_param_enum(const s_param_enum *param, const char *name) { return ret; } -#endif // HAVE_ENUM_VALUE #endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_enum.h b/src_features/generic_tx_parser/gtp_param_enum.h index 2bfddaa456..54897b0dba 100644 --- a/src_features/generic_tx_parser/gtp_param_enum.h +++ b/src_features/generic_tx_parser/gtp_param_enum.h @@ -1,8 +1,6 @@ #ifndef GTP_PARAM_ENUM_H_ #define GTP_PARAM_ENUM_H_ -#ifdef HAVE_ENUM_VALUE - #include #include #include "tlv.h" @@ -21,6 +19,4 @@ typedef struct { bool handle_param_enum_struct(const s_tlv_data *data, s_param_enum_context *context); bool format_param_enum(const s_param_enum *param, const char *name); -#endif - #endif // !GTP_PARAM_ENUM_H_ diff --git a/src_features/provide_enum_value/cmd_enum_value.c b/src_features/provide_enum_value/cmd_enum_value.c index 4f88b8d090..5606aac2d2 100644 --- a/src_features/provide_enum_value/cmd_enum_value.c +++ b/src_features/provide_enum_value/cmd_enum_value.c @@ -1,5 +1,3 @@ -#ifdef HAVE_ENUM_VALUE - #include "cmd_enum_value.h" #include "apdu_constants.h" #include "mem.h" @@ -28,5 +26,3 @@ uint16_t handle_enum_value(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *pa } return APDU_RESPONSE_OK; } - -#endif // HAVE_ENUM_VALUE diff --git a/src_features/provide_enum_value/enum_value.c b/src_features/provide_enum_value/enum_value.c index 50e967d2d4..cc90cb2f43 100644 --- a/src_features/provide_enum_value/enum_value.c +++ b/src_features/provide_enum_value/enum_value.c @@ -1,5 +1,3 @@ -#ifdef HAVE_ENUM_VALUE - #include "enum_value.h" #include "read.h" #include "public_keys.h" @@ -178,5 +176,3 @@ const char *get_matching_enum_name(const uint64_t *chain_id, } return NULL; } - -#endif // HAVE_ENUM_VALUE diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index 098c3b5b64..4d6de0eb2e 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -154,7 +154,6 @@ set(DEFINES HAVE_GENERIC_TX_PARSER HAVE_TRUSTED_NAME HAVE_SWAP - HAVE_ENUM_VALUE HAVE_DYNAMIC_NETWORKS HAVE_WEB3_CHECKS HAVE_EIP7702 From 2acef458aa2068efb5d68653db3e7e15d6f1a8f6 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 10:54:14 +0200 Subject: [PATCH 06/13] Remove useless flag 'HAVE_GENERIC_TX_PARSER' --- makefile_conf/features.mk | 2 -- src/main.c | 6 ------ src_features/generic_tx_parser/calldata.c | 6 +----- src_features/generic_tx_parser/cmd_field.c | 4 ---- src_features/generic_tx_parser/cmd_tx_info.c | 4 ---- src_features/generic_tx_parser/gtp_data_path.c | 4 ---- src_features/generic_tx_parser/gtp_field.c | 4 ---- .../generic_tx_parser/gtp_field_table.c | 4 ---- .../generic_tx_parser/gtp_param_amount.c | 4 ---- .../generic_tx_parser/gtp_param_datetime.c | 4 ---- .../generic_tx_parser/gtp_param_duration.c | 4 ---- .../generic_tx_parser/gtp_param_enum.c | 4 ---- src_features/generic_tx_parser/gtp_param_nft.c | 4 ---- src_features/generic_tx_parser/gtp_param_raw.c | 4 ---- .../generic_tx_parser/gtp_param_token_amount.c | 4 ---- .../generic_tx_parser/gtp_param_trusted_name.c | 2 -- .../generic_tx_parser/gtp_param_unit.c | 4 ---- .../generic_tx_parser/gtp_path_array.c | 4 ---- .../generic_tx_parser/gtp_path_slice.c | 4 ---- src_features/generic_tx_parser/gtp_tx_info.c | 4 ---- src_features/generic_tx_parser/gtp_value.c | 4 ---- .../provide_proxy_info/cmd_proxy_info.c | 4 ---- .../provide_proxy_info/cmd_proxy_info.h | 4 ---- src_features/provide_proxy_info/proxy_info.c | 4 ---- src_features/provide_proxy_info/proxy_info.h | 4 ---- src_features/signTx/cmd_signTx.c | 6 ------ src_features/signTx/ethUstream.c | 8 -------- src_features/signTx/ethUstream.h | 2 -- src_features/signTx/logic_signTx.c | 18 ------------------ src_nbgl/ui_gcs.c | 4 ---- tests/fuzzing/CMakeLists.txt | 1 - 31 files changed, 1 insertion(+), 138 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index fb07887cef..209ac0940f 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -23,8 +23,6 @@ ifneq ($(NFT_STAGING_KEY),0) DEFINES += HAVE_NFT_STAGING_KEY endif -DEFINES += HAVE_GENERIC_TX_PARSER - # CryptoAssetsList key CAL_TEST_KEY ?= 0 ifneq ($(CAL_TEST_KEY),0) diff --git a/src/main.c b/src/main.c index 9a1ea043e5..8d69573a46 100644 --- a/src/main.c +++ b/src/main.c @@ -81,11 +81,9 @@ void reset_app_context() { #endif memset((uint8_t *) &tmpCtx, 0, sizeof(tmpCtx)); forget_known_assets(); -#ifdef HAVE_GENERIC_TX_PARSER if (txContext.store_calldata) { gcs_cleanup(); } -#endif memset((uint8_t *) &txContext, 0, sizeof(txContext)); memset((uint8_t *) &tmpContent, 0, sizeof(tmpContent)); } @@ -238,7 +236,6 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { sw = handle_enum_value(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; -#ifdef HAVE_GENERIC_TX_PARSER case INS_GTP_TRANSACTION_INFO: sw = handle_tx_info(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; @@ -246,13 +243,10 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { case INS_GTP_FIELD: sw = handle_field(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; -#endif // HAVE_GENERIC_TX_PARSER -#ifdef HAVE_GENERIC_TX_PARSER case INS_PROVIDE_PROXY_INFO: sw = handle_proxy_info(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; -#endif #ifdef HAVE_DYNAMIC_NETWORKS case INS_PROVIDE_NETWORK_CONFIGURATION: diff --git a/src_features/generic_tx_parser/calldata.c b/src_features/generic_tx_parser/calldata.c index 4fcc2b7978..530000827b 100644 --- a/src_features/generic_tx_parser/calldata.c +++ b/src_features/generic_tx_parser/calldata.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "os_math.h" // MIN #include "calldata.h" @@ -130,7 +128,7 @@ bool calldata_append(const uint8_t *buffer, size_t size) { // selector handling if (g_calldata->chunks == NULL) { if (size < CALLDATA_SELECTOR_SIZE) { - // somehow getting an imcomplete selector + // somehow getting an incomplete selector calldata_cleanup(); return false; } @@ -215,5 +213,3 @@ const uint8_t *calldata_get_chunk(int idx) { } return g_calldata->chunk; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/cmd_field.c b/src_features/generic_tx_parser/cmd_field.c index 615cdcfc79..5704b6caf1 100644 --- a/src_features/generic_tx_parser/cmd_field.c +++ b/src_features/generic_tx_parser/cmd_field.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "cmd_field.h" #include "cx.h" #include "apdu_constants.h" @@ -50,5 +48,3 @@ uint16_t handle_field(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *payload } return APDU_RESPONSE_OK; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/cmd_tx_info.c b/src_features/generic_tx_parser/cmd_tx_info.c index c0685a7805..3b52c74cdc 100644 --- a/src_features/generic_tx_parser/cmd_tx_info.c +++ b/src_features/generic_tx_parser/cmd_tx_info.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "cmd_tx_info.h" #include "cx.h" @@ -74,5 +72,3 @@ void gcs_cleanup(void) { } calldata_cleanup(); } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_data_path.c b/src_features/generic_tx_parser/gtp_data_path.c index 426d9777bf..8c3d4b81ae 100644 --- a/src_features/generic_tx_parser/gtp_data_path.c +++ b/src_features/generic_tx_parser/gtp_data_path.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include // memcpy / explicit_bzero #include "os_print.h" #include "os_math.h" // MIN @@ -329,5 +327,3 @@ void data_path_cleanup(const s_parsed_value_collection *collection) { mem_rev_dealloc(collection->value[i].size); } } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_field.c b/src_features/generic_tx_parser/gtp_field.c index 069afe8dbe..5c077df8e6 100644 --- a/src_features/generic_tx_parser/gtp_field.c +++ b/src_features/generic_tx_parser/gtp_field.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "gtp_field.h" #include "utils.h" @@ -236,5 +234,3 @@ bool format_field(const s_field *field) { } return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_field_table.c b/src_features/generic_tx_parser/gtp_field_table.c index f3fe7447b7..0d70139cb5 100644 --- a/src_features/generic_tx_parser/gtp_field_table.c +++ b/src_features/generic_tx_parser/gtp_field_table.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "os_print.h" #include "gtp_field_table.h" @@ -109,5 +107,3 @@ bool get_from_field_table(int index, s_field_table_entry *entry) { } return true; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_amount.c b/src_features/generic_tx_parser/gtp_param_amount.c index 25c7dc5fd4..310572ce13 100644 --- a/src_features/generic_tx_parser/gtp_param_amount.c +++ b/src_features/generic_tx_parser/gtp_param_amount.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_param_amount.h" #include "network.h" #include "common_utils.h" @@ -72,5 +70,3 @@ bool format_param_amount(const s_param_amount *param, const char *name) { value_cleanup(¶m->value, &collec); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_datetime.c b/src_features/generic_tx_parser/gtp_param_datetime.c index 7da1b17645..c3ab6a9f42 100644 --- a/src_features/generic_tx_parser/gtp_param_datetime.c +++ b/src_features/generic_tx_parser/gtp_param_datetime.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_param_datetime.h" #include "gtp_field_table.h" #include "read.h" @@ -103,5 +101,3 @@ bool format_param_datetime(const s_param_datetime *param, const char *name) { value_cleanup(¶m->value, &collec); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_duration.c b/src_features/generic_tx_parser/gtp_param_duration.c index 6e0149c7fc..3fad951b84 100644 --- a/src_features/generic_tx_parser/gtp_param_duration.c +++ b/src_features/generic_tx_parser/gtp_param_duration.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_param_duration.h" #include "read.h" #include "gtp_field_table.h" @@ -107,5 +105,3 @@ bool format_param_duration(const s_param_duration *param, const char *name) { value_cleanup(¶m->value, &collec); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_enum.c b/src_features/generic_tx_parser/gtp_param_enum.c index 2707ef9479..4cf5a3ee00 100644 --- a/src_features/generic_tx_parser/gtp_param_enum.c +++ b/src_features/generic_tx_parser/gtp_param_enum.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_param_enum.h" #include "network.h" #include "enum_value.h" @@ -90,5 +88,3 @@ bool format_param_enum(const s_param_enum *param, const char *name) { value_cleanup(¶m->value, &collec); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_nft.c b/src_features/generic_tx_parser/gtp_param_nft.c index 1726631988..317dc9f33f 100644 --- a/src_features/generic_tx_parser/gtp_param_nft.c +++ b/src_features/generic_tx_parser/gtp_param_nft.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_param_nft.h" #include "manage_asset_info.h" #include "utils.h" @@ -100,5 +98,3 @@ bool format_param_nft(const s_param_nft *param, const char *name) { value_cleanup(¶m->id, &ids); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_raw.c b/src_features/generic_tx_parser/gtp_param_raw.c index d1b11ea7f6..1c62eb5a8e 100644 --- a/src_features/generic_tx_parser/gtp_param_raw.c +++ b/src_features/generic_tx_parser/gtp_param_raw.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "os_print.h" #include "gtp_param_raw.h" @@ -184,5 +182,3 @@ bool format_param_raw(const s_param_raw *param, const char *name) { value_cleanup(¶m->value, &collec); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_token_amount.c b/src_features/generic_tx_parser/gtp_param_token_amount.c index a6976aa403..af9e0f4ef5 100644 --- a/src_features/generic_tx_parser/gtp_param_token_amount.c +++ b/src_features/generic_tx_parser/gtp_param_token_amount.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "gtp_param_token_amount.h" #include "network.h" @@ -188,5 +186,3 @@ bool format_param_token_amount(const s_param_token_amount *param, const char *na value_cleanup(¶m->token, &collec_token); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_trusted_name.c b/src_features/generic_tx_parser/gtp_param_trusted_name.c index 26b330ff46..799aa42528 100644 --- a/src_features/generic_tx_parser/gtp_param_trusted_name.c +++ b/src_features/generic_tx_parser/gtp_param_trusted_name.c @@ -1,4 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER #ifdef HAVE_TRUSTED_NAME #include "gtp_param_trusted_name.h" @@ -136,4 +135,3 @@ bool format_param_trusted_name(const s_param_trusted_name *param, const char *na } #endif // HAVE_TRUSTED_NAME -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_param_unit.c b/src_features/generic_tx_parser/gtp_param_unit.c index bc9a913cf4..a14973b99c 100644 --- a/src_features/generic_tx_parser/gtp_param_unit.c +++ b/src_features/generic_tx_parser/gtp_param_unit.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_param_unit.h" #include "gtp_field_table.h" #include "shared_context.h" @@ -118,5 +116,3 @@ bool format_param_unit(const s_param_unit *param, const char *name) { value_cleanup(¶m->value, &collec); return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_path_array.c b/src_features/generic_tx_parser/gtp_path_array.c index 84ef3af5c1..5e696f6297 100644 --- a/src_features/generic_tx_parser/gtp_path_array.c +++ b/src_features/generic_tx_parser/gtp_path_array.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include #include "gtp_path_array.h" @@ -58,5 +56,3 @@ bool handle_array_struct(const s_tlv_data *data, s_path_array_context *context) } return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_path_slice.c b/src_features/generic_tx_parser/gtp_path_slice.c index ee5267ae06..e90793dbb0 100644 --- a/src_features/generic_tx_parser/gtp_path_slice.c +++ b/src_features/generic_tx_parser/gtp_path_slice.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "gtp_path_slice.h" #include "os_print.h" #include "read.h" @@ -43,5 +41,3 @@ bool handle_slice_struct(const s_tlv_data *data, s_path_slice_context *context) } return ret; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_tx_info.c b/src_features/generic_tx_parser/gtp_tx_info.c index 0deea1d1b9..0529814181 100644 --- a/src_features/generic_tx_parser/gtp_tx_info.c +++ b/src_features/generic_tx_parser/gtp_tx_info.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "gtp_tx_info.h" #include "read.h" @@ -366,5 +364,3 @@ bool validate_instruction_hash(void) { } return memcmp(g_tx_info->fields_hash, hash, sizeof(hash)) == 0; } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/generic_tx_parser/gtp_value.c b/src_features/generic_tx_parser/gtp_value.c index 6ce3a23959..ab59f3a7ed 100644 --- a/src_features/generic_tx_parser/gtp_value.c +++ b/src_features/generic_tx_parser/gtp_value.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "os_print.h" #include "gtp_value.h" #include "gtp_data_path.h" @@ -164,5 +162,3 @@ void value_cleanup(const s_value *value, const s_parsed_value_collection *collec data_path_cleanup(collection); } } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/src_features/provide_proxy_info/cmd_proxy_info.c b/src_features/provide_proxy_info/cmd_proxy_info.c index 84f6870692..43bbd05f86 100644 --- a/src_features/provide_proxy_info/cmd_proxy_info.c +++ b/src_features/provide_proxy_info/cmd_proxy_info.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "cmd_proxy_info.h" #include "proxy_info.h" #include "tlv_apdu.h" @@ -26,5 +24,3 @@ uint16_t handle_proxy_info(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *pa } return APDU_RESPONSE_OK; } - -#endif diff --git a/src_features/provide_proxy_info/cmd_proxy_info.h b/src_features/provide_proxy_info/cmd_proxy_info.h index 75e72cd92f..7f49cace44 100644 --- a/src_features/provide_proxy_info/cmd_proxy_info.h +++ b/src_features/provide_proxy_info/cmd_proxy_info.h @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #ifndef CMD_PROXY_INFO_H_ #define CMD_PROXY_INFO_H_ @@ -9,5 +7,3 @@ uint16_t handle_proxy_info(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *payload); #endif // CMD_PROXY_INFO_H_ - -#endif diff --git a/src_features/provide_proxy_info/proxy_info.c b/src_features/provide_proxy_info/proxy_info.c index 89ae5bdd91..cd7e32a798 100644 --- a/src_features/provide_proxy_info/proxy_info.c +++ b/src_features/provide_proxy_info/proxy_info.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include "proxy_info.h" #include "read.h" #include "utils.h" // buf_shrink_expand @@ -241,5 +239,3 @@ const uint8_t *get_implem_contract(const uint64_t *chain_id, } return g_proxy_info.implem_address; } - -#endif diff --git a/src_features/provide_proxy_info/proxy_info.h b/src_features/provide_proxy_info/proxy_info.h index 43d341ad81..a567772294 100644 --- a/src_features/provide_proxy_info/proxy_info.h +++ b/src_features/provide_proxy_info/proxy_info.h @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #ifndef PROXY_INFO_H_ #define PROXY_INFO_H_ @@ -38,5 +36,3 @@ const uint8_t *get_implem_contract(const uint64_t *chain_id, const uint8_t *selector); #endif // PROXY_INFO_H_ - -#endif diff --git a/src_features/signTx/cmd_signTx.c b/src_features/signTx/cmd_signTx.c index 77c2c71bd6..f6e54f8439 100644 --- a/src_features/signTx/cmd_signTx.c +++ b/src_features/signTx/cmd_signTx.c @@ -4,9 +4,7 @@ #include "eth_plugin_interface.h" #include "apdu_constants.h" #include "swap_error_code_helpers.h" -#ifdef HAVE_GENERIC_TX_PARSER #include "gtp_tx_info.h" -#endif #include "common_ui.h" #include "ui_callbacks.h" @@ -114,9 +112,7 @@ uint16_t handleSign(uint8_t p1, switch (p2) { case SIGN_MODE_BASIC: -#ifdef HAVE_GENERIC_TX_PARSER case SIGN_MODE_STORE: -#endif switch (p1) { case P1_FIRST: if ((sw = handle_first_sign_chunk(payload, length, &offset, p2)) != @@ -134,7 +130,6 @@ uint16_t handleSign(uint8_t p1, return APDU_RESPONSE_INVALID_P1_P2; } break; -#ifdef HAVE_GENERIC_TX_PARSER case SIGN_MODE_START_FLOW: if (appState != APP_STATE_SIGNING_TX) { PRINTF("Signature not initialized\n"); @@ -152,7 +147,6 @@ uint16_t handleSign(uint8_t p1, } *flags |= IO_ASYNCH_REPLY; return APDU_NO_RESPONSE; -#endif default: return APDU_RESPONSE_INVALID_P1_P2; } diff --git a/src_features/signTx/ethUstream.c b/src_features/signTx/ethUstream.c index d7aa481e40..f1b2752cce 100644 --- a/src_features/signTx/ethUstream.c +++ b/src_features/signTx/ethUstream.c @@ -22,9 +22,7 @@ #include "rlp_utils.h" #include "common_utils.h" #include "feature_signTx.h" -#ifdef HAVE_GENERIC_TX_PARSER #include "calldata.h" -#endif static bool check_fields(txContext_t *context, const char *name, uint32_t length) { UNUSED(name); // Just for the case where DEBUG is not enabled @@ -62,11 +60,7 @@ bool init_tx(txContext_t *context, cx_sha3_t *sha3, txContent_t *content, bool s context->sha3 = sha3; context->content = content; context->currentField = RLP_NONE + 1; -#ifdef HAVE_GENERIC_TX_PARSER context->store_calldata = store_calldata; -#else - UNUSED(store_calldata); -#endif if (cx_keccak_init_no_throw(context->sha3, 256) != CX_OK) { return false; } @@ -318,7 +312,6 @@ static bool processData(txContext_t *context) { if (copySize == 1 && *context->workBuffer == 0x00) { context->content->dataPresent = false; } -#ifdef HAVE_GENERIC_TX_PARSER if (context->store_calldata) { if (context->currentFieldPos == 0) { if (!calldata_init(context->currentFieldLength)) { @@ -327,7 +320,6 @@ static bool processData(txContext_t *context) { } calldata_append(context->workBuffer, copySize); } -#endif if (copyTxData(context, NULL, copySize) == false) { return false; } diff --git a/src_features/signTx/ethUstream.h b/src_features/signTx/ethUstream.h index 9d38f8d045..6645db294f 100644 --- a/src_features/signTx/ethUstream.h +++ b/src_features/signTx/ethUstream.h @@ -155,9 +155,7 @@ typedef struct txContext_t { uint8_t txType; bool rlp_size_known; uint32_t remaining_rlp_size; -#ifdef HAVE_GENERIC_TX_PARSER bool store_calldata; -#endif } txContext_t; bool init_tx(txContext_t *context, cx_sha3_t *sha3, txContent_t *content, bool store_calldata); diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c index 09eff1e76b..5dc9697f6a 100644 --- a/src_features/signTx/logic_signTx.c +++ b/src_features/signTx/logic_signTx.c @@ -66,11 +66,7 @@ customStatus_e customProcessor(txContext_t *context) { // If contract debugging mode is activated, do not go through the plugin activation // as they wouldn't be displayed if the plugin consumes all data but fallbacks // Still go through plugin activation in Swap context -#ifdef HAVE_GENERIC_TX_PARSER if (!context->store_calldata) { -#else - { -#endif if (!N_storage.contractDetails || G_called_from_swap) { eth_plugin_prepare_init(&pluginInit, context->workBuffer, @@ -99,11 +95,7 @@ customStatus_e customProcessor(txContext_t *context) { uint32_t copySize; uint32_t fieldPos = context->currentFieldPos; if (fieldPos == 0) { // not reached if a plugin is available -#ifdef HAVE_GENERIC_TX_PARSER if (!context->store_calldata) { -#else - { -#endif if (!N_storage.dataAllowed) { PRINTF("Data field forbidden\n"); ui_error_blind_signing(); @@ -459,12 +451,7 @@ __attribute__((noinline)) static uint16_t finalize_parsing_helper(const txContex } } -#ifdef HAVE_GENERIC_TX_PARSER if (!context->store_calldata) { -#else - (void) context; - { -#endif if (tmpContent.txContent.dataPresent && !N_storage.dataAllowed) { PRINTF("Data is present but not allowed\n"); report_finalize_error(); @@ -594,17 +581,12 @@ uint16_t finalize_parsing(const txContext_t *context) { if (sw != APDU_RESPONSE_OK) { return sw; } -#ifdef HAVE_GENERIC_TX_PARSER if (context->store_calldata) { if (calldata_get_selector() == NULL) { PRINTF("Asked to store calldata but none was provided!\n"); return APDU_RESPONSE_INVALID_DATA; } } else { -#else - (void) context; - { -#endif // If called from swap, the user has already validated a standard transaction // And we have already checked the fields of this transaction above if (G_called_from_swap && g_use_standard_ui) { diff --git a/src_nbgl/ui_gcs.c b/src_nbgl/ui_gcs.c index 4d0a38d6cb..2b998d46dd 100644 --- a/src_nbgl/ui_gcs.c +++ b/src_nbgl/ui_gcs.c @@ -1,5 +1,3 @@ -#ifdef HAVE_GENERIC_TX_PARSER - #include #include "ui_nbgl.h" #include "gtp_tx_info.h" @@ -257,5 +255,3 @@ bool ui_gcs(void) { void ui_gcs_cleanup(void) { mem_dealloc(g_alloc_size); } - -#endif // HAVE_GENERIC_TX_PARSER diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index 4d6de0eb2e..f122858372 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -151,7 +151,6 @@ set(DEFINES WEBUSB_URL= OS_IO_SEPROXYHAL STANDARD_APP_SYNC_RAPDU - HAVE_GENERIC_TX_PARSER HAVE_TRUSTED_NAME HAVE_SWAP HAVE_DYNAMIC_NETWORKS From 328c37cc14fe3cc50d058348fb32d6b9353ef487 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 11:05:18 +0200 Subject: [PATCH 07/13] Remove useless flag 'HAVE_TRUSTED_NAME' --- makefile_conf/features.mk | 1 - src/main.c | 4 ---- src/public_keys.h | 2 -- src/shared_context.h | 2 -- src_features/generic_tx_parser/gtp_field.c | 8 -------- src_features/generic_tx_parser/gtp_field.h | 2 -- src_features/generic_tx_parser/gtp_param_trusted_name.c | 4 ---- src_features/generic_tx_parser/gtp_param_trusted_name.h | 4 ---- src_features/getChallenge/challenge.h | 4 ---- src_features/getChallenge/cmd_get_challenge.c | 4 ---- src_features/provide_trusted_name/cmd_trusted_name.c | 4 ---- src_features/provide_trusted_name/cmd_trusted_name.h | 4 ---- src_features/provide_trusted_name/trusted_name.c | 4 ---- src_features/provide_trusted_name/trusted_name.h | 4 ---- src_features/signMessageEIP712/commands_712.c | 2 -- src_features/signMessageEIP712/filtering.c | 3 --- src_features/signMessageEIP712/ui_logic.c | 8 -------- src_features/signMessageEIP712/ui_logic.h | 2 -- src_nbgl/ui_approve_tx.c | 7 +------ src_nbgl/ui_home.c | 8 -------- tests/fuzzing/CMakeLists.txt | 1 - 21 files changed, 1 insertion(+), 81 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 209ac0940f..61aca88604 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -36,7 +36,6 @@ ifneq ($(CAL_STAGING_KEY),0) endif # ENS -DEFINES += HAVE_TRUSTED_NAME TRUSTED_NAME_TEST_KEY ?= 0 ifneq ($(TRUSTED_NAME_TEST_KEY),0) DEFINES += HAVE_TRUSTED_NAME_TEST_KEY diff --git a/src/main.c b/src/main.c index 8d69573a46..b0220ecb85 100644 --- a/src/main.c +++ b/src/main.c @@ -222,7 +222,6 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { sw = handle_eip712_filtering(cmd->p1, cmd->p2, cmd->data, cmd->lc, flags); break; -#ifdef HAVE_TRUSTED_NAME case INS_ENS_GET_CHALLENGE: sw = handle_get_challenge(tx); break; @@ -230,7 +229,6 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { case INS_ENS_PROVIDE_INFO: sw = handle_trusted_name(cmd->p1, cmd->data, cmd->lc); break; -#endif // HAVE_TRUSTED_NAME case INS_PROVIDE_ENUM_VALUE: sw = handle_enum_value(cmd->p1, cmd->p2, cmd->lc, cmd->data); @@ -402,10 +400,8 @@ void coin_main(eth_libargs_t *args) { ui_idle(); mem_init(); -#ifdef HAVE_TRUSTED_NAME // to prevent it from having a fixed value at boot roll_challenge(); -#endif // HAVE_TRUSTED_NAME app_main(); } diff --git a/src/public_keys.h b/src/public_keys.h index d941bbaf21..b1c04fd5c0 100644 --- a/src/public_keys.h +++ b/src/public_keys.h @@ -68,7 +68,6 @@ static const uint8_t LEDGER_NFT_METADATA_PUBLIC_KEY[] = { #endif }; -#ifdef HAVE_TRUSTED_NAME static const uint8_t TRUSTED_NAME_PUB_KEY[] = { #ifdef HAVE_TRUSTED_NAME_TEST_KEY 0x04, 0xb9, 0x1f, 0xbe, 0xc1, 0x73, 0xe3, 0xba, 0x4a, 0x71, 0x4e, 0x01, 0x4e, 0xbc, @@ -84,7 +83,6 @@ static const uint8_t TRUSTED_NAME_PUB_KEY[] = { 0xae, 0xf5, 0xaf, 0xcf, 0x90, 0xe8, 0x40, 0x88, 0x71 #endif }; -#endif // HAVE_TRUSTED_NAME // Only used for signing NFT plugins (ERC721 and ERC1155) static const uint8_t LEDGER_NFT_SELECTOR_PUBLIC_KEY[] = { diff --git a/src/shared_context.h b/src/shared_context.h index f71eb9faf0..3c4bb282bc 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -22,9 +22,7 @@ typedef struct internalStorage_t { bool contractDetails; bool displayNonce; bool verbose_eip712; -#ifdef HAVE_TRUSTED_NAME bool verbose_trusted_name; -#endif // HAVE_TRUSTED_NAME #ifdef HAVE_WEB3_CHECKS bool w3c_enable; // hidden setting (not shown in the UI) diff --git a/src_features/generic_tx_parser/gtp_field.c b/src_features/generic_tx_parser/gtp_field.c index 5c077df8e6..de8e3da24e 100644 --- a/src_features/generic_tx_parser/gtp_field.c +++ b/src_features/generic_tx_parser/gtp_field.c @@ -26,9 +26,7 @@ typedef union { s_param_duration_context duration_ctx; s_param_unit_context unit_ctx; s_param_enum_context enum_ctx; -#ifdef HAVE_TRUSTED_NAME s_param_trusted_name_context trusted_name_ctx; -#endif s_param_token_context token_ctx; } u_param_context; @@ -68,9 +66,7 @@ static bool handle_param_type(const s_tlv_data *data, s_field_ctx *context) { case PARAM_TYPE_DURATION: case PARAM_TYPE_UNIT: case PARAM_TYPE_ENUM: -#ifdef HAVE_TRUSTED_NAME case PARAM_TYPE_TRUSTED_NAME: -#endif case PARAM_TYPE_TOKEN: break; default: @@ -126,12 +122,10 @@ static bool handle_param(const s_tlv_data *data, s_field_ctx *context) { handler = (f_tlv_data_handler) &handle_param_enum_struct; param_ctx.enum_ctx.param = &context->field->param_enum; break; -#ifdef HAVE_TRUSTED_NAME case PARAM_TYPE_TRUSTED_NAME: handler = (f_tlv_data_handler) &handle_param_trusted_name_struct; param_ctx.trusted_name_ctx.param = &context->field->param_trusted_name; break; -#endif case PARAM_TYPE_TOKEN: handler = (f_tlv_data_handler) &handle_param_token_struct; param_ctx.token_ctx.param = &context->field->param_token; @@ -221,11 +215,9 @@ bool format_field(const s_field *field) { case PARAM_TYPE_ENUM: ret = format_param_enum(&field->param_enum, field->name); break; -#ifdef HAVE_TRUSTED_NAME case PARAM_TYPE_TRUSTED_NAME: ret = format_param_trusted_name(&field->param_trusted_name, field->name); break; -#endif case PARAM_TYPE_TOKEN: ret = format_param_token(&field->param_token, field->name); break; diff --git a/src_features/generic_tx_parser/gtp_field.h b/src_features/generic_tx_parser/gtp_field.h index dc9679c861..19ff321606 100644 --- a/src_features/generic_tx_parser/gtp_field.h +++ b/src_features/generic_tx_parser/gtp_field.h @@ -42,9 +42,7 @@ typedef struct { s_param_duration param_duration; s_param_unit param_unit; s_param_enum param_enum; -#ifdef HAVE_TRUSTED_NAME s_param_trusted_name param_trusted_name; -#endif s_param_token param_token; }; } s_field; diff --git a/src_features/generic_tx_parser/gtp_param_trusted_name.c b/src_features/generic_tx_parser/gtp_param_trusted_name.c index 799aa42528..c1f3769c7b 100644 --- a/src_features/generic_tx_parser/gtp_param_trusted_name.c +++ b/src_features/generic_tx_parser/gtp_param_trusted_name.c @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #include "gtp_param_trusted_name.h" #include "network.h" #include "trusted_name.h" @@ -133,5 +131,3 @@ bool format_param_trusted_name(const s_param_trusted_name *param, const char *na value_cleanup(¶m->value, &values); return ret; } - -#endif // HAVE_TRUSTED_NAME diff --git a/src_features/generic_tx_parser/gtp_param_trusted_name.h b/src_features/generic_tx_parser/gtp_param_trusted_name.h index 1d4523c69c..6eec5f4c5b 100644 --- a/src_features/generic_tx_parser/gtp_param_trusted_name.h +++ b/src_features/generic_tx_parser/gtp_param_trusted_name.h @@ -1,8 +1,6 @@ #ifndef GTP_PARAM_TRUSTED_NAME_H_ #define GTP_PARAM_TRUSTED_NAME_H_ -#ifdef HAVE_TRUSTED_NAME - #include #include #include "tlv.h" @@ -31,5 +29,3 @@ bool handle_param_trusted_name_struct(const s_tlv_data *data, bool format_param_trusted_name(const s_param_trusted_name *param, const char *name); #endif - -#endif // !GTP_PARAM_TRUSTED_NAME_H_ diff --git a/src_features/getChallenge/challenge.h b/src_features/getChallenge/challenge.h index a671945b4e..e5b600b90c 100644 --- a/src_features/getChallenge/challenge.h +++ b/src_features/getChallenge/challenge.h @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #ifndef CHALLENGE_H_ #define CHALLENGE_H_ @@ -10,5 +8,3 @@ uint32_t get_challenge(void); uint16_t handle_get_challenge(unsigned int *tx); #endif // CHALLENGE_H_ - -#endif // HAVE_TRUSTED_NAME diff --git a/src_features/getChallenge/cmd_get_challenge.c b/src_features/getChallenge/cmd_get_challenge.c index 83a5942d1f..7b717546c2 100644 --- a/src_features/getChallenge/cmd_get_challenge.c +++ b/src_features/getChallenge/cmd_get_challenge.c @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #include "os_io.h" #include "cx.h" #include "apdu_constants.h" @@ -32,5 +30,3 @@ uint16_t handle_get_challenge(unsigned int *tx) { *tx += 4; return APDU_RESPONSE_OK; } - -#endif // HAVE_TRUSTED_NAME diff --git a/src_features/provide_trusted_name/cmd_trusted_name.c b/src_features/provide_trusted_name/cmd_trusted_name.c index 0b286612b9..b4c63e36ea 100644 --- a/src_features/provide_trusted_name/cmd_trusted_name.c +++ b/src_features/provide_trusted_name/cmd_trusted_name.c @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #include #include "cmd_trusted_name.h" #include "trusted_name.h" @@ -37,5 +35,3 @@ uint16_t handle_trusted_name(uint8_t p1, const uint8_t *data, uint8_t length) { } return APDU_RESPONSE_OK; } - -#endif // HAVE_TRUSTED_NAME diff --git a/src_features/provide_trusted_name/cmd_trusted_name.h b/src_features/provide_trusted_name/cmd_trusted_name.h index 454564a975..de074280f8 100644 --- a/src_features/provide_trusted_name/cmd_trusted_name.h +++ b/src_features/provide_trusted_name/cmd_trusted_name.h @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #ifndef CMD_TRUSTED_NAME_H_ #define CMD_TRUSTED_NAME_H_ @@ -8,5 +6,3 @@ uint16_t handle_trusted_name(uint8_t p1, const uint8_t *data, uint8_t length); #endif // !CMD_TRUSTED_NAME_H_ - -#endif // !HAVE_TRUSTED_NAME diff --git a/src_features/provide_trusted_name/trusted_name.c b/src_features/provide_trusted_name/trusted_name.c index b415182af9..7e5043c4fb 100644 --- a/src_features/provide_trusted_name/trusted_name.c +++ b/src_features/provide_trusted_name/trusted_name.c @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #include #include "trusted_name.h" #include "network.h" // chain_is_ethereum_compatible @@ -638,5 +636,3 @@ bool verify_trusted_name_struct(const s_trusted_name_ctx *context) { g_trusted_name_info.addr); return true; } - -#endif // HAVE_TRUSTED_NAME diff --git a/src_features/provide_trusted_name/trusted_name.h b/src_features/provide_trusted_name/trusted_name.h index 36c4dd57ec..086db30fcd 100644 --- a/src_features/provide_trusted_name/trusted_name.h +++ b/src_features/provide_trusted_name/trusted_name.h @@ -1,5 +1,3 @@ -#ifdef HAVE_TRUSTED_NAME - #ifndef TRUSTED_NAME_H_ #define TRUSTED_NAME_H_ @@ -70,5 +68,3 @@ bool handle_trusted_name_struct(const s_tlv_data *data, s_trusted_name_ctx *cont bool verify_trusted_name_struct(const s_trusted_name_ctx *ctx); #endif // !TRUSTED_NAME_H_ - -#endif // !HAVE_TRUSTED_NAME diff --git a/src_features/signMessageEIP712/commands_712.c b/src_features/signMessageEIP712/commands_712.c index 133d3c4bc5..f0160b44ff 100644 --- a/src_features/signMessageEIP712/commands_712.c +++ b/src_features/signMessageEIP712/commands_712.c @@ -204,11 +204,9 @@ uint16_t handle_eip712_filtering(uint8_t p1, reply_apdu = false; } break; -#ifdef HAVE_TRUSTED_NAME case P2_FILT_CONTRACT_NAME: ret = filtering_trusted_name(cdata, length, p1 == 1, &path_crc); break; -#endif case P2_FILT_DATE_TIME: ret = filtering_date_time(cdata, length, p1 == 1, &path_crc); break; diff --git a/src_features/signMessageEIP712/filtering.c b/src_features/signMessageEIP712/filtering.c index 7351642b10..56d44722ac 100644 --- a/src_features/signMessageEIP712/filtering.c +++ b/src_features/signMessageEIP712/filtering.c @@ -330,7 +330,6 @@ bool filtering_discarded_path(const uint8_t *payload, uint8_t length) { return true; } -#ifdef HAVE_TRUSTED_NAME /** * Command to display a field as a trusted name * @@ -427,8 +426,6 @@ bool filtering_trusted_name(const uint8_t *payload, ui_712_set_trusted_name_requirements(type_count, types, source_count, sources); return true; } -#endif // HAVE_TRUSTED_NAME - /** * Command to display a field as a date-time * diff --git a/src_features/signMessageEIP712/ui_logic.c b/src_features/signMessageEIP712/ui_logic.c index f3de36e367..389e8319d3 100644 --- a/src_features/signMessageEIP712/ui_logic.c +++ b/src_features/signMessageEIP712/ui_logic.c @@ -56,12 +56,10 @@ typedef struct { uint32_t filters_crc[MAX_FILTERS]; uint8_t discarded_path_length; char discarded_path[255]; -#ifdef HAVE_TRUSTED_NAME uint8_t tn_type_count; uint8_t tn_source_count; e_name_type tn_types[TN_TYPE_COUNT]; e_name_source tn_sources[TN_SOURCE_COUNT]; -#endif char ui_pairs_buffer[(SHARED_CTX_FIELD_1_SIZE + SHARED_CTX_FIELD_2_SIZE) * 2]; } t_ui_context; @@ -512,7 +510,6 @@ static bool update_amount_join(const uint8_t *data, uint8_t length) { return true; } -#ifdef HAVE_TRUSTED_NAME /** * Try to substitute given address by a matching contract name * @@ -536,7 +533,6 @@ static bool ui_712_format_trusted_name(const uint8_t *data, uint8_t length) { } return true; } -#endif /** * Format given data as a human-readable date/time representation @@ -636,13 +632,11 @@ bool ui_712_feed_to_display(const void *field_ptr, } } -#ifdef HAVE_TRUSTED_NAME if (ui_ctx->field_flags & UI_712_TRUSTED_NAME) { if (!ui_712_format_trusted_name(data, length)) { return false; } } -#endif // Check if this field is supposed to be displayed if (last && ui_712_field_shown()) { @@ -894,7 +888,6 @@ const char *ui_712_get_discarded_path(uint8_t *length) { return ui_ctx->discarded_path; } -#ifdef HAVE_TRUSTED_NAME void ui_712_set_trusted_name_requirements(uint8_t type_count, const e_name_type *types, uint8_t source_count, @@ -904,7 +897,6 @@ void ui_712_set_trusted_name_requirements(uint8_t type_count, ui_ctx->tn_source_count = source_count; memcpy(ui_ctx->tn_sources, sources, source_count); } -#endif /* * Get UI pairs buffer diff --git a/src_features/signMessageEIP712/ui_logic.h b/src_features/signMessageEIP712/ui_logic.h index 416e142854..129160c73f 100644 --- a/src_features/signMessageEIP712/ui_logic.h +++ b/src_features/signMessageEIP712/ui_logic.h @@ -49,12 +49,10 @@ bool ui_712_show_raw_key(const void *field_ptr); bool ui_712_push_new_filter_path(uint32_t path_crc); void ui_712_set_discarded_path(const char *path, uint8_t length); const char *ui_712_get_discarded_path(uint8_t *length); -#ifdef HAVE_TRUSTED_NAME void ui_712_set_trusted_name_requirements(uint8_t type_count, const e_name_type *types, uint8_t source_count, const e_name_source *sources); -#endif char *get_ui_pairs_buffer(size_t *size); #endif // UI_LOGIC_712_H_ diff --git a/src_nbgl/ui_approve_tx.c b/src_nbgl/ui_approve_tx.c index 1c3944aa26..a5b25b6418 100644 --- a/src_nbgl/ui_approve_tx.c +++ b/src_nbgl/ui_approve_tx.c @@ -26,9 +26,7 @@ static char msg_buffer[MAX_PLUGIN_ITEMS][VALUE_MAX_LEN]; struct tx_approval_context_t { bool fromPlugin; bool displayNetwork; -#ifdef HAVE_TRUSTED_NAME bool trusted_name_match; -#endif }; static struct tx_approval_context_t tx_approval_context; @@ -153,25 +151,22 @@ static uint8_t setTagValuePairs(void) { nbPairs++; } -#ifdef HAVE_TRUSTED_NAME uint64_t chain_id = get_tx_chain_id(); e_name_type type = TN_TYPE_ACCOUNT; e_name_source source = TN_SOURCE_ENS; tx_approval_context.trusted_name_match = get_trusted_name(1, &type, 1, &source, &chain_id, tmpContent.txContent.destination); + if (tx_approval_context.trusted_name_match) { pairs[nbPairs].item = "To"; pairs[nbPairs].value = g_trusted_name; nbPairs++; } if (!tx_approval_context.trusted_name_match || N_storage.verbose_trusted_name) { -#endif pairs[nbPairs].item = "To"; pairs[nbPairs].value = strings.common.toAddress; nbPairs++; -#ifdef HAVE_TRUSTED_NAME } -#endif if (N_storage.displayNonce) { pairs[nbPairs].item = "Nonce"; pairs[nbPairs].value = strings.common.nonce; diff --git a/src_nbgl/ui_home.c b/src_nbgl/ui_home.c index 60fd981902..b475932ede 100644 --- a/src_nbgl/ui_home.c +++ b/src_nbgl/ui_home.c @@ -18,9 +18,7 @@ nbgl_warning_t warning; enum { WEB3_CHECK_TOKEN = FIRST_USER_TOKEN, BLIND_SIGNING_TOKEN, -#ifdef HAVE_TRUSTED_NAME TRUSTED_NAME_VERBOSE_TOKEN, -#endif NONCE_TOKEN, EIP712_VERBOSE_TOKEN, #ifdef HAVE_EIP7702 @@ -34,9 +32,7 @@ enum { WEB3_CHECK_ID, #endif BLIND_SIGNING_ID, -#ifdef HAVE_TRUSTED_NAME TRUSTED_NAME_VERBOSE_ID, -#endif NONCE_ID, EIP712_VERBOSE_ID, DEBUG_ID, @@ -77,13 +73,11 @@ static void setting_toggle_callback(int token, uint8_t index, int page) { switches[BLIND_SIGNING_ID].initState = (nbgl_state_t) value; nvm_write((void *) &N_storage.dataAllowed, (void *) &value, sizeof(value)); break; -#ifdef HAVE_TRUSTED_NAME case TRUSTED_NAME_VERBOSE_TOKEN: value = !N_storage.verbose_trusted_name; switches[TRUSTED_NAME_VERBOSE_ID].initState = (nbgl_state_t) value; nvm_write((void *) &N_storage.verbose_trusted_name, (void *) &value, sizeof(value)); break; -#endif // HAVE_TRUSTED_NAME case NONCE_TOKEN: value = !N_storage.displayNonce; switches[NONCE_ID].initState = (nbgl_state_t) value; @@ -141,7 +135,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u switches[BLIND_SIGNING_ID].tuneId = TUNE_TAP_CASUAL; #endif -#ifdef HAVE_TRUSTED_NAME switches[TRUSTED_NAME_VERBOSE_ID].initState = N_storage.verbose_trusted_name ? ON_STATE : OFF_STATE; switches[TRUSTED_NAME_VERBOSE_ID].text = "ENS addresses"; @@ -154,7 +147,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u #ifdef HAVE_PIEZO_SOUND switches[TRUSTED_NAME_VERBOSE_ID].tuneId = TUNE_TAP_CASUAL; #endif -#endif // HAVE_TRUSTED_NAME switches[NONCE_ID].initState = N_storage.displayNonce ? ON_STATE : OFF_STATE; switches[NONCE_ID].text = "Nonce"; diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index f122858372..1f0d5fe904 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -151,7 +151,6 @@ set(DEFINES WEBUSB_URL= OS_IO_SEPROXYHAL STANDARD_APP_SYNC_RAPDU - HAVE_TRUSTED_NAME HAVE_SWAP HAVE_DYNAMIC_NETWORKS HAVE_WEB3_CHECKS From 8d067f620bc525ef4ee06c1479a9f15a8381f773 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 11:11:30 +0200 Subject: [PATCH 08/13] Remove useless flag 'HAVE_DYNAMIC_NETWORKS' --- makefile_conf/features.mk | 3 --- src/main.c | 2 -- src/network.c | 2 -- src_features/provide_network_info/cmd_network_info.c | 4 ---- src_features/provide_network_info/network_info.c | 4 ---- tests/fuzzing/CMakeLists.txt | 1 - 6 files changed, 16 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 61aca88604..0d3ee16cff 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -41,9 +41,6 @@ ifneq ($(TRUSTED_NAME_TEST_KEY),0) DEFINES += HAVE_TRUSTED_NAME_TEST_KEY endif -# Dynamic networks -DEFINES += HAVE_DYNAMIC_NETWORKS - # Transaction Checks # TODO: remove this check once the web3 checks are implemented on all targets ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX)) diff --git a/src/main.c b/src/main.c index b0220ecb85..92b4593102 100644 --- a/src/main.c +++ b/src/main.c @@ -246,11 +246,9 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { sw = handle_proxy_info(cmd->p1, cmd->p2, cmd->lc, cmd->data); break; -#ifdef HAVE_DYNAMIC_NETWORKS case INS_PROVIDE_NETWORK_CONFIGURATION: sw = handle_network_info(cmd->p1, cmd->p2, cmd->data, cmd->lc, tx); break; -#endif // HAVE_DYNAMIC_NETWORKS #ifdef HAVE_WEB3_CHECKS case INS_PROVIDE_TX_SIMULATION: diff --git a/src/network.c b/src/network.c index c1095ab802..e8b7d5470a 100644 --- a/src/network.c +++ b/src/network.c @@ -124,7 +124,6 @@ static const network_info_t NETWORK_MAPPING[] = { static const network_info_t *get_network_from_chain_id(const uint64_t *chain_id) { if (*chain_id != 0) { -#ifdef HAVE_DYNAMIC_NETWORKS // Look if the network is available for (size_t i = 0; i < MAX_DYNAMIC_NETWORKS; i++) { if (DYNAMIC_NETWORK_INFO[i].chain_id == *chain_id) { @@ -134,7 +133,6 @@ static const network_info_t *get_network_from_chain_id(const uint64_t *chain_id) return (const network_info_t *) &DYNAMIC_NETWORK_INFO[i]; } } -#endif // HAVE_DYNAMIC_NETWORKS // Fallback to hardcoded table for (size_t i = 0; i < ARRAYLEN(NETWORK_MAPPING); i++) { diff --git a/src_features/provide_network_info/cmd_network_info.c b/src_features/provide_network_info/cmd_network_info.c index d0f585b570..0cc65bb5f0 100644 --- a/src_features/provide_network_info/cmd_network_info.c +++ b/src_features/provide_network_info/cmd_network_info.c @@ -1,5 +1,3 @@ -#ifdef HAVE_DYNAMIC_NETWORKS - #include #include "cmd_network_info.h" #include "apdu_constants.h" @@ -332,5 +330,3 @@ uint16_t handle_network_info(uint8_t p1, return sw; } - -#endif // HAVE_DYNAMIC_NETWORKS diff --git a/src_features/provide_network_info/network_info.c b/src_features/provide_network_info/network_info.c index 076afe50d1..46c8b0e812 100644 --- a/src_features/provide_network_info/network_info.c +++ b/src_features/provide_network_info/network_info.c @@ -1,5 +1,3 @@ -#ifdef HAVE_DYNAMIC_NETWORKS - #include "network_info.h" #include "utils.h" #include "read.h" @@ -278,5 +276,3 @@ bool verify_network_info_struct(const s_network_info_ctx *context) { #endif return true; } - -#endif // HAVE_DYNAMIC_NETWORKS diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index 1f0d5fe904..07604cdd18 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -152,7 +152,6 @@ set(DEFINES OS_IO_SEPROXYHAL STANDARD_APP_SYNC_RAPDU HAVE_SWAP - HAVE_DYNAMIC_NETWORKS HAVE_WEB3_CHECKS HAVE_EIP7702 HAVE_EIP7702_WHITELIST From 94210d0b9afb518294dbdb4ec9238f7be0805794 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 11:18:22 +0200 Subject: [PATCH 09/13] Remove useless flags 'HAVE_EIP7702' and 'HAVE_EIP7702_WHITELIST' --- makefile_conf/features.mk | 4 ---- src/common_ui.h | 4 ---- src/main.c | 2 -- src/network.c | 2 -- src/shared_context.h | 8 -------- .../signAuthorizationEIP7702/auth_7702.c | 4 ---- .../signAuthorizationEIP7702/commands_7702.c | 16 ---------------- .../signAuthorizationEIP7702/rlp_encode.c | 4 ---- .../signAuthorizationEIP7702/ui_common_7702.c | 4 ---- .../signAuthorizationEIP7702/whitelist_7702.c | 4 ---- .../signAuthorizationEIP7702/whitelist_7702.h | 4 ---- src_features/signTx/cmd_signTx.c | 2 -- src_features/signTx/ethUstream.c | 10 ---------- src_features/signTx/ethUstream.h | 17 ----------------- src_features/signTx/logic_signTx.c | 7 ++----- src_features/signTx/ui_common_signTx.c | 6 +----- src_nbgl/ui_home.c | 8 -------- src_nbgl/ui_no_7702.c | 4 ---- src_nbgl/ui_no_7702_whitelist.c | 4 ---- tests/fuzzing/CMakeLists.txt | 2 -- 20 files changed, 3 insertions(+), 113 deletions(-) diff --git a/makefile_conf/features.mk b/makefile_conf/features.mk index 0d3ee16cff..09d335852b 100644 --- a/makefile_conf/features.mk +++ b/makefile_conf/features.mk @@ -47,10 +47,6 @@ ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX)) DEFINES += HAVE_WEB3_CHECKS endif -# EIP 7702 -DEFINES += HAVE_EIP7702 -DEFINES += HAVE_EIP7702_WHITELIST - EIP7702_TEST_WHITELIST ?= 0 ifneq ($(EIP7702_TEST_WHITELIST),0) DEFINES += HAVE_EIP7702_WHITELIST_TEST diff --git a/src/common_ui.h b/src/common_ui.h index bd8e249576..5abe86c295 100644 --- a/src/common_ui.h +++ b/src/common_ui.h @@ -34,11 +34,7 @@ bool ui_gcs(void); // EIP-7702 void ui_sign_7702_auth(void); void ui_sign_7702_revocation(void); -#ifdef HAVE_EIP7702 void ui_error_no_7702(void); -#ifdef HAVE_EIP7702_WHITELIST void ui_error_no_7702_whitelist(void); -#endif // HAVE_EIP7702_WHITELIST -#endif // HAVE_EIP7702 #endif // _COMMON_UI_H_ diff --git a/src/main.c b/src/main.c index 92b4593102..58fc51f422 100644 --- a/src/main.c +++ b/src/main.c @@ -256,11 +256,9 @@ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { break; #endif -#ifdef HAVE_EIP7702 case INS_SIGN_EIP7702_AUTHORIZATION: sw = handleSignEIP7702Authorization(cmd->p1, cmd->data, cmd->lc, flags); break; -#endif // HAVE_EIP7702 default: sw = APDU_RESPONSE_INVALID_INS; diff --git a/src/network.c b/src/network.c index e8b7d5470a..357d88a348 100644 --- a/src/network.c +++ b/src/network.c @@ -194,9 +194,7 @@ uint64_t get_tx_chain_id(void) { break; case EIP2930: case EIP1559: -#ifdef HAVE_EIP7702 case EIP7702: -#endif // HAVE_EIP7702 chain_id = u64_from_BE(tmpContent.txContent.chainID.value, tmpContent.txContent.chainID.length); break; diff --git a/src/shared_context.h b/src/shared_context.h index 3c4bb282bc..a1cdf3b5ec 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -28,9 +28,7 @@ typedef struct internalStorage_t { // hidden setting (not shown in the UI) bool w3c_opt_in; #endif -#ifdef HAVE_EIP7702 bool eip7702_enable; -#endif // HAVE_EIP7702 bool initialized; } internalStorage_t; @@ -90,23 +88,17 @@ typedef struct messageSigningContext712_t { uint8_t messageHash[32]; } messageSigningContext712_t; -#ifdef HAVE_EIP7702 - typedef struct authSigningContext7702_t { bip32_path_t bip32; uint8_t authHash[INT256_LENGTH]; } authSigningContext7702_t; -#endif // HAVE_EIP7702 - typedef union { publicKeyContext_t publicKeyContext; transactionContext_t transactionContext; messageSigningContext_t messageSigningContext; messageSigningContext712_t messageSigningContext712; -#ifdef HAVE_EIP7702 authSigningContext7702_t authSigningContext7702; -#endif // HAVE_EIP7702 } tmpCtx_t; typedef union { diff --git a/src_features/signAuthorizationEIP7702/auth_7702.c b/src_features/signAuthorizationEIP7702/auth_7702.c index 421afd515f..3710f42d65 100644 --- a/src_features/signAuthorizationEIP7702/auth_7702.c +++ b/src_features/signAuthorizationEIP7702/auth_7702.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702 - #include "auth_7702.h" #include "utils.h" #include "read.h" @@ -93,5 +91,3 @@ bool handle_auth_7702_struct(const s_tlv_data *data, s_auth_7702_ctx *context) { bool verify_auth_7702_struct(const s_auth_7702_ctx *context) { return ((context->mask_parsed & MASK_ALL) == MASK_ALL) && (context->version == STRUCT_VERSION); } - -#endif // HAVE_EIP7702 diff --git a/src_features/signAuthorizationEIP7702/commands_7702.c b/src_features/signAuthorizationEIP7702/commands_7702.c index ce78239871..fe8f783311 100644 --- a/src_features/signAuthorizationEIP7702/commands_7702.c +++ b/src_features/signAuthorizationEIP7702/commands_7702.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702 - #include "shared_context.h" #include "apdu_constants.h" #include "tlv_apdu.h" @@ -68,9 +66,7 @@ static bool handleAuth7702TLV(const uint8_t *payload, uint16_t size, bool to_fre cx_err_t error = CX_INTERNAL_ERROR; cx_ecfp_public_key_t publicKey; const char *networkName; -#ifdef HAVE_EIP7702_WHITELIST const char *delegateName; -#endif parsing_ret = tlv_parse(payload, size, (f_tlv_data_handler) handle_auth_7702_struct, &auth_7702_ctx); @@ -136,7 +132,6 @@ static bool handleAuth7702TLV(const uint8_t *payload, uint16_t size, bool to_fre auth7702->chainId)); // * Delegate if (!allzeroes(auth7702->delegate, sizeof(auth7702->delegate))) { -#ifdef HAVE_EIP7702_WHITELIST // Check if the delegate is on the whitelist for this chainId delegateName = get_delegate_name(&auth7702->chainId, auth7702->delegate); if (delegateName == NULL) { @@ -147,15 +142,6 @@ static bool handleAuth7702TLV(const uint8_t *payload, uint16_t size, bool to_fre } else { strlcpy(strings.common.toAddress, delegateName, sizeof(strings.common.toAddress)); } -#else - if (!getEthDisplayableAddress(delegate, - strings.common.toAddress, - sizeof(strings.common.toAddress), - auth7702->chainId)) { - g_7702_sw = APDU_RESPONSE_UNKNOWN; - return false; - } -#endif // HAVE_EIP7702_WHITELIST } // * ChainId if (auth7702->chainId == CHAIN_ID_ALL) { @@ -209,5 +195,3 @@ uint16_t handleSignEIP7702Authorization(uint8_t p1, *flags |= IO_ASYNCH_REPLY; return APDU_NO_RESPONSE; } - -#endif // HAVE_EIP7702 diff --git a/src_features/signAuthorizationEIP7702/rlp_encode.c b/src_features/signAuthorizationEIP7702/rlp_encode.c index 49a45847ef..782d722995 100644 --- a/src_features/signAuthorizationEIP7702/rlp_encode.c +++ b/src_features/signAuthorizationEIP7702/rlp_encode.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702 - #include "rlp_encode.h" #define RLP_NUMBER8_MAX 0x7F @@ -78,5 +76,3 @@ uint8_t rlpEncodeListHeader8(uint8_t size, uint8_t *output, size_t output_size) return 2; } } - -#endif // HAVE_EIP7702 \ No newline at end of file diff --git a/src_features/signAuthorizationEIP7702/ui_common_7702.c b/src_features/signAuthorizationEIP7702/ui_common_7702.c index da4fd0df2e..2c6da7ed4b 100644 --- a/src_features/signAuthorizationEIP7702/ui_common_7702.c +++ b/src_features/signAuthorizationEIP7702/ui_common_7702.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702 - #include "shared_context.h" #include "common_ui.h" #include "ui_callbacks.h" @@ -29,5 +27,3 @@ unsigned int auth_7702_ok_cb(void) { unsigned int auth_7702_cancel_cb(void) { return io_seproxyhal_send_status(APDU_RESPONSE_CONDITION_NOT_SATISFIED, 0, true, true); } - -#endif // HAVE_EIP7702 diff --git a/src_features/signAuthorizationEIP7702/whitelist_7702.c b/src_features/signAuthorizationEIP7702/whitelist_7702.c index 2b750b0b45..c4a22eee37 100644 --- a/src_features/signAuthorizationEIP7702/whitelist_7702.c +++ b/src_features/signAuthorizationEIP7702/whitelist_7702.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702_WHITELIST - #include #include "os_utils.h" #include "os_pic.h" @@ -47,5 +45,3 @@ const char *get_delegate_name(const uint64_t *chain_id, const uint8_t *address) } return NULL; } - -#endif // HAVE_EIP7702_WHITELIST diff --git a/src_features/signAuthorizationEIP7702/whitelist_7702.h b/src_features/signAuthorizationEIP7702/whitelist_7702.h index 1a55608257..ba716560b9 100644 --- a/src_features/signAuthorizationEIP7702/whitelist_7702.h +++ b/src_features/signAuthorizationEIP7702/whitelist_7702.h @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702_WHITELIST - #pragma once #include @@ -15,5 +13,3 @@ typedef struct eip7702_whitelist_s { } eip7702_whitelist_t; const char *get_delegate_name(const uint64_t *chain_id, const uint8_t *address); - -#endif // HAVE_EIP7702_WHITELIST diff --git a/src_features/signTx/cmd_signTx.c b/src_features/signTx/cmd_signTx.c index f6e54f8439..51d1274b39 100644 --- a/src_features/signTx/cmd_signTx.c +++ b/src_features/signTx/cmd_signTx.c @@ -49,9 +49,7 @@ static uint16_t handle_first_sign_chunk(const uint8_t *payload, switch (tx_type) { case EIP1559: case EIP2930: -#ifdef HAVE_EIP7702 case EIP7702: -#endif // HAVE_EIP7702 break; default: PRINTF("Transaction type %d not supported\n", tx_type); diff --git a/src_features/signTx/ethUstream.c b/src_features/signTx/ethUstream.c index f1b2752cce..f7a6da26c9 100644 --- a/src_features/signTx/ethUstream.c +++ b/src_features/signTx/ethUstream.c @@ -143,8 +143,6 @@ static bool processAccessList(txContext_t *context) { return true; } -#ifdef HAVE_EIP7702 - static bool processAuthList(txContext_t *context) { if (check_empty_list(context, "RLP_AUTH_LIST") == false) { return false; @@ -164,8 +162,6 @@ static bool processAuthList(txContext_t *context) { return true; } -#endif // HAVE_EIP7702 - static bool processChainID(txContext_t *context) { if (check_fields(context, "RLP_CHAINID", INT256_LENGTH) == false) { return false; @@ -374,8 +370,6 @@ static bool processV(txContext_t *context) { return true; } -#ifdef HAVE_EIP7702 - static bool processEIP7702Tx(txContext_t *context) { bool ret = false; switch (context->currentField) { @@ -428,8 +422,6 @@ static bool processEIP7702Tx(txContext_t *context) { return ret; } -#endif // HAVE_EIP7702 - static bool processEIP1559Tx(txContext_t *context) { bool ret = false; switch (context->currentField) { @@ -654,13 +646,11 @@ static parserStatus_e processTxInternal(txContext_t *context) { return USTREAM_FAULT; } break; -#ifdef HAVE_EIP7702 case EIP7702: if (processEIP7702Tx(context) == false) { return USTREAM_FAULT; } break; -#endif // HAVE_EIP7702 default: PRINTF("Transaction type %d is not supported\n", context->txType); return USTREAM_FAULT; diff --git a/src_features/signTx/ethUstream.h b/src_features/signTx/ethUstream.h index 6645db294f..102b286c4c 100644 --- a/src_features/signTx/ethUstream.h +++ b/src_features/signTx/ethUstream.h @@ -35,23 +35,12 @@ typedef enum customStatus_e { // First variant of every Tx enum. #define RLP_NONE 0 -#ifdef HAVE_EIP7702 - #define PARSING_IS_DONE(ctx) \ ((ctx->txType == LEGACY && ctx->currentField == LEGACY_RLP_DONE) || \ (ctx->txType == EIP2930 && ctx->currentField == EIP2930_RLP_DONE) || \ (ctx->txType == EIP1559 && ctx->currentField == EIP1559_RLP_DONE) || \ (ctx->txType == EIP7702 && ctx->currentField == EIP7702_RLP_DONE)) -#else - -#define PARSING_IS_DONE(ctx) \ - ((ctx->txType == LEGACY && ctx->currentField == LEGACY_RLP_DONE) || \ - (ctx->txType == EIP2930 && ctx->currentField == EIP2930_RLP_DONE) || \ - (ctx->txType == EIP1559 && ctx->currentField == EIP1559_RLP_DONE)) - -#endif // HAVE_EIP7702 - typedef enum rlpLegacyTxField_e { LEGACY_RLP_NONE = RLP_NONE, LEGACY_RLP_CONTENT, @@ -96,8 +85,6 @@ typedef enum rlpEIP1559TxField_e { EIP1559_RLP_DONE } rlpEIP1559TxField_e; -#ifdef HAVE_EIP7702 - typedef enum rlpEIP7702TxField_e { EIP7702_RLP_NONE = RLP_NONE, EIP7702_RLP_CONTENT, @@ -114,8 +101,6 @@ typedef enum rlpEIP7702TxField_e { EIP7702_RLP_DONE } rlpEIP7702TxField_e; -#endif // HAVE_EIP7702 - #define MIN_TX_TYPE 0x00 #define MAX_TX_TYPE 0x7f @@ -124,9 +109,7 @@ typedef enum rlpEIP7702TxField_e { typedef enum txType_e { EIP2930 = 0x01, EIP1559 = 0x02, -#ifdef HAVE_EIP7702 EIP7702 = 0x04, -#endif // HAVE_EIP7702 LEGACY = 0xc0 // Legacy tx are greater than or equal to 0xc0. } txType_e; diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c index 5dc9697f6a..adb9b0a6ce 100644 --- a/src_features/signTx/logic_signTx.c +++ b/src_features/signTx/logic_signTx.c @@ -39,11 +39,8 @@ static uint32_t splitBinaryParameterPart(char *result, size_t result_size, uint8 customStatus_e customProcessor(txContext_t *context) { if (((context->txType == LEGACY && context->currentField == LEGACY_RLP_DATA) || (context->txType == EIP2930 && context->currentField == EIP2930_RLP_DATA) || - (context->txType == EIP1559 && context->currentField == EIP1559_RLP_DATA) -#ifdef HAVE_EIP7702 - || (context->txType == EIP7702 && context->currentField == EIP7702_RLP_DATA) -#endif // HAVE_EIP7702 - ) && + (context->txType == EIP1559 && context->currentField == EIP1559_RLP_DATA) || + (context->txType == EIP7702 && context->currentField == EIP7702_RLP_DATA)) && (context->currentFieldLength != 0)) { context->content->dataPresent = true; // If handling a new contract rather than a function call, abort immediately diff --git a/src_features/signTx/ui_common_signTx.c b/src_features/signTx/ui_common_signTx.c index 100e2dcb78..7a0b2932de 100644 --- a/src_features/signTx/ui_common_signTx.c +++ b/src_features/signTx/ui_common_signTx.c @@ -19,11 +19,7 @@ uint32_t io_seproxyhal_touch_tx_ok(void) { G_io_apdu_buffer + 1 + 32, &info)); - if (txContext.txType == EIP1559 || txContext.txType == EIP2930 -#ifdef HAVE_EIP7702 - || txContext.txType == EIP7702 -#endif // HAVE_EIP7702 - ) { + if (txContext.txType == EIP1559 || txContext.txType == EIP2930 || txContext.txType == EIP7702) { if (info & CX_ECCINFO_PARITY_ODD) { G_io_apdu_buffer[0] = 1; } else { diff --git a/src_nbgl/ui_home.c b/src_nbgl/ui_home.c index b475932ede..de59bd2007 100644 --- a/src_nbgl/ui_home.c +++ b/src_nbgl/ui_home.c @@ -21,9 +21,7 @@ enum { TRUSTED_NAME_VERBOSE_TOKEN, NONCE_TOKEN, EIP712_VERBOSE_TOKEN, -#ifdef HAVE_EIP7702 EIP7702_TOKEN, -#endif // HAVE_EIP7702 DEBUG_TOKEN, }; @@ -36,9 +34,7 @@ enum { NONCE_ID, EIP712_VERBOSE_ID, DEBUG_ID, -#ifdef HAVE_EIP7702 EIP7702_ID, -#endif // HAVE_EIP7702 SETTINGS_SWITCHES_NB }; @@ -88,13 +84,11 @@ static void setting_toggle_callback(int token, uint8_t index, int page) { switches[EIP712_VERBOSE_ID].initState = (nbgl_state_t) value; nvm_write((void *) &N_storage.verbose_eip712, (void *) &value, sizeof(value)); break; -#ifdef HAVE_EIP7702 case EIP7702_TOKEN: value = !N_storage.eip7702_enable; switches[EIP7702_ID].initState = (nbgl_state_t) value; nvm_write((void *) &N_storage.eip7702_enable, (void *) &value, sizeof(value)); break; -#endif // HAVE_EIP7702 case DEBUG_TOKEN: value = !N_storage.contractDetails; switches[DEBUG_ID].initState = (nbgl_state_t) value; @@ -164,7 +158,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u switches[EIP712_VERBOSE_ID].tuneId = TUNE_TAP_CASUAL; #endif -#ifdef HAVE_EIP7702 switches[EIP7702_ID].initState = N_storage.eip7702_enable ? ON_STATE : OFF_STATE; #ifdef SCREEN_SIZE_WALLET switches[EIP7702_ID].text = "Smart account upgrade"; @@ -177,7 +170,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u #ifdef HAVE_PIEZO_SOUND switches[EIP7702_ID].tuneId = TUNE_TAP_CASUAL; #endif -#endif // HAVE_EIP7702 switches[DEBUG_ID].initState = N_storage.contractDetails ? ON_STATE : OFF_STATE; #ifdef SCREEN_SIZE_WALLET diff --git a/src_nbgl/ui_no_7702.c b/src_nbgl/ui_no_7702.c index 9d62f09137..df5b1d1df4 100644 --- a/src_nbgl/ui_no_7702.c +++ b/src_nbgl/ui_no_7702.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702 - #include "nbgl_use_case.h" #include "shared_context.h" #include "ui_callbacks.h" @@ -25,5 +23,3 @@ void ui_error_no_7702(void) { "Reject authorization", ui_error_no_7702_choice); } - -#endif // HAVE_EIP7702 diff --git a/src_nbgl/ui_no_7702_whitelist.c b/src_nbgl/ui_no_7702_whitelist.c index fd3eddd590..228c8300a7 100644 --- a/src_nbgl/ui_no_7702_whitelist.c +++ b/src_nbgl/ui_no_7702_whitelist.c @@ -1,5 +1,3 @@ -#ifdef HAVE_EIP7702_WHITELIST - #include "nbgl_use_case.h" #include "shared_context.h" #include "ui_callbacks.h" @@ -23,5 +21,3 @@ void ui_error_no_7702_whitelist(void) { "", ui_error_no_7702_whitelist_choice); } - -#endif // HAVE_EIP7702_WHITELIST diff --git a/tests/fuzzing/CMakeLists.txt b/tests/fuzzing/CMakeLists.txt index 07604cdd18..dd22163771 100644 --- a/tests/fuzzing/CMakeLists.txt +++ b/tests/fuzzing/CMakeLists.txt @@ -153,8 +153,6 @@ set(DEFINES STANDARD_APP_SYNC_RAPDU HAVE_SWAP HAVE_WEB3_CHECKS - HAVE_EIP7702 - HAVE_EIP7702_WHITELIST explicit_bzero=bzero # Fix for https://github.com/google/sanitizers/issues/1507 ) From af2ccd33cdd156a776151a5af4f7ec1c16e5b62d Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 11:21:10 +0200 Subject: [PATCH 10/13] Remove useless flag 'HAVE_BAGL' --- src_features/signTx/logic_signTx.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c index adb9b0a6ce..3cfb2653cc 100644 --- a/src_features/signTx/logic_signTx.c +++ b/src_features/signTx/logic_signTx.c @@ -589,15 +589,7 @@ uint16_t finalize_parsing(const txContext_t *context) { if (G_called_from_swap && g_use_standard_ui) { io_seproxyhal_touch_tx_ok(); } else { -#ifdef HAVE_BAGL - // If blind-signing detected, start the warning flow beforehand - if (tmpContent.txContent.dataPresent) { - ui_warning_blind_signing(); - } else -#endif - { - start_signature_flow(); - } + start_signature_flow(); } } return APDU_RESPONSE_OK; From 25a1eb7668a80a73e41432c2b97fd22d888cb2f0 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Tue, 13 May 2025 11:56:50 +0200 Subject: [PATCH 11/13] Remove useless flag 'HAVE_NBGL' --- src/handle_swap_sign_transaction.c | 4 +--- src/main.c | 10 +--------- src/network.h | 4 ---- src_features/provide_network_info/cmd_network_info.c | 11 ----------- src_features/provide_network_info/network_info.c | 10 ---------- src_features/provide_network_info/network_info.h | 2 -- src_nbgl/ui_tx_simulation.c | 4 ---- src_plugins/erc1155/erc1155_plugin.c | 4 ---- src_plugins/erc20/erc20_plugin.c | 4 ---- src_plugins/erc721/erc721_plugin.c | 4 ---- 10 files changed, 2 insertions(+), 55 deletions(-) diff --git a/src/handle_swap_sign_transaction.c b/src/handle_swap_sign_transaction.c index e3dff7f7ad..43bf196e22 100644 --- a/src/handle_swap_sign_transaction.c +++ b/src/handle_swap_sign_transaction.c @@ -2,9 +2,7 @@ #include "shared_context.h" #include "network.h" #include "cmd_setPlugin.h" -#ifdef HAVE_NBGL #include "nbgl_use_case.h" -#endif // HAVE_NBGL // Standard or crosschain swap type swap_mode_t G_swap_mode; @@ -159,7 +157,7 @@ void __attribute__((noreturn)) handle_swap_sign_transaction(const chain_config_t #ifdef SCREEN_SIZE_WALLET nbgl_useCaseSpinner("Signing"); -#endif // HAVE_NBGL +#endif // SCREEN_SIZE_WALLET app_main(); diff --git a/src/main.c b/src/main.c index 58fc51f422..c7588af711 100644 --- a/src/main.c +++ b/src/main.c @@ -65,9 +65,7 @@ uint32_t eth2WithdrawalIndex; const internalStorage_t N_storage_real; -#ifdef HAVE_NBGL caller_app_t *caller_app = NULL; -#endif const chain_config_t *chainConfig; void reset_app_context() { @@ -373,7 +371,6 @@ void coin_main(eth_libargs_t *args) { if (args->chain_config != NULL) { chainConfig = args->chain_config; } -#ifdef HAVE_NBGL if ((caller_app = args->caller_app) != NULL) { if (chainConfig != NULL) { caller_app->type = CALLER_TYPE_CLONE; @@ -381,7 +378,6 @@ void coin_main(eth_libargs_t *args) { caller_app->type = CALLER_TYPE_PLUGIN; } } -#endif } if (chainConfig == NULL) { init_coin_config(&config); @@ -466,8 +462,7 @@ __attribute__((noreturn)) void clone_main(eth_libargs_t *args) { } else { // Clone called from Dashboard, start Ethereum libcall_params[2] = RUN_APPLICATION; -// On Stax, forward our icon to Ethereum -#ifdef HAVE_NBGL + // On Stax, forward our icon to Ethereum const char app_name[] = APPNAME; caller_app_t capp; nbgl_icon_details_t icon_details; @@ -479,9 +474,6 @@ __attribute__((noreturn)) void clone_main(eth_libargs_t *args) { capp.name = app_name; capp.icon = &icon_details; libcall_params[4] = (uint32_t) &capp; -#else - libcall_params[4] = 0; -#endif // HAVE_NBGL os_lib_call((uint32_t *) &libcall_params); // Ethereum should not return to us app_exit(); diff --git a/src/network.h b/src/network.h index cef97db95c..efb8002613 100644 --- a/src/network.h +++ b/src/network.h @@ -3,9 +3,7 @@ #include #include #include "chainConfig.h" -#ifdef HAVE_NBGL #include "nbgl_types.h" -#endif #define MAX_NETWORK_LEN 32 // 31 characters + '\0' @@ -13,9 +11,7 @@ typedef struct network_info_s { char name[MAX_NETWORK_LEN]; char ticker[MAX_TICKER_LEN]; uint64_t chain_id; -#ifdef HAVE_NBGL nbgl_icon_details_t icon; -#endif } network_info_t; #define UNSUPPORTED_CHAIN_ID_MSG(id) \ diff --git a/src_features/provide_network_info/cmd_network_info.c b/src_features/provide_network_info/cmd_network_info.c index 0cc65bb5f0..7c4f8bf4bb 100644 --- a/src_features/provide_network_info/cmd_network_info.c +++ b/src_features/provide_network_info/cmd_network_info.c @@ -12,7 +12,6 @@ #define MAX_ICON_LEN 1024 -#ifdef HAVE_NBGL typedef struct { uint16_t received_size; uint16_t expected_size; @@ -21,9 +20,7 @@ typedef struct { static uint8_t g_network_icon_bitmap[MAX_DYNAMIC_NETWORKS][MAX_ICON_LEN] = {0}; // Global structure to temporary store the network icon APDU static network_payload_t g_icon_payload = {0}; -#endif -#ifdef HAVE_NBGL /** * @brief Check the NETWORK_ICON header. * @@ -211,7 +208,6 @@ static uint16_t handle_icon_chunks(uint8_t p1, const uint8_t *data, uint8_t leng } return APDU_RESPONSE_OK; } -#endif /** * @brief Print the registered network. @@ -299,12 +295,7 @@ uint16_t handle_network_info(uint8_t p1, break; case P2_NETWORK_ICON: -#ifdef HAVE_NBGL sw = handle_icon_chunks(p1, data, length); -#else - PRINTF("Warning: Network icon not supported!\n"); - sw = APDU_RESPONSE_OK; -#endif break; case P2_GET_INFO: @@ -321,12 +312,10 @@ uint16_t handle_network_info(uint8_t p1, break; } -#ifdef HAVE_NBGL if ((sw != APDU_RESPONSE_OK) || (g_icon_payload.received_size == g_icon_payload.expected_size)) { explicit_bzero(&g_icon_payload, sizeof(g_icon_payload)); } -#endif return sw; } diff --git a/src_features/provide_network_info/network_info.c b/src_features/provide_network_info/network_info.c index 46c8b0e812..644df4d0bb 100644 --- a/src_features/provide_network_info/network_info.c +++ b/src_features/provide_network_info/network_info.c @@ -25,9 +25,7 @@ enum { // Global variable to store the current slot uint8_t g_current_network_slot = 0; -#ifdef HAVE_NBGL uint8_t g_network_icon_hash[MAX_DYNAMIC_NETWORKS][CX_SHA256_SIZE] = {0}; -#endif // Global structure to store the dynamic network information network_info_t DYNAMIC_NETWORK_INFO[MAX_DYNAMIC_NETWORKS] = {0}; @@ -150,7 +148,6 @@ static bool handle_ticker(const s_tlv_data *data, s_network_info_ctx *context) { return true; } -#ifdef HAVE_NBGL /** * @brief Parse the NETWORK_ICON_HASH value. * @@ -165,7 +162,6 @@ static bool handle_icon_hash(const s_tlv_data *data, s_network_info_ctx *context buf_shrink_expand(data->value, data->length, context->icon_hash, sizeof(context->icon_hash)); return true; } -#endif /** * @brief Parse the SIGNATURE value. @@ -206,11 +202,7 @@ bool handle_network_info_struct(const s_tlv_data *data, s_network_info_ctx *cont ret = handle_ticker(data, context); break; case TAG_NETWORK_ICON_HASH: -#ifdef HAVE_NBGL ret = handle_icon_hash(data, context); -#else - ret = true; -#endif break; case TAG_DER_SIGNATURE: ret = handle_signature(data, context); @@ -269,10 +261,8 @@ bool verify_network_info_struct(const s_network_info_ctx *context) { memcpy(&DYNAMIC_NETWORK_INFO[g_current_network_slot], &context->network, sizeof(network_info_t)); -#ifdef HAVE_NBGL memcpy(g_network_icon_hash[g_current_network_slot], context->icon_hash, sizeof(context->icon_hash)); -#endif return true; } diff --git a/src_features/provide_network_info/network_info.h b/src_features/provide_network_info/network_info.h index 713fc5156f..a962c699bd 100644 --- a/src_features/provide_network_info/network_info.h +++ b/src_features/provide_network_info/network_info.h @@ -17,9 +17,7 @@ typedef struct { cx_sha256_t hash_ctx; } s_network_info_ctx; -#ifdef HAVE_NBGL extern uint8_t g_network_icon_hash[MAX_DYNAMIC_NETWORKS][CX_SHA256_SIZE]; -#endif extern network_info_t DYNAMIC_NETWORK_INFO[MAX_DYNAMIC_NETWORKS]; extern uint8_t g_current_network_slot; diff --git a/src_nbgl/ui_tx_simulation.c b/src_nbgl/ui_tx_simulation.c index 7d3861695c..cfb7d9338c 100644 --- a/src_nbgl/ui_tx_simulation.c +++ b/src_nbgl/ui_tx_simulation.c @@ -1,5 +1,3 @@ -#ifdef HAVE_NBGL - #include "apdu_constants.h" #include "utils.h" #include "nbgl_use_case.h" @@ -208,5 +206,3 @@ const char *ui_tx_simulation_finish_str(void) { } return "Sign"; } - -#endif // HAVE_NBGL diff --git a/src_plugins/erc1155/erc1155_plugin.c b/src_plugins/erc1155/erc1155_plugin.c index 2a703c8b0e..0799f42247 100644 --- a/src_plugins/erc1155/erc1155_plugin.c +++ b/src_plugins/erc1155/erc1155_plugin.c @@ -101,12 +101,8 @@ void handle_query_contract_id_1155(ethQueryContractID_t *msg) { switch (context->selectorIndex) { case SET_APPROVAL_FOR_ALL: -#ifdef HAVE_NBGL strlcpy(msg->version, "manage", msg->versionLength); strlcat(msg->name, " allowance", msg->nameLength); -#else - strlcpy(msg->version, "Allowance", msg->versionLength); -#endif break; case SAFE_TRANSFER: strlcpy(msg->version, "Transfer", msg->versionLength); diff --git a/src_plugins/erc20/erc20_plugin.c b/src_plugins/erc20/erc20_plugin.c index b15268c33e..9aa523b0e9 100644 --- a/src_plugins/erc20/erc20_plugin.c +++ b/src_plugins/erc20/erc20_plugin.c @@ -104,11 +104,7 @@ void erc20_plugin_call(int message, void *parameters) { case ETH_PLUGIN_QUERY_CONTRACT_ID: { ethQueryContractID_t *msg = (ethQueryContractID_t *) parameters; -#ifdef HAVE_NBGL strlcpy(msg->name, "ERC20 token", msg->nameLength); -#else - strlcpy(msg->name, "Type", msg->nameLength); -#endif strlcpy(msg->version, "Approve", msg->versionLength); msg->result = ETH_PLUGIN_RESULT_OK; } break; diff --git a/src_plugins/erc721/erc721_plugin.c b/src_plugins/erc721/erc721_plugin.c index 62f3347ffc..816716023c 100644 --- a/src_plugins/erc721/erc721_plugin.c +++ b/src_plugins/erc721/erc721_plugin.c @@ -109,12 +109,8 @@ void handle_query_contract_id_721(ethQueryContractID_t *msg) { switch (context->selectorIndex) { case SET_APPROVAL_FOR_ALL: case APPROVE: -#ifdef HAVE_NBGL strlcpy(msg->version, "manage", msg->versionLength); strlcat(msg->name, " allowance", msg->nameLength); -#else - strlcpy(msg->version, "Allowance", msg->versionLength); -#endif break; case SAFE_TRANSFER: case SAFE_TRANSFER_DATA: From 7e8d962b914610510cd6dd6e35c8f21a69a3b655 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Wed, 14 May 2025 08:36:37 +0200 Subject: [PATCH 12/13] Remove useless flag 'HAVE_LEDGER_PKI' --- src/ledger_pki.c | 9 +-------- src/main.c | 9 --------- src/public_keys.h | 4 ---- src_features/generic_tx_parser/gtp_tx_info.c | 2 -- .../provideErc20TokenInformation/cmd_provideTokenInfo.c | 4 ---- src_features/provideNFTInformation/cmd_provideNFTInfo.c | 4 ---- src_features/provide_enum_value/enum_value.c | 2 -- src_features/provide_network_info/network_info.c | 2 -- src_features/provide_proxy_info/proxy_info.c | 2 -- src_features/provide_trusted_name/trusted_name.c | 2 -- .../provide_tx_simulation/cmd_get_tx_simulation.c | 4 ---- .../provide_tx_simulation/cmd_get_tx_simulation.h | 2 -- src_features/setExternalPlugin/cmd_setExternalPlugin.c | 4 ---- src_features/setPlugin/cmd_setPlugin.c | 4 ---- src_features/signMessageEIP712/filtering.c | 4 ---- tests/fuzzing/src/mock.c | 4 ---- 16 files changed, 1 insertion(+), 61 deletions(-) diff --git a/src/ledger_pki.c b/src/ledger_pki.c index 48d31cad48..0d36218a1f 100644 --- a/src/ledger_pki.c +++ b/src/ledger_pki.c @@ -21,26 +21,21 @@ int check_signature_with_pubkey(const char *tag, const uint8_t bufLen, const uint8_t *PubKey, const uint8_t keyLen, -#ifdef HAVE_LEDGER_PKI const uint8_t keyUsageExp, -#endif uint8_t *signature, const uint8_t sigLen) { UNUSED(tag); cx_ecfp_public_key_t verif_key = {0}; cx_err_t error = CX_INTERNAL_ERROR; -#ifdef HAVE_LEDGER_PKI uint8_t key_usage = 0; size_t trusted_name_len = 0; uint8_t trusted_name[CERTIFICATE_TRUSTED_NAME_MAXLEN] = {0}; cx_ecfp_384_public_key_t public_key = {0}; -#endif PRINTF( "[%s] " "=======================================================================================\n", tag); -#ifdef HAVE_LEDGER_PKI error = os_pki_get_info(&key_usage, trusted_name, &trusted_name_len, &public_key); if ((error == 0) && (key_usage == keyUsageExp)) { PRINTF("[%s] Certificate '%s' loaded for usage 0x%x (%s)\n", @@ -57,9 +52,7 @@ int check_signature_with_pubkey(const char *tag, goto end; #endif } - } else -#endif - { + } else { PRINTF("[%s] ********** No certificate loaded. Using legacy path **********\n", tag); CX_CHECK(cx_ecfp_init_public_key_no_throw(CX_CURVE_256K1, PubKey, keyLen, &verif_key)); if (!cx_ecdsa_verify_no_throw(&verif_key, buffer, bufLen, signature, sigLen)) { diff --git a/src/main.c b/src/main.c index c7588af711..2ef29b38a9 100644 --- a/src/main.c +++ b/src/main.c @@ -131,15 +131,6 @@ const uint8_t *parseBip32(const uint8_t *dataBuffer, uint8_t *dataLength, bip32_ static uint16_t handleApdu(command_t *cmd, uint32_t *flags, uint32_t *tx) { uint16_t sw = APDU_NO_RESPONSE; -#ifndef HAVE_LEDGER_PKI - if ((cmd->cla == 0xB0) && (cmd->ins == 0x06)) { - // Ledger-PKI APDU not yet caught by the running OS. - // Command code not supported - PRINTF("Ledger-PKI not yet supported!\n"); - return APDU_RESPONSE_CMD_CODE_NOT_SUPPORTED; - } -#endif // HAVE_LEDGER_PKI - if (cmd->cla != CLA) { return APDU_RESPONSE_INVALID_CLA; } diff --git a/src/public_keys.h b/src/public_keys.h index b1c04fd5c0..ff413e09f4 100644 --- a/src/public_keys.h +++ b/src/public_keys.h @@ -18,9 +18,7 @@ #pragma once #include -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = { #if defined(HAVE_CAL_TEST_KEY) @@ -112,8 +110,6 @@ int check_signature_with_pubkey(const char *tag, const uint8_t bufLen, const uint8_t *PubKey, const uint8_t keyLen, -#ifdef HAVE_LEDGER_PKI const uint8_t keyUsageExp, -#endif uint8_t *signature, const uint8_t sigLen); diff --git a/src_features/generic_tx_parser/gtp_tx_info.c b/src_features/generic_tx_parser/gtp_tx_info.c index 0529814181..6793eee474 100644 --- a/src_features/generic_tx_parser/gtp_tx_info.c +++ b/src_features/generic_tx_parser/gtp_tx_info.c @@ -296,9 +296,7 @@ bool verify_tx_info_struct(const s_tx_info_ctx *context) { sizeof(hash), NULL, 0, -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_CALLDATA, -#endif (uint8_t *) context->tx_info->signature, context->tx_info->signature_len) != CX_OK) { return false; diff --git a/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c b/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c index b264a2ac21..d5e31e899a 100644 --- a/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c +++ b/src_features/provideErc20TokenInformation/cmd_provideTokenInfo.c @@ -2,9 +2,7 @@ #include "public_keys.h" #include "network.h" #include "manage_asset_info.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif uint16_t handleProvideErc20TokenInformation(const uint8_t *workBuffer, uint8_t dataLength, @@ -55,9 +53,7 @@ uint16_t handleProvideErc20TokenInformation(const uint8_t *workBuffer, sizeof(hash), LEDGER_SIGNATURE_PUBLIC_KEY, sizeof(LEDGER_SIGNATURE_PUBLIC_KEY), -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_COIN_META, -#endif (uint8_t *) (workBuffer + offset), dataLength); if (error != CX_OK) { diff --git a/src_features/provideNFTInformation/cmd_provideNFTInfo.c b/src_features/provideNFTInformation/cmd_provideNFTInfo.c index 70acf4f8d0..e8a071dd16 100644 --- a/src_features/provideNFTInformation/cmd_provideNFTInfo.c +++ b/src_features/provideNFTInformation/cmd_provideNFTInfo.c @@ -3,9 +3,7 @@ #include "network.h" #include "public_keys.h" #include "manage_asset_info.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif #define TYPE_SIZE 1 #define VERSION_SIZE 1 @@ -161,9 +159,7 @@ uint16_t handleProvideNFTInformation(const uint8_t *workBuffer, sizeof(hash), LEDGER_NFT_METADATA_PUBLIC_KEY, sizeof(LEDGER_NFT_METADATA_PUBLIC_KEY), -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_NFT_METADATA, -#endif (uint8_t *) (workBuffer + offset), signatureLen); #ifndef HAVE_BYPASS_SIGNATURES diff --git a/src_features/provide_enum_value/enum_value.c b/src_features/provide_enum_value/enum_value.c index cc90cb2f43..14cf26b3ae 100644 --- a/src_features/provide_enum_value/enum_value.c +++ b/src_features/provide_enum_value/enum_value.c @@ -152,9 +152,7 @@ bool verify_enum_value_struct(const s_enum_value_ctx *context) { sizeof(hash), NULL, 0, -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_CALLDATA, -#endif (uint8_t *) context->enum_value.signature, context->enum_value.signature_length) != CX_OK) { return false; diff --git a/src_features/provide_network_info/network_info.c b/src_features/provide_network_info/network_info.c index 644df4d0bb..e68511cd7b 100644 --- a/src_features/provide_network_info/network_info.c +++ b/src_features/provide_network_info/network_info.c @@ -238,9 +238,7 @@ bool verify_network_info_struct(const s_network_info_ctx *context) { sizeof(hash), NULL, 0, -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_NETWORK, -#endif (uint8_t *) context->signature, context->signature_length) != CX_OK) { return false; diff --git a/src_features/provide_proxy_info/proxy_info.c b/src_features/provide_proxy_info/proxy_info.c index cd7e32a798..ca495c41ef 100644 --- a/src_features/provide_proxy_info/proxy_info.c +++ b/src_features/provide_proxy_info/proxy_info.c @@ -170,9 +170,7 @@ bool verify_proxy_info_struct(const s_proxy_info_ctx *context) { sizeof(hash), NULL, 0, -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_CALLDATA, -#endif (uint8_t *) context->signature, context->signature_length) != CX_OK) { PRINTF("Error: signature verification failed!\n"); diff --git a/src_features/provide_trusted_name/trusted_name.c b/src_features/provide_trusted_name/trusted_name.c index 7e5043c4fb..26a7f42a9d 100644 --- a/src_features/provide_trusted_name/trusted_name.c +++ b/src_features/provide_trusted_name/trusted_name.c @@ -556,9 +556,7 @@ static bool verify_trusted_name_signature(const s_trusted_name_ctx *context) { sizeof(hash), pk, pk_size, -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_TRUSTED_NAME, -#endif (uint8_t *) (context->input_sig), context->input_sig_size) != CX_OK) { return false; diff --git a/src_features/provide_tx_simulation/cmd_get_tx_simulation.c b/src_features/provide_tx_simulation/cmd_get_tx_simulation.c index 3938f56645..cf6b503880 100644 --- a/src_features/provide_tx_simulation/cmd_get_tx_simulation.c +++ b/src_features/provide_tx_simulation/cmd_get_tx_simulation.c @@ -10,9 +10,7 @@ #include "mem.h" #include "utils.h" #include "nbgl_use_case.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif #include "network.h" #include "ui_callbacks.h" @@ -333,9 +331,7 @@ static bool verify_signature(s_tx_simu_ctx *context) { sizeof(hash), NULL, 0, -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_TX_SIMU_SIGNER, -#endif (uint8_t *) (context->sig), context->sig_size)); diff --git a/src_features/provide_tx_simulation/cmd_get_tx_simulation.h b/src_features/provide_tx_simulation/cmd_get_tx_simulation.h index 2148df97fb..a68a63f266 100644 --- a/src_features/provide_tx_simulation/cmd_get_tx_simulation.h +++ b/src_features/provide_tx_simulation/cmd_get_tx_simulation.h @@ -6,9 +6,7 @@ #include #include "common_utils.h" #include "nbgl_use_case.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif #define HASH_SIZE 32 #define MSG_SIZE 25 diff --git a/src_features/setExternalPlugin/cmd_setExternalPlugin.c b/src_features/setExternalPlugin/cmd_setExternalPlugin.c index 073b3ae265..728d61a906 100644 --- a/src_features/setExternalPlugin/cmd_setExternalPlugin.c +++ b/src_features/setExternalPlugin/cmd_setExternalPlugin.c @@ -3,9 +3,7 @@ #include "eth_plugin_interface.h" #include "eth_plugin_internal.h" #include "plugin_utils.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif uint16_t handleSetExternalPlugin(const uint8_t *workBuffer, uint8_t dataLength) { PRINTF("Handling set Plugin\n"); @@ -37,9 +35,7 @@ uint16_t handleSetExternalPlugin(const uint8_t *workBuffer, uint8_t dataLength) sizeof(hash), LEDGER_SIGNATURE_PUBLIC_KEY, sizeof(LEDGER_SIGNATURE_PUBLIC_KEY), -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_COIN_META, -#endif (uint8_t *) (workBuffer + payload_size), dataLength - payload_size); if (error != CX_OK) { diff --git a/src_features/setPlugin/cmd_setPlugin.c b/src_features/setPlugin/cmd_setPlugin.c index 2933c7955b..7c14e6e6a0 100644 --- a/src_features/setPlugin/cmd_setPlugin.c +++ b/src_features/setPlugin/cmd_setPlugin.c @@ -4,9 +4,7 @@ #include "plugin_utils.h" #include "network.h" #include "public_keys.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif // Supported internal plugins #define ERC721_STR "ERC721" @@ -203,9 +201,7 @@ uint16_t handleSetPlugin(const uint8_t *workBuffer, uint8_t dataLength) { sizeof(hash), LEDGER_NFT_SELECTOR_PUBLIC_KEY, sizeof(LEDGER_NFT_SELECTOR_PUBLIC_KEY), -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_PLUGIN_METADATA, -#endif (uint8_t *) (workBuffer + offset), signatureLen); if (error != CX_OK) { diff --git a/src_features/signMessageEIP712/filtering.c b/src_features/signMessageEIP712/filtering.c index 56d44722ac..4f8d46ae8b 100644 --- a/src_features/signMessageEIP712/filtering.c +++ b/src_features/signMessageEIP712/filtering.c @@ -9,9 +9,7 @@ #include "path.h" #include "ui_logic.h" #include "filtering.h" -#ifdef HAVE_LEDGER_PKI #include "os_pki.h" -#endif #include "trusted_name.h" #include "proxy_info.h" @@ -128,9 +126,7 @@ static bool sig_verif_end(cx_sha256_t *hash_ctx, const uint8_t *sig, uint8_t sig sizeof(hash), LEDGER_SIGNATURE_PUBLIC_KEY, sizeof(LEDGER_SIGNATURE_PUBLIC_KEY), -#ifdef HAVE_LEDGER_PKI CERTIFICATE_PUBLIC_KEY_USAGE_COIN_META, -#endif (uint8_t *) (sig), sig_length)); diff --git a/tests/fuzzing/src/mock.c b/tests/fuzzing/src/mock.c index f67fc05b1b..bb5454c741 100644 --- a/tests/fuzzing/src/mock.c +++ b/tests/fuzzing/src/mock.c @@ -123,18 +123,14 @@ int check_signature_with_pubkey(const char *tag, const uint8_t bufLen, const uint8_t *PubKey, const uint8_t keyLen, -#ifdef HAVE_LEDGER_PKI const uint8_t keyUsageExp, -#endif uint8_t *signature, const uint8_t sigLen) { UNUSED(tag); UNUSED(buffer); UNUSED(bufLen); UNUSED(PubKey); -#ifdef HAVE_LEDGER_PKI UNUSED(keyUsageExp); -#endif UNUSED(keyLen); UNUSED(signature); UNUSED(sigLen); From 75a72e0ed7f45f61b3d0f213be5eea76db40e1d2 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Wed, 14 May 2025 09:27:29 +0200 Subject: [PATCH 13/13] Use rather #pragma once in header files --- src/apdu_constants.h | 5 +---- src/chainConfig.h | 5 +---- src/common_ui.h | 5 +---- src/eth_plugin_handler.h | 5 +---- src/handle_check_address.h | 5 +---- src/handle_get_printable_amount.h | 5 +---- src/hash_bytes.h | 5 +---- src/manage_asset_info.h | 5 +---- src/mem.h | 5 +---- src/mem_utils.h | 5 +---- src/plugins.h | 5 +---- src/shared_context.h | 5 +---- src/signature.h | 5 +---- src/time_format.h | 5 +---- src/tlv.h | 5 +---- src/tlv_apdu.h | 5 +---- src/uint128.h | 5 +---- src/uint256.h | 5 +---- src/uint_common.h | 5 +---- src/utils.h | 5 +---- src_features/generic_tx_parser/calldata.h | 5 +---- src_features/generic_tx_parser/cmd_field.h | 5 +---- src_features/generic_tx_parser/cmd_tx_info.h | 5 +---- src_features/generic_tx_parser/gtp_data_path.h | 5 +---- src_features/generic_tx_parser/gtp_field.h | 5 +---- src_features/generic_tx_parser/gtp_field_table.h | 5 +---- src_features/generic_tx_parser/gtp_param_amount.h | 5 +---- src_features/generic_tx_parser/gtp_param_datetime.h | 5 +---- src_features/generic_tx_parser/gtp_param_duration.h | 5 +---- src_features/generic_tx_parser/gtp_param_enum.h | 5 +---- src_features/generic_tx_parser/gtp_param_nft.h | 5 +---- src_features/generic_tx_parser/gtp_param_raw.h | 5 +---- src_features/generic_tx_parser/gtp_param_token.h | 5 +---- src_features/generic_tx_parser/gtp_param_token_amount.h | 5 +---- src_features/generic_tx_parser/gtp_param_trusted_name.h | 5 +---- src_features/generic_tx_parser/gtp_param_unit.h | 5 +---- src_features/generic_tx_parser/gtp_parsed_value.h | 5 +---- src_features/generic_tx_parser/gtp_path_array.h | 5 +---- src_features/generic_tx_parser/gtp_path_slice.h | 5 +---- src_features/generic_tx_parser/gtp_tx_info.h | 5 +---- src_features/generic_tx_parser/gtp_value.h | 5 +---- src_features/getChallenge/challenge.h | 5 +---- src_features/getEth2PublicKey/feature_getEth2PublicKey.h | 5 +---- src_features/getPublicKey/getPublicKey.h | 5 +---- .../feature_performPrivacyOperation.h | 5 +---- src_features/provide_enum_value/cmd_enum_value.h | 5 +---- src_features/provide_enum_value/enum_value.h | 5 +---- src_features/provide_proxy_info/cmd_proxy_info.h | 5 +---- src_features/provide_proxy_info/proxy_info.h | 5 +---- src_features/provide_trusted_name/cmd_trusted_name.h | 5 +---- src_features/provide_trusted_name/trusted_name.h | 5 +---- src_features/setEth2WithdrawalIndex/withdrawal_index.h | 5 +---- src_features/signMessage/sign_message.h | 5 +---- src_features/signMessageEIP712/commands_712.h | 5 +---- src_features/signMessageEIP712/context_712.h | 5 +---- src_features/signMessageEIP712/encode_field.h | 5 +---- src_features/signMessageEIP712/field_hash.h | 5 +---- src_features/signMessageEIP712/filtering.h | 5 +---- src_features/signMessageEIP712/format_hash_field_type.h | 5 +---- src_features/signMessageEIP712/path.h | 5 +---- src_features/signMessageEIP712/schema_hash.h | 5 +---- src_features/signMessageEIP712/sol_typenames.h | 5 +---- src_features/signMessageEIP712/type_hash.h | 5 +---- src_features/signMessageEIP712/typed_data.h | 5 +---- src_features/signMessageEIP712/ui_logic.h | 5 +---- src_features/signMessageEIP712_common/common_712.h | 5 +---- src_features/signTx/feature_signTx.h | 5 +---- src_nbgl/network_icons.h | 5 +---- src_nbgl/ui_message_signing.h | 5 +---- src_nbgl/ui_nbgl.h | 5 +---- src_plugins/erc1155/erc1155_plugin.h | 5 +---- src_plugins/erc721/erc721_plugin.h | 5 +---- 72 files changed, 72 insertions(+), 288 deletions(-) diff --git a/src/apdu_constants.h b/src/apdu_constants.h index 66826cbf5c..adcadc9186 100644 --- a/src/apdu_constants.h +++ b/src/apdu_constants.h @@ -1,5 +1,4 @@ -#ifndef _APDU_CONSTANTS_H_ -#define _APDU_CONSTANTS_H_ +#pragma once #include "offsets.h" #include "shared_context.h" @@ -116,5 +115,3 @@ uint16_t handleGetEth2PublicKey(uint8_t p1, #endif extern uint16_t apdu_response_code; - -#endif // _APDU_CONSTANTS_H_ diff --git a/src/chainConfig.h b/src/chainConfig.h index b73dd6e90d..984036263a 100644 --- a/src/chainConfig.h +++ b/src/chainConfig.h @@ -15,8 +15,7 @@ * limitations under the License. ********************************************************************************/ -#ifndef _CHAIN_CONFIG_H_ -#define _CHAIN_CONFIG_H_ +#pragma once #include "asset_info.h" @@ -26,5 +25,3 @@ typedef struct chain_config_s { } chain_config_t; #define ETHEREUM_MAINNET_CHAINID 1 - -#endif // _CHAIN_CONFIG_H_ diff --git a/src/common_ui.h b/src/common_ui.h index 5abe86c295..7b7c6cebc4 100644 --- a/src/common_ui.h +++ b/src/common_ui.h @@ -1,5 +1,4 @@ -#ifndef _COMMON_UI_H_ -#define _COMMON_UI_H_ +#pragma once #include #include @@ -36,5 +35,3 @@ void ui_sign_7702_auth(void); void ui_sign_7702_revocation(void); void ui_error_no_7702(void); void ui_error_no_7702_whitelist(void); - -#endif // _COMMON_UI_H_ diff --git a/src/eth_plugin_handler.h b/src/eth_plugin_handler.h index 1acaea018a..4d937e7dc7 100644 --- a/src/eth_plugin_handler.h +++ b/src/eth_plugin_handler.h @@ -1,5 +1,4 @@ -#ifndef _ETH_PLUGIN_HANDLER_H_ -#define _ETH_PLUGIN_HANDLER_H_ +#pragma once #include "eth_plugin_interface.h" @@ -32,5 +31,3 @@ eth_plugin_result_t eth_plugin_perform_init(uint8_t *contractAddress, ethPluginInitContract_t *init); // NULL for cached address, or base contract address eth_plugin_result_t eth_plugin_call(int method, void *parameter); - -#endif // _ETH_PLUGIN_HANDLER_H_ diff --git a/src/handle_check_address.h b/src/handle_check_address.h index ec3dfa9992..f7b07d0515 100644 --- a/src/handle_check_address.h +++ b/src/handle_check_address.h @@ -1,10 +1,7 @@ -#ifndef _HANDLE_CHECK_ADDRESS_H_ -#define _HANDLE_CHECK_ADDRESS_H_ +#pragma once #include "swap_lib_calls.h" #include "chainConfig.h" uint16_t handle_check_address(check_address_parameters_t* check_address_params, chain_config_t* chain_config); - -#endif // _HANDLE_CHECK_ADDRESS_H_ diff --git a/src/handle_get_printable_amount.h b/src/handle_get_printable_amount.h index 706de9f50a..a25cc99f27 100644 --- a/src/handle_get_printable_amount.h +++ b/src/handle_get_printable_amount.h @@ -1,10 +1,7 @@ -#ifndef _HANDLE_GET_PRINTABLE_AMOUNT_H_ -#define _HANDLE_GET_PRINTABLE_AMOUNT_H_ +#pragma once #include "swap_lib_calls.h" #include "chainConfig.h" uint16_t handle_get_printable_amount(get_printable_amount_parameters_t* get_printable_amount_params, chain_config_t* config); - -#endif // _HANDLE_GET_PRINTABLE_AMOUNT_H_ diff --git a/src/hash_bytes.h b/src/hash_bytes.h index 2928fabd5a..95768d2142 100644 --- a/src/hash_bytes.h +++ b/src/hash_bytes.h @@ -1,10 +1,7 @@ -#ifndef HASH_BYTES_H_ -#define HASH_BYTES_H_ +#pragma once #include #include "cx.h" void hash_nbytes(const uint8_t *const bytes_ptr, size_t n, cx_hash_t *hash_ctx); void hash_byte(uint8_t byte, cx_hash_t *hash_ctx); - -#endif // HASH_BYTES_H_ diff --git a/src/manage_asset_info.h b/src/manage_asset_info.h index 4a3465317c..7248692579 100644 --- a/src/manage_asset_info.h +++ b/src/manage_asset_info.h @@ -1,5 +1,4 @@ -#ifndef MANAGE_ASSET_INFO_H_ -#define MANAGE_ASSET_INFO_H_ +#pragma once #include "shared_context.h" @@ -8,5 +7,3 @@ int get_asset_index_by_addr(const uint8_t *addr); extraInfo_t *get_asset_info_by_addr(const uint8_t *contractAddress); extraInfo_t *get_current_asset_info(void); void validate_current_asset_info(void); - -#endif // MANAGE_ASSET_INFO_H_ diff --git a/src/mem.h b/src/mem.h index 1cfcb52d5a..01b424e64e 100644 --- a/src/mem.h +++ b/src/mem.h @@ -1,5 +1,4 @@ -#ifndef MEM_H_ -#define MEM_H_ +#pragma once #include @@ -9,5 +8,3 @@ void *mem_alloc(size_t size); void mem_dealloc(size_t size); void *mem_rev_alloc(size_t size); void mem_rev_dealloc(size_t size); - -#endif // MEM_H_ diff --git a/src/mem_utils.h b/src/mem_utils.h index ead185584d..033cab37d2 100644 --- a/src/mem_utils.h +++ b/src/mem_utils.h @@ -1,5 +1,4 @@ -#ifndef MEM_UTILS_H_ -#define MEM_UTILS_H_ +#pragma once #include @@ -8,5 +7,3 @@ char *mem_alloc_and_format_uint(uint32_t value, uint8_t *const written_chars); uint8_t mem_align(size_t alignment); void *mem_alloc_and_align(size_t size, size_t alignment); - -#endif // MEM_UTILS_H_ diff --git a/src/plugins.h b/src/plugins.h index df406c00b4..946200c987 100644 --- a/src/plugins.h +++ b/src/plugins.h @@ -1,5 +1,4 @@ -#ifndef _PLUGIN_H_ -#define _PLUGIN_H_ +#pragma once void plugin_ui_get_id(); void plugin_ui_get_item(); @@ -7,5 +6,3 @@ void plugin_ui_get_item_internal(uint8_t *title_buffer, size_t title_buffer_size, uint8_t *msg_buffer, size_t msg_buffer_size); - -#endif // _PLUGIN_H_ diff --git a/src/shared_context.h b/src/shared_context.h index a1cdf3b5ec..a96e8e092c 100644 --- a/src/shared_context.h +++ b/src/shared_context.h @@ -1,5 +1,4 @@ -#ifndef _SHARED_CONTEXT_H_ -#define _SHARED_CONTEXT_H_ +#pragma once #include "bip32_utils.h" #include "ethUstream.h" @@ -198,5 +197,3 @@ extern uint32_t eth2WithdrawalIndex; void reset_app_context(void); const uint8_t *parseBip32(const uint8_t *dataBuffer, uint8_t *dataLength, bip32_path_t *bip32); void storage_init(void); - -#endif // _SHARED_CONTEXT_H_ diff --git a/src/signature.h b/src/signature.h index e4cabc6531..5a66aa3139 100644 --- a/src/signature.h +++ b/src/signature.h @@ -1,6 +1,3 @@ -#ifndef SIGNATURE_H_ -#define SIGNATURE_H_ +#pragma once #define ECDSA_SIGNATURE_MAX_LENGTH 73 - -#endif // SIGNATURE_H_ diff --git a/src/time_format.h b/src/time_format.h index b939c179d8..d8e768b82e 100644 --- a/src/time_format.h +++ b/src/time_format.h @@ -1,5 +1,4 @@ -#ifndef TIME_FORMAT_H_ -#define TIME_FORMAT_H_ +#pragma once #include #include @@ -7,5 +6,3 @@ bool time_format_to_yyyymmdd(const time_t *timestamp, char *out, size_t out_size); bool time_format_to_utc(const time_t *timestamp, char *out, size_t out_size); - -#endif // !TIME_FORMAT_H_ diff --git a/src/tlv.h b/src/tlv.h index c41d67c669..da4709768b 100644 --- a/src/tlv.h +++ b/src/tlv.h @@ -1,5 +1,4 @@ -#ifndef TLV_H_ -#define TLV_H_ +#pragma once #include #include @@ -20,5 +19,3 @@ typedef struct { typedef bool (*f_tlv_data_handler)(const s_tlv_data *, void *); bool tlv_parse(const uint8_t *payload, uint16_t size, f_tlv_data_handler handler, void *context); - -#endif // !TLV_H_ diff --git a/src/tlv_apdu.h b/src/tlv_apdu.h index 5c831ef0dd..c933e2b1f2 100644 --- a/src/tlv_apdu.h +++ b/src/tlv_apdu.h @@ -1,5 +1,4 @@ -#ifndef TLV_APDU_H_ -#define TLV_APDU_H_ +#pragma once #include #include @@ -10,5 +9,3 @@ bool tlv_from_apdu(bool first_chunk, uint8_t lc, const uint8_t *payload, f_tlv_payload_handler handler); - -#endif // !TLV_APDU_H_ diff --git a/src/uint128.h b/src/uint128.h index b857089c33..11f0d4c39e 100644 --- a/src/uint128.h +++ b/src/uint128.h @@ -17,8 +17,7 @@ // Adapted from https://github.com/calccrypto/uint256_t -#ifndef _UINT128_H_ -#define _UINT128_H_ +#pragma once #include #include @@ -58,5 +57,3 @@ bool tostring128_signed(const uint128_t *const number, uint32_t out_length); void convertUint64BEto128(const uint8_t *const data, uint32_t length, uint128_t *const target); void convertUint128BE(const uint8_t *const data, uint32_t length, uint128_t *const target); - -#endif // _UINT128_H_ diff --git a/src/uint256.h b/src/uint256.h index 6e2a1c6141..87f9246303 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -17,8 +17,7 @@ // Adapted from https://github.com/calccrypto/uint256_t -#ifndef _UINT256_H_ -#define _UINT256_H_ +#pragma once #include #include @@ -58,5 +57,3 @@ bool tostring256_signed(const uint256_t *const number, char *const out, uint32_t out_length); void convertUint256BE(const uint8_t *const data, uint32_t length, uint256_t *const target); - -#endif // _UINT256_H_ diff --git a/src/uint_common.h b/src/uint_common.h index 36ab3c9f9c..7da6ffdb25 100644 --- a/src/uint_common.h +++ b/src/uint_common.h @@ -15,8 +15,7 @@ * limitations under the License. ********************************************************************************/ -#ifndef _UINT_COMMON_H_ -#define _UINT_COMMON_H_ +#pragma once #include #include @@ -29,5 +28,3 @@ #define LOWER(x) x.elements[1] void reverseString(char *const str, uint32_t length); - -#endif //_UINT_COMMON_H_ diff --git a/src/utils.h b/src/utils.h index a0f48f726b..17f3eb48fb 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,5 +1,4 @@ -#ifndef UTILS_H_ -#define UTILS_H_ +#pragma once #include #include @@ -9,5 +8,3 @@ void buf_shrink_expand(const uint8_t *src, size_t src_size, uint8_t *dst, size_t dst_size); void str_cpy_explicit_trunc(const char *src, size_t src_size, char *dst, size_t dst_size); bool check_name(const uint8_t *name, uint16_t len); - -#endif // !UTILS_H_ diff --git a/src_features/generic_tx_parser/calldata.h b/src_features/generic_tx_parser/calldata.h index 5a71a2b2dc..c694d5a5c0 100644 --- a/src_features/generic_tx_parser/calldata.h +++ b/src_features/generic_tx_parser/calldata.h @@ -1,5 +1,4 @@ -#ifndef CALLDATA_H_ -#define CALLDATA_H_ +#pragma once #include #include @@ -13,5 +12,3 @@ bool calldata_append(const uint8_t *buffer, size_t size); void calldata_cleanup(void); const uint8_t *calldata_get_selector(void); const uint8_t *calldata_get_chunk(int idx); - -#endif // !CALLDATA_H_ diff --git a/src_features/generic_tx_parser/cmd_field.h b/src_features/generic_tx_parser/cmd_field.h index e246b9eb12..45890cc0a1 100644 --- a/src_features/generic_tx_parser/cmd_field.h +++ b/src_features/generic_tx_parser/cmd_field.h @@ -1,8 +1,5 @@ -#ifndef CMD_FIELD_H_ -#define CMD_FIELD_H_ +#pragma once #include uint16_t handle_field(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *payload); - -#endif // !CMD_FIELD_H_ diff --git a/src_features/generic_tx_parser/cmd_tx_info.h b/src_features/generic_tx_parser/cmd_tx_info.h index d8c13442c3..5f207e2aaa 100644 --- a/src_features/generic_tx_parser/cmd_tx_info.h +++ b/src_features/generic_tx_parser/cmd_tx_info.h @@ -1,10 +1,7 @@ -#ifndef CMD_TX_INFO_H_ -#define CMD_TX_INFO_H_ +#pragma once #include #include "gtp_tx_info.h" uint16_t handle_tx_info(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *payload); void gcs_cleanup(void); - -#endif // !CMD_TX_INFO_H_ diff --git a/src_features/generic_tx_parser/gtp_data_path.h b/src_features/generic_tx_parser/gtp_data_path.h index e868ddcd2e..aa54570a60 100644 --- a/src_features/generic_tx_parser/gtp_data_path.h +++ b/src_features/generic_tx_parser/gtp_data_path.h @@ -1,5 +1,4 @@ -#ifndef GTP_DATA_PATH_H_ -#define GTP_DATA_PATH_H_ +#pragma once #include #include @@ -57,5 +56,3 @@ typedef struct { bool handle_data_path_struct(const s_tlv_data *data, s_data_path_context *context); void data_path_cleanup(const s_parsed_value_collection *collection); bool data_path_get(const s_data_path *data_path, s_parsed_value_collection *collection); - -#endif // GTP_DATA_PATH_H_ diff --git a/src_features/generic_tx_parser/gtp_field.h b/src_features/generic_tx_parser/gtp_field.h index 19ff321606..4cabe1b6a7 100644 --- a/src_features/generic_tx_parser/gtp_field.h +++ b/src_features/generic_tx_parser/gtp_field.h @@ -1,5 +1,4 @@ -#ifndef GTP_FIELD_H_ -#define GTP_FIELD_H_ +#pragma once #include #include @@ -55,5 +54,3 @@ typedef struct { bool handle_field_struct(const s_tlv_data *data, s_field_ctx *context); bool verify_field_struct(const s_field_ctx *context); bool format_field(const s_field *field); - -#endif // !GTP_FIELD_H_ diff --git a/src_features/generic_tx_parser/gtp_field_table.h b/src_features/generic_tx_parser/gtp_field_table.h index 3b43890df0..099f202aaa 100644 --- a/src_features/generic_tx_parser/gtp_field_table.h +++ b/src_features/generic_tx_parser/gtp_field_table.h @@ -1,5 +1,4 @@ -#ifndef GTP_FIELD_TABLE_H_ -#define GTP_FIELD_TABLE_H_ +#pragma once #include #include @@ -16,5 +15,3 @@ void field_table_cleanup(void); bool add_to_field_table(e_param_type type, const char *key, const char *value); size_t field_table_size(void); bool get_from_field_table(int index, s_field_table_entry *entry); - -#endif // !GTP_FIELD_TABLE_H_ diff --git a/src_features/generic_tx_parser/gtp_param_amount.h b/src_features/generic_tx_parser/gtp_param_amount.h index e2c9eb81a7..79a4e26998 100644 --- a/src_features/generic_tx_parser/gtp_param_amount.h +++ b/src_features/generic_tx_parser/gtp_param_amount.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_AMOUNT_H_ -#define GTP_PARAM_AMOUNT_H_ +#pragma once #include #include @@ -17,5 +16,3 @@ typedef struct { bool handle_param_amount_struct(const s_tlv_data *data, s_param_amount_context *context); bool format_param_amount(const s_param_amount *param, const char *name); - -#endif // !GTP_PARAM_AMOUNT_H_ diff --git a/src_features/generic_tx_parser/gtp_param_datetime.h b/src_features/generic_tx_parser/gtp_param_datetime.h index 0d3c955c24..d400894874 100644 --- a/src_features/generic_tx_parser/gtp_param_datetime.h +++ b/src_features/generic_tx_parser/gtp_param_datetime.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_DATETIME_H_ -#define GTP_PARAM_DATETIME_H_ +#pragma once #include #include @@ -23,5 +22,3 @@ typedef struct { bool handle_param_datetime_struct(const s_tlv_data *data, s_param_datetime_context *context); bool format_param_datetime(const s_param_datetime *param, const char *name); - -#endif // !GTP_PARAM_DATETIME_H_ diff --git a/src_features/generic_tx_parser/gtp_param_duration.h b/src_features/generic_tx_parser/gtp_param_duration.h index c1fb746326..238410e478 100644 --- a/src_features/generic_tx_parser/gtp_param_duration.h +++ b/src_features/generic_tx_parser/gtp_param_duration.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_DURATION_H_ -#define GTP_PARAM_DURATION_H_ +#pragma once #include #include @@ -17,5 +16,3 @@ typedef struct { bool handle_param_duration_struct(const s_tlv_data *data, s_param_duration_context *context); bool format_param_duration(const s_param_duration *param, const char *name); - -#endif // !GTP_PARAM_DURATION_H_ diff --git a/src_features/generic_tx_parser/gtp_param_enum.h b/src_features/generic_tx_parser/gtp_param_enum.h index 54897b0dba..a1c7b8259b 100644 --- a/src_features/generic_tx_parser/gtp_param_enum.h +++ b/src_features/generic_tx_parser/gtp_param_enum.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_ENUM_H_ -#define GTP_PARAM_ENUM_H_ +#pragma once #include #include @@ -18,5 +17,3 @@ typedef struct { bool handle_param_enum_struct(const s_tlv_data *data, s_param_enum_context *context); bool format_param_enum(const s_param_enum *param, const char *name); - -#endif // !GTP_PARAM_ENUM_H_ diff --git a/src_features/generic_tx_parser/gtp_param_nft.h b/src_features/generic_tx_parser/gtp_param_nft.h index 2c41cb195c..b55120d5ce 100644 --- a/src_features/generic_tx_parser/gtp_param_nft.h +++ b/src_features/generic_tx_parser/gtp_param_nft.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_NFT_H_ -#define GTP_PARAM_NFT_H_ +#pragma once #include #include @@ -18,5 +17,3 @@ typedef struct { bool handle_param_nft_struct(const s_tlv_data *data, s_param_nft_context *context); bool format_param_nft(const s_param_nft *param, const char *name); - -#endif // !GTP_PARAM_NFT_H_ diff --git a/src_features/generic_tx_parser/gtp_param_raw.h b/src_features/generic_tx_parser/gtp_param_raw.h index 9f73c5ade8..f2bedf8d31 100644 --- a/src_features/generic_tx_parser/gtp_param_raw.h +++ b/src_features/generic_tx_parser/gtp_param_raw.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_RAW_H_ -#define GTP_PARAM_RAW_H_ +#pragma once #include #include @@ -17,5 +16,3 @@ typedef struct { bool handle_param_raw_struct(const s_tlv_data *data, s_param_raw_context *context); bool format_param_raw(const s_param_raw *param, const char *name); - -#endif // !GTP_PARAM_RAW_H_ diff --git a/src_features/generic_tx_parser/gtp_param_token.h b/src_features/generic_tx_parser/gtp_param_token.h index a5fa8ff448..8ad8633e9c 100644 --- a/src_features/generic_tx_parser/gtp_param_token.h +++ b/src_features/generic_tx_parser/gtp_param_token.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_TOKEN_ -#define GTP_PARAM_TOKEN_ +#pragma once #include #include @@ -22,5 +21,3 @@ typedef struct { bool handle_param_token_struct(const s_tlv_data *data, s_param_token_context *context); bool format_param_token(const s_param_token *param, const char *name); - -#endif // !GTP_PARAM_TOKEN_ diff --git a/src_features/generic_tx_parser/gtp_param_token_amount.h b/src_features/generic_tx_parser/gtp_param_token_amount.h index fb29a8391e..6758bb83e5 100644 --- a/src_features/generic_tx_parser/gtp_param_token_amount.h +++ b/src_features/generic_tx_parser/gtp_param_token_amount.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_TOKEN_AMOUNT_H_ -#define GTP_PARAM_TOKEN_AMOUNT_H_ +#pragma once #include #include @@ -28,5 +27,3 @@ typedef struct { bool handle_param_token_amount_struct(const s_tlv_data *data, s_param_token_amount_context *context); bool format_param_token_amount(const s_param_token_amount *param, const char *name); - -#endif // !GTP_PARAM_TOKEN_AMOUNT_H_ diff --git a/src_features/generic_tx_parser/gtp_param_trusted_name.h b/src_features/generic_tx_parser/gtp_param_trusted_name.h index 6eec5f4c5b..6dac116326 100644 --- a/src_features/generic_tx_parser/gtp_param_trusted_name.h +++ b/src_features/generic_tx_parser/gtp_param_trusted_name.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_TRUSTED_NAME_H_ -#define GTP_PARAM_TRUSTED_NAME_H_ +#pragma once #include #include @@ -27,5 +26,3 @@ typedef struct { bool handle_param_trusted_name_struct(const s_tlv_data *data, s_param_trusted_name_context *context); bool format_param_trusted_name(const s_param_trusted_name *param, const char *name); - -#endif diff --git a/src_features/generic_tx_parser/gtp_param_unit.h b/src_features/generic_tx_parser/gtp_param_unit.h index 9930ce312d..a4ef5cb3f5 100644 --- a/src_features/generic_tx_parser/gtp_param_unit.h +++ b/src_features/generic_tx_parser/gtp_param_unit.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARAM_UNIT_H_ -#define GTP_PARAM_UNIT_H_ +#pragma once #include #include @@ -19,5 +18,3 @@ typedef struct { bool handle_param_unit_struct(const s_tlv_data *data, s_param_unit_context *context); bool format_param_unit(const s_param_unit *param, const char *name); - -#endif // !GTP_PARAM_UNIT_H_ diff --git a/src_features/generic_tx_parser/gtp_parsed_value.h b/src_features/generic_tx_parser/gtp_parsed_value.h index dd77c930cd..cbc0d1a865 100644 --- a/src_features/generic_tx_parser/gtp_parsed_value.h +++ b/src_features/generic_tx_parser/gtp_parsed_value.h @@ -1,5 +1,4 @@ -#ifndef GTP_PARSED_VALUE_H_ -#define GTP_PARSED_VALUE_H_ +#pragma once #include @@ -16,5 +15,3 @@ typedef struct { uint8_t size; s_parsed_value value[MAX_VALUE_COLLECTION_SIZE]; } s_parsed_value_collection; - -#endif // !GTP_PARSED_VALUE_H_ diff --git a/src_features/generic_tx_parser/gtp_path_array.h b/src_features/generic_tx_parser/gtp_path_array.h index acbfe2af24..0b436a1aed 100644 --- a/src_features/generic_tx_parser/gtp_path_array.h +++ b/src_features/generic_tx_parser/gtp_path_array.h @@ -1,5 +1,4 @@ -#ifndef GTP_PATH_ARRAY_H_ -#define GTP_PATH_ARRAY_H_ +#pragma once #include #include @@ -18,5 +17,3 @@ typedef struct { } s_path_array_context; bool handle_array_struct(const s_tlv_data *data, s_path_array_context *context); - -#endif // !GTP_PATH_ARRAY_H_ diff --git a/src_features/generic_tx_parser/gtp_path_slice.h b/src_features/generic_tx_parser/gtp_path_slice.h index 313c6aade1..d489472964 100644 --- a/src_features/generic_tx_parser/gtp_path_slice.h +++ b/src_features/generic_tx_parser/gtp_path_slice.h @@ -1,5 +1,4 @@ -#ifndef GTP_PATH_SLICE_H_ -#define GTP_PATH_SLICE_H_ +#pragma once #include #include @@ -17,5 +16,3 @@ typedef struct { } s_path_slice_context; bool handle_slice_struct(const s_tlv_data *data, s_path_slice_context *context); - -#endif // !GTP_PATH_SLICE_H_ diff --git a/src_features/generic_tx_parser/gtp_tx_info.h b/src_features/generic_tx_parser/gtp_tx_info.h index 5c4ccd0505..3dc7857e7e 100644 --- a/src_features/generic_tx_parser/gtp_tx_info.h +++ b/src_features/generic_tx_parser/gtp_tx_info.h @@ -1,5 +1,4 @@ -#ifndef GTP_TX_INFO_H_ -#define GTP_TX_INFO_H_ +#pragma once #include #include @@ -46,5 +45,3 @@ const uint8_t *get_contract_addr(void); const char *get_deploy_date(void); cx_hash_t *get_fields_hash_ctx(void); bool validate_instruction_hash(void); - -#endif // !GTP_TX_INFO_H_ diff --git a/src_features/generic_tx_parser/gtp_value.h b/src_features/generic_tx_parser/gtp_value.h index cc817fd09c..ff1c90d190 100644 --- a/src_features/generic_tx_parser/gtp_value.h +++ b/src_features/generic_tx_parser/gtp_value.h @@ -1,5 +1,4 @@ -#ifndef GTP_VALUE_H_ -#define GTP_VALUE_H_ +#pragma once #include #include @@ -54,5 +53,3 @@ typedef struct { bool handle_value_struct(const s_tlv_data *data, s_value_context *context); bool value_get(const s_value *value, s_parsed_value_collection *collection); void value_cleanup(const s_value *value, const s_parsed_value_collection *collection); - -#endif // !GTP_VALUE_H_ diff --git a/src_features/getChallenge/challenge.h b/src_features/getChallenge/challenge.h index e5b600b90c..35ec90dea4 100644 --- a/src_features/getChallenge/challenge.h +++ b/src_features/getChallenge/challenge.h @@ -1,10 +1,7 @@ -#ifndef CHALLENGE_H_ -#define CHALLENGE_H_ +#pragma once #include void roll_challenge(void); uint32_t get_challenge(void); uint16_t handle_get_challenge(unsigned int *tx); - -#endif // CHALLENGE_H_ diff --git a/src_features/getEth2PublicKey/feature_getEth2PublicKey.h b/src_features/getEth2PublicKey/feature_getEth2PublicKey.h index 3d302f4ce9..cdfdb6aaaa 100644 --- a/src_features/getEth2PublicKey/feature_getEth2PublicKey.h +++ b/src_features/getEth2PublicKey/feature_getEth2PublicKey.h @@ -1,8 +1,5 @@ -#ifndef _GET_ETH2_PUB_KEY_H_ -#define _GET_ETH2_PUB_KEY_H_ +#pragma once #include "shared_context.h" uint32_t set_result_get_eth2_publicKey(void); - -#endif // _GET_ETH2_PUB_KEY_H_ diff --git a/src_features/getPublicKey/getPublicKey.h b/src_features/getPublicKey/getPublicKey.h index 7e155c1cd1..0d78316d2e 100644 --- a/src_features/getPublicKey/getPublicKey.h +++ b/src_features/getPublicKey/getPublicKey.h @@ -1,5 +1,4 @@ -#ifndef _GET_PUB_KEY_H_ -#define _GET_PUB_KEY_H_ +#pragma once #include "shared_context.h" @@ -10,5 +9,3 @@ uint16_t get_public_key_string(bip32_path_t *bip32, uint8_t *chainCode, uint64_t chainId); uint32_t set_result_get_publicKey(void); - -#endif // _GET_PUB_KEY_H_ diff --git a/src_features/performPrivacyOperation/feature_performPrivacyOperation.h b/src_features/performPrivacyOperation/feature_performPrivacyOperation.h index 1e519d386d..cef2f877fe 100644 --- a/src_features/performPrivacyOperation/feature_performPrivacyOperation.h +++ b/src_features/performPrivacyOperation/feature_performPrivacyOperation.h @@ -1,8 +1,5 @@ -#ifndef _PERFORM_PRIVACY_OPERATION_H_ -#define _PERFORM_PRIVACY_OPERATION_H_ +#pragma once #include "shared_context.h" uint32_t set_result_perform_privacy_operation(void); - -#endif // _PERFORM_PRIVACY_OPERATION_H_ diff --git a/src_features/provide_enum_value/cmd_enum_value.h b/src_features/provide_enum_value/cmd_enum_value.h index ea28eb98fd..6eb7d11aed 100644 --- a/src_features/provide_enum_value/cmd_enum_value.h +++ b/src_features/provide_enum_value/cmd_enum_value.h @@ -1,8 +1,5 @@ -#ifndef CMD_ENUM_VALUE_H_ -#define CMD_ENUM_VALUE_H_ +#pragma once #include uint16_t handle_enum_value(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *payload); - -#endif // !CMD_ENUM_VALUE_H_ diff --git a/src_features/provide_enum_value/enum_value.h b/src_features/provide_enum_value/enum_value.h index 529469de72..194a673cbb 100644 --- a/src_features/provide_enum_value/enum_value.h +++ b/src_features/provide_enum_value/enum_value.h @@ -1,5 +1,4 @@ -#ifndef ENUM_VALUE_H_ -#define ENUM_VALUE_H_ +#pragma once #include #include "common_utils.h" // ADDRESS_LENGTH @@ -36,5 +35,3 @@ const char *get_matching_enum_name(const uint64_t *chain_id, const uint8_t *selector, uint8_t id, uint8_t value); - -#endif // !ENUM_VALUE_H_ diff --git a/src_features/provide_proxy_info/cmd_proxy_info.h b/src_features/provide_proxy_info/cmd_proxy_info.h index 7f49cace44..c39c443765 100644 --- a/src_features/provide_proxy_info/cmd_proxy_info.h +++ b/src_features/provide_proxy_info/cmd_proxy_info.h @@ -1,9 +1,6 @@ -#ifndef CMD_PROXY_INFO_H_ -#define CMD_PROXY_INFO_H_ +#pragma once #include #include uint16_t handle_proxy_info(uint8_t p1, uint8_t p2, uint8_t lc, const uint8_t *payload); - -#endif // CMD_PROXY_INFO_H_ diff --git a/src_features/provide_proxy_info/proxy_info.h b/src_features/provide_proxy_info/proxy_info.h index a567772294..708dd502b5 100644 --- a/src_features/provide_proxy_info/proxy_info.h +++ b/src_features/provide_proxy_info/proxy_info.h @@ -1,5 +1,4 @@ -#ifndef PROXY_INFO_H_ -#define PROXY_INFO_H_ +#pragma once #include #include @@ -34,5 +33,3 @@ const uint8_t *get_proxy_contract(const uint64_t *chain_id, const uint8_t *get_implem_contract(const uint64_t *chain_id, const uint8_t *addr, const uint8_t *selector); - -#endif // PROXY_INFO_H_ diff --git a/src_features/provide_trusted_name/cmd_trusted_name.h b/src_features/provide_trusted_name/cmd_trusted_name.h index de074280f8..815a7f3185 100644 --- a/src_features/provide_trusted_name/cmd_trusted_name.h +++ b/src_features/provide_trusted_name/cmd_trusted_name.h @@ -1,8 +1,5 @@ -#ifndef CMD_TRUSTED_NAME_H_ -#define CMD_TRUSTED_NAME_H_ +#pragma once #include uint16_t handle_trusted_name(uint8_t p1, const uint8_t *data, uint8_t length); - -#endif // !CMD_TRUSTED_NAME_H_ diff --git a/src_features/provide_trusted_name/trusted_name.h b/src_features/provide_trusted_name/trusted_name.h index 086db30fcd..8bb84f453f 100644 --- a/src_features/provide_trusted_name/trusted_name.h +++ b/src_features/provide_trusted_name/trusted_name.h @@ -1,5 +1,4 @@ -#ifndef TRUSTED_NAME_H_ -#define TRUSTED_NAME_H_ +#pragma once #include #include @@ -66,5 +65,3 @@ extern char g_trusted_name[TRUSTED_NAME_MAX_LENGTH + 1]; bool handle_trusted_name_struct(const s_tlv_data *data, s_trusted_name_ctx *context); bool verify_trusted_name_struct(const s_trusted_name_ctx *ctx); - -#endif // !TRUSTED_NAME_H_ diff --git a/src_features/setEth2WithdrawalIndex/withdrawal_index.h b/src_features/setEth2WithdrawalIndex/withdrawal_index.h index ab8c9e554b..440a156b1c 100644 --- a/src_features/setEth2WithdrawalIndex/withdrawal_index.h +++ b/src_features/setEth2WithdrawalIndex/withdrawal_index.h @@ -1,5 +1,4 @@ -#ifndef _SET_WITHDRAWAL_INDEX_H_ -#define _SET_WITHDRAWAL_INDEX_H_ +#pragma once #include "stdint.h" @@ -7,5 +6,3 @@ uint16_t handleSetEth2WithdrawalIndex(uint8_t p1, uint8_t p2, uint8_t *dataBuffer, uint16_t dataLength); - -#endif // _SET_WITHDRAWAL_INDEX_H_ diff --git a/src_features/signMessage/sign_message.h b/src_features/signMessage/sign_message.h index 6d35e49796..a79da36012 100644 --- a/src_features/signMessage/sign_message.h +++ b/src_features/signMessage/sign_message.h @@ -1,5 +1,4 @@ -#ifndef SIGN_MESSAGE_H_ -#define SIGN_MESSAGE_H_ +#pragma once #define UI_191_BUFFER strings.tmp.tmp @@ -8,5 +7,3 @@ typedef enum { STATE_191_HASH_DISPLAY = 0, STATE_191_HASH_ONLY } sign_message_st void question_switcher(void); void skip_rest_of_message(void); void continue_displaying_message(void); - -#endif // SIGN_MESSAGE_H_ diff --git a/src_features/signMessageEIP712/commands_712.h b/src_features/signMessageEIP712/commands_712.h index 05ddea7e15..b20b45168a 100644 --- a/src_features/signMessageEIP712/commands_712.h +++ b/src_features/signMessageEIP712/commands_712.h @@ -1,5 +1,4 @@ -#ifndef EIP712_H_ -#define EIP712_H_ +#pragma once #include #include @@ -19,5 +18,3 @@ uint16_t handle_eip712_filtering(uint8_t p1, uint8_t length, uint32_t *flags); void handle_eip712_return_code(bool success); - -#endif // EIP712_H_ diff --git a/src_features/signMessageEIP712/context_712.h b/src_features/signMessageEIP712/context_712.h index 934a4f6372..fb7723c694 100644 --- a/src_features/signMessageEIP712/context_712.h +++ b/src_features/signMessageEIP712/context_712.h @@ -1,5 +1,4 @@ -#ifndef EIP712_CTX_H_ -#define EIP712_CTX_H_ +#pragma once #include #include "common_utils.h" @@ -18,5 +17,3 @@ void eip712_context_deinit(void); typedef enum { NOT_INITIALIZED, INITIALIZED, DEFINED } e_struct_init; extern e_struct_init struct_state; - -#endif // EIP712_CTX_H_ diff --git a/src_features/signMessageEIP712/encode_field.h b/src_features/signMessageEIP712/encode_field.h index ece6feb6cc..648157c788 100644 --- a/src_features/signMessageEIP712/encode_field.h +++ b/src_features/signMessageEIP712/encode_field.h @@ -1,5 +1,4 @@ -#ifndef ENCODE_FIELD_H_ -#define ENCODE_FIELD_H_ +#pragma once #include #include @@ -11,5 +10,3 @@ void *encode_int(const uint8_t *const value, uint8_t length, uint8_t typesize); void *encode_boolean(const bool *const value, uint8_t length); void *encode_address(const uint8_t *const value, uint8_t length); void *encode_bytes(const uint8_t *const value, uint8_t length); - -#endif // ENCODE_FIELD_H_ diff --git a/src_features/signMessageEIP712/field_hash.h b/src_features/signMessageEIP712/field_hash.h index 701f1398fa..0fbe533d1f 100644 --- a/src_features/signMessageEIP712/field_hash.h +++ b/src_features/signMessageEIP712/field_hash.h @@ -1,5 +1,4 @@ -#ifndef FIELD_HASH_H_ -#define FIELD_HASH_H_ +#pragma once #include #include @@ -16,5 +15,3 @@ typedef struct { bool field_hash_init(void); void field_hash_deinit(void); bool field_hash(const uint8_t *data, uint8_t data_length, bool partial); - -#endif // FIELD_HASH_H_ diff --git a/src_features/signMessageEIP712/filtering.h b/src_features/signMessageEIP712/filtering.h index 805186cfe2..818390c5f3 100644 --- a/src_features/signMessageEIP712/filtering.h +++ b/src_features/signMessageEIP712/filtering.h @@ -1,5 +1,4 @@ -#ifndef FILTERING_H_ -#define FILTERING_H_ +#pragma once #include #include @@ -28,5 +27,3 @@ bool filtering_raw_field(const uint8_t *payload, bool discarded, uint32_t *path_crc); bool filtering_discarded_path(const uint8_t *payload, uint8_t length); - -#endif // FILTERING_H_ diff --git a/src_features/signMessageEIP712/format_hash_field_type.h b/src_features/signMessageEIP712/format_hash_field_type.h index f2f7fd1270..d4b12b5124 100644 --- a/src_features/signMessageEIP712/format_hash_field_type.h +++ b/src_features/signMessageEIP712/format_hash_field_type.h @@ -1,8 +1,5 @@ -#ifndef FORMAT_HASH_FIELD_TYPE_H_ -#define FORMAT_HASH_FIELD_TYPE_H_ +#pragma once #include "cx.h" bool format_hash_field_type(const void *const field_ptr, cx_hash_t *hash_ctx); - -#endif // FORMAT_HASH_FIELD_TYPE_H_ diff --git a/src_features/signMessageEIP712/path.h b/src_features/signMessageEIP712/path.h index f949eb9fca..f675b62838 100644 --- a/src_features/signMessageEIP712/path.h +++ b/src_features/signMessageEIP712/path.h @@ -1,5 +1,4 @@ -#ifndef PATH_H_ -#define PATH_H_ +#pragma once #include #include @@ -38,5 +37,3 @@ bool path_exists_in_backup(const char *path, size_t length); const void *path_get_nth_field_to_last(uint8_t n); uint8_t path_get_depth_count(void); uint8_t path_backup_get_depth_count(void); - -#endif // PATH_H_ diff --git a/src_features/signMessageEIP712/schema_hash.h b/src_features/signMessageEIP712/schema_hash.h index 69ed1967cd..df97967dd6 100644 --- a/src_features/signMessageEIP712/schema_hash.h +++ b/src_features/signMessageEIP712/schema_hash.h @@ -1,8 +1,5 @@ -#ifndef SCHEMA_HASH_H_ -#define SCHEMA_HASH_H_ +#pragma once #include bool compute_schema_hash(void); - -#endif // SCHEMA_HASH_H_ diff --git a/src_features/signMessageEIP712/sol_typenames.h b/src_features/signMessageEIP712/sol_typenames.h index 12832717dd..77d325154f 100644 --- a/src_features/signMessageEIP712/sol_typenames.h +++ b/src_features/signMessageEIP712/sol_typenames.h @@ -1,5 +1,4 @@ -#ifndef SOL_TYPENAMES_H_ -#define SOL_TYPENAMES_H_ +#pragma once #include #include @@ -7,5 +6,3 @@ bool sol_typenames_init(void); const char *get_struct_field_sol_typename(const uint8_t *ptr, uint8_t *const length); - -#endif // SOL_TYPENAMES_H_ diff --git a/src_features/signMessageEIP712/type_hash.h b/src_features/signMessageEIP712/type_hash.h index bff0eec169..d75691c481 100644 --- a/src_features/signMessageEIP712/type_hash.h +++ b/src_features/signMessageEIP712/type_hash.h @@ -1,9 +1,6 @@ -#ifndef TYPE_HASH_H_ -#define TYPE_HASH_H_ + #include #include bool type_hash(const char *const struct_name, const uint8_t struct_name_length, uint8_t *hash_buf); - -#endif // TYPE_HASH_H_ diff --git a/src_features/signMessageEIP712/typed_data.h b/src_features/signMessageEIP712/typed_data.h index d2f53ede91..9feebd47c6 100644 --- a/src_features/signMessageEIP712/typed_data.h +++ b/src_features/signMessageEIP712/typed_data.h @@ -1,5 +1,4 @@ -#ifndef TYPED_DATA_H_ -#define TYPED_DATA_H_ +#pragma once #include #include @@ -57,5 +56,3 @@ bool set_struct_name(uint8_t length, const uint8_t *const name); bool set_struct_field(uint8_t length, const uint8_t *const data); bool typed_data_init(void); void typed_data_deinit(void); - -#endif // TYPED_DATA_H_ diff --git a/src_features/signMessageEIP712/ui_logic.h b/src_features/signMessageEIP712/ui_logic.h index 129160c73f..6a87a1af50 100644 --- a/src_features/signMessageEIP712/ui_logic.h +++ b/src_features/signMessageEIP712/ui_logic.h @@ -1,5 +1,4 @@ -#ifndef UI_LOGIC_712_H_ -#define UI_LOGIC_712_H_ +#pragma once #include #include "ux.h" @@ -54,5 +53,3 @@ void ui_712_set_trusted_name_requirements(uint8_t type_count, uint8_t source_count, const e_name_source *sources); char *get_ui_pairs_buffer(size_t *size); - -#endif // UI_LOGIC_712_H_ diff --git a/src_features/signMessageEIP712_common/common_712.h b/src_features/signMessageEIP712_common/common_712.h index 1283a6191b..007cafba28 100644 --- a/src_features/signMessageEIP712_common/common_712.h +++ b/src_features/signMessageEIP712_common/common_712.h @@ -1,10 +1,7 @@ -#ifndef COMMON_EIP712_H_ -#define COMMON_EIP712_H_ +#pragma once #include #include "ux.h" unsigned int ui_712_approve_cb(); unsigned int ui_712_reject_cb(); - -#endif // COMMON_EIP712_H_ diff --git a/src_features/signTx/feature_signTx.h b/src_features/signTx/feature_signTx.h index ab4cf61755..589b5cd054 100644 --- a/src_features/signTx/feature_signTx.h +++ b/src_features/signTx/feature_signTx.h @@ -1,5 +1,4 @@ -#ifndef _SIGN_TX_H_ -#define _SIGN_TX_H_ +#pragma once #include #include @@ -30,5 +29,3 @@ bool max_transaction_fee_to_string(const txInt256_t *BEGasPrice, const txInt256_t *BEGasLimit, char *displayBuffer, uint32_t displayBufferSize); - -#endif // _SIGN_TX_H_ diff --git a/src_nbgl/network_icons.h b/src_nbgl/network_icons.h index 7eec96ddf2..b04a9c3d56 100644 --- a/src_nbgl/network_icons.h +++ b/src_nbgl/network_icons.h @@ -1,6 +1,3 @@ -#ifndef NETWORK_ICONS_H_ -#define NETWORK_ICONS_H_ +#pragma once const nbgl_icon_details_t *get_network_icon_from_chain_id(const uint64_t *chain_id); - -#endif // NETWORK_ICONS_H_ diff --git a/src_nbgl/ui_message_signing.h b/src_nbgl/ui_message_signing.h index cd35c8fa77..f8ea08feb2 100644 --- a/src_nbgl/ui_message_signing.h +++ b/src_nbgl/ui_message_signing.h @@ -1,9 +1,6 @@ -#ifndef UI_MESSAGE_SIGNING_H_ -#define UI_MESSAGE_SIGNING_H_ +#pragma once #include void ui_typed_message_review_choice_v0(bool confirm); void ui_typed_message_review_choice(bool confirm); - -#endif // UI_MESSAGE_SIGNING_H_ diff --git a/src_nbgl/ui_nbgl.h b/src_nbgl/ui_nbgl.h index 271f7591a3..0ae9fb5321 100644 --- a/src_nbgl/ui_nbgl.h +++ b/src_nbgl/ui_nbgl.h @@ -1,5 +1,4 @@ -#ifndef _UI_NBGL_H_ -#define _UI_NBGL_H_ +#pragma once #include "nbgl_use_case.h" #include "shared_context.h" @@ -24,5 +23,3 @@ extern nbgl_warning_t warning; void ui_idle(void); void ui_settings(void); - -#endif // _UI_NBGL_H_ diff --git a/src_plugins/erc1155/erc1155_plugin.h b/src_plugins/erc1155/erc1155_plugin.h index 06f491a964..fe2a396231 100644 --- a/src_plugins/erc1155/erc1155_plugin.h +++ b/src_plugins/erc1155/erc1155_plugin.h @@ -1,5 +1,4 @@ -#ifndef _ERC1155_PLUGIN_H_ -#define _ERC1155_PLUGIN_H_ +#pragma once #include #include @@ -48,5 +47,3 @@ typedef struct erc1155_context_t { void handle_provide_parameter_1155(ethPluginProvideParameter_t *parameters); void handle_query_contract_ui_1155(ethQueryContractUI_t *parameters); - -#endif // _ERC1155_PLUGIN_H_ diff --git a/src_plugins/erc721/erc721_plugin.h b/src_plugins/erc721/erc721_plugin.h index bb332a14ff..b3de147317 100644 --- a/src_plugins/erc721/erc721_plugin.h +++ b/src_plugins/erc721/erc721_plugin.h @@ -1,5 +1,4 @@ -#ifndef _ERC721_PLUGIN_H_ -#define _ERC721_PLUGIN_H_ +#pragma once #include #include @@ -39,5 +38,3 @@ typedef struct erc721_context_t { void handle_provide_parameter_721(ethPluginProvideParameter_t *parameters); void handle_query_contract_ui_721(ethQueryContractUI_t *parameters); - -#endif // _ERC721_PLUGIN_H_