Skip to content

Commit 45f6fb5

Browse files
authored
Bindsign consent request (#283)
* add --break-system-packages flag to pip install * BlindSign Flow for Consent Requests * Upgrade deps * Add testing * Snapshots * bump version
1 parent 525deb4 commit 45f6fb5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+79
-25
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ jobs:
199199
with:
200200
submodules: true
201201
- name: Install deps
202-
run: pip install ledgerblue
202+
run: pip install ledgerblue --break-system-packages
203203

204204
- name: Build NanoS
205205
shell: bash -l {0}
@@ -235,7 +235,7 @@ jobs:
235235
with:
236236
submodules: true
237237
- name: Install deps
238-
run: pip install ledgerblue
238+
run: pip install ledgerblue --break-system-packages
239239

240240
- name: Build NanoSP
241241
shell: bash -l {0}
@@ -271,7 +271,7 @@ jobs:
271271
with:
272272
submodules: true
273273
- name: Install deps
274-
run: pip install ledgerblue
274+
run: pip install ledgerblue --break-system-packages
275275

276276
- name: Build Stax
277277
shell: bash -l {0}
@@ -307,7 +307,7 @@ jobs:
307307
with:
308308
submodules: true
309309
- name: Install deps
310-
run: pip install ledgerblue
310+
run: pip install ledgerblue --break-system-packages
311311

312312
- name: Build Flex
313313
shell: bash -l {0}

app/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ else
114114
endif
115115
# Add the PRODUCTION_BUILD definition to the compiler flags
116116
DEFINES += PRODUCTION_BUILD=$(PRODUCTION_BUILD)
117+
DEFINES += APP_BLINDSIGN_MODE_ENABLED
117118

118119
########################################
119120

app/Makefile.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ APPVERSION_M=4
33
# This is the minor version of this release
44
APPVERSION_N=0
55
# This is the patch version of this release
6-
APPVERSION_P=0
6+
APPVERSION_P=1

app/src/apdu_handler.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ void handleApdu(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx) {
134134
check_app_canary();
135135
zemu_log("HandleAPDU******\n");
136136

137+
// Reset Blindsign state on every APDU
138+
app_mode_skip_blindsign_ui();
139+
137140
BEGIN_TRY {
138141
TRY {
139142
if (G_io_apdu_buffer[OFFSET_CLA] != CLA) {

app/src/handlers/handle_bls.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ __Z_INLINE void handleSignBls(volatile uint32_t *flags, volatile uint32_t *tx, u
8383
THROW(APDU_CODE_OK);
8484
}
8585

86+
if (!app_mode_blindsign()) {
87+
*flags |= IO_ASYNCH_REPLY;
88+
view_blindsign_error_show();
89+
THROW(APDU_CODE_DATA_INVALID);
90+
}
91+
8692
// Parser Certificate and verify
8793
CHECK_APP_CANARY()
8894
zxerr_t err = tx_certVerify();

tests_zemu/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@
2525
"upgrade": "bunx npm-check-updates -i"
2626
},
2727
"dependencies": {
28-
"@ledgerhq/hw-transport-node-hid": "^6.29.5",
29-
"@ledgerhq/logs": "^6.12.0",
28+
"@ledgerhq/hw-transport-node-hid": "^6.29.7",
29+
"@ledgerhq/logs": "^6.13.0",
3030
"@zondax/ledger-icp": "^3.2.8",
31-
"@zondax/zemu": "^0.55.3"
31+
"@zondax/zemu": "^0.55.3",
32+
"@ledgerhq/hw-transport": "^6.30.6"
3233
},
3334
"devDependencies": {
3435
"@matteoh2o1999/github-actions-jest-reporter": "^3.0.0",
3536
"@types/jest": "^29.5.14",
36-
"@types/ledgerhq__hw-transport": "^4.21.8",
3737
"@types/secp256k1": "^4.0.6",
38-
"@typescript-eslint/eslint-plugin": "^8.31.0",
39-
"@typescript-eslint/parser": "^8.31.0",
38+
"@typescript-eslint/eslint-plugin": "^8.34.0",
39+
"@typescript-eslint/parser": "^8.34.0",
4040
"crypto-js": "4.2.0",
41-
"eslint": "^9.25.1",
41+
"eslint": "^9.28.0",
4242
"eslint-config-prettier": "^10.1.2",
4343
"eslint-plugin-import": "^2.31.0",
44-
"eslint-plugin-jest": "^28.11.0",
44+
"eslint-plugin-jest": "^28.13.3",
4545
"eslint-plugin-prettier": "^5.2.6",
4646
"eslint-plugin-promise": "^7.2.1",
4747
"eslint-plugin-tsdoc": "^0.4.0",
4848
"eslint-plugin-unused-imports": "^4.1.4",
49-
"jest": "29.7.0",
50-
"js-sha256": "0.11.0",
49+
"jest": "30.0.0",
50+
"js-sha256": "0.11.1",
5151
"prettier": "^3.5.3",
5252
"secp256k1": "^5.0.1",
5353
"sort-package-json": "^3.0.0",
7.87 KB
-3.23 KB
3.93 KB
-1.09 KB

0 commit comments

Comments
 (0)