Skip to content

Commit 8e3f81b

Browse files
Fixed message hash being displayed twice when blind signing a 712 message with the hash display setting turned on
1 parent e6f31c3 commit 8e3f81b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/features/signMessageEIP712/ui_logic.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,17 @@ bool ui_712_review_struct(const s_struct_712 *struct_ptr) {
298298
bool ui_712_message_hash(void) {
299299
const char *title = "Message hash";
300300

301-
ui_712_set_title(title, strlen(title));
302-
array_bytes_string(strings.tmp.tmp,
303-
sizeof(strings.tmp.tmp),
304-
tmpCtx.messageSigningContext712.messageHash,
305-
KECCAK256_HASH_BYTESIZE);
306-
ui_712_set_value(NULL, 0);
301+
// to prevent showing
302+
// Message hash > Domain hash > Message hash
303+
// as the last three fields
304+
if (!N_storage.displayHash) {
305+
ui_712_set_title(title, strlen(title));
306+
array_bytes_string(strings.tmp.tmp,
307+
sizeof(strings.tmp.tmp),
308+
tmpCtx.messageSigningContext712.messageHash,
309+
KECCAK256_HASH_BYTESIZE);
310+
ui_712_set_value(NULL, 0);
311+
}
307312
ui_ctx->end_reached = true;
308313
return ui_712_redraw_generic_step();
309314
}

0 commit comments

Comments
 (0)