Commit Graph

239 Commits

Author SHA1 Message Date
Alexandre Paillier
cfb45a795b Better EIP712 field implementation error handling, including hidden ones 2022-08-05 18:15:55 +02:00
Alexandre Paillier
58d1b40c79 UI 712 logic refactoring 2022-08-05 18:15:55 +02:00
Alexandre Paillier
bce0a3114d WIP path refactoring 2022-08-05 18:15:54 +02:00
Alexandre Paillier
832bbbf24c Cleaned up the EIP712 field hash code 2022-08-05 18:15:54 +02:00
Alexandre Paillier
04d78eaaa9 Refactored/Split up EIP712 set struct field function 2022-08-05 18:15:54 +02:00
Alexandre Paillier
3ed8b3b0ef Removed mentions about un-needed multi-APDU EIP712 SEND STRUCT DEFINITION 2022-08-05 18:15:53 +02:00
Alexandre Paillier
b35fc03a64 Small simplification/refactoring of EIP712 solidity typenames matching 2022-08-05 18:15:53 +02:00
Alexandre Paillier
f0764545ae Small simplification/refactoring of EIP712 typed data 2022-08-05 18:15:52 +02:00
Alexandre Paillier
aeb8072cf0 Removed solidity typenames from EIP712 context structure 2022-08-05 18:15:52 +02:00
Alexandre Paillier
d1d1aa73e6 Made all EIP712 code use the same function for response APDUs 2022-08-05 18:15:52 +02:00
Alexandre Paillier
47c1f73736 Removed unused EIP712 get_struct function 2022-08-05 18:15:51 +02:00
Alexandre Paillier
a375e5b07d Moved the memory allocator and its util functions out of the EIP712 subdirectory and gave it its own compilation flag
Also removed dead code
2022-08-05 18:15:51 +02:00
Alexandre Paillier
7dad477413 Moved EIP 712 commands handling into their own file & renamed some things 2022-08-05 18:15:50 +02:00
Alexandre Paillier
399b865e5c Moved EIP712 filtering related code into its own file 2022-08-05 18:15:50 +02:00
Alexandre Paillier
cd77ca5152 Small refactoring on EIP712 set_struct_name function 2022-08-05 18:15:50 +02:00
Alexandre Paillier
b782a69137 Moved all typed data in RAM related code into its own file 2022-08-05 18:15:49 +02:00
Alexandre Paillier
0100eed1fd EIP712 code now uses the global apdu response code; error handling improvements 2022-08-05 18:15:49 +02:00
Alexandre Paillier
01179730a1 Updated the EIP-712 filtering signature specs; Update the verification implementation to now handle field path intead of only the field key name 2022-08-05 18:15:48 +02:00
Alexandre Paillier
4574c223f2 Clean up mem allocation alignment macro usage + small refactoring of the typehash dependencies search 2022-08-05 18:15:48 +02:00
Alexandre Paillier
339d24445e Merge the duplicated EIP-712 filtering function 2022-08-05 18:15:47 +02:00
Alexandre Paillier
ee660317aa EIP712 signatures now computed on schema hash 2022-08-05 18:15:47 +02:00
Alexandre Paillier
188a75ffff App now computes EIP-712 schema identifier 2022-08-05 18:15:47 +02:00
Alexandre Paillier
5450f0c46f Refactored some type EIP712 formatting and hashing code to re-use it 2022-08-05 18:15:46 +02:00
Alexandre Paillier
47e47dd818 EIP712 signatures now computed on chain ID 2022-08-05 18:15:45 +02:00
Alexandre Paillier
559e729188 Better UI for verbose EIP-712, now shows the review struct screen even on inner structures 2022-08-05 18:15:45 +02:00
Alexandre Paillier
032d74e301 Now checks the EIP712Domain chain ID 2022-08-05 18:15:45 +02:00
Alexandre Paillier
1a4149e836 EIP-712 hidden fields now share the shown fields logic 2022-08-05 18:15:44 +02:00
Alexandre Paillier
d8321d422d Renamed EIP-712 UI function 2022-08-05 18:15:44 +02:00
Alexandre Paillier
ca37612f61 Fix io_exchange exception
Was trying to reply to EIP712 ARRAY size APDU twice
2022-08-05 18:15:43 +02:00
Alexandre Paillier
447e7b9277 Verbose EIP-712 setting now ignores filtering APDUs 2022-08-05 18:15:43 +02:00
Alexandre Paillier
b1f2e933c0 Added an EIP712 test key 2022-08-05 18:15:42 +02:00
Alexandre Paillier
b7a4c0d93b EIP-712 filtering UI adjustments; Removed half-blind special compilation flag 2022-08-05 18:15:41 +02:00
Alexandre Paillier
a24f621ce3 EIP712 filtering, added new APDUs 2022-08-05 18:15:41 +02:00
Alexandre Paillier
56e0875979 Made the hacky 712 generic step redraw a function 2022-08-05 18:15:41 +02:00
Alexandre Paillier
07aca18ab1 New EIP-712 UX set title/value functions 2022-08-05 18:15:40 +02:00
Alexandre Paillier
7e63bd8435 Now copies the EIP712 contract address into memory so it can be used later 2022-08-05 18:15:40 +02:00
Alexandre Paillier
f480d5091e Now uses an eip712 context struct instead of having multiple global variables => reduced bss footprint 2022-08-05 18:15:39 +02:00
Alexandre Paillier
8ea34f9f00 Fix hashing of signed negative integers smaller than 256 bits 2022-08-05 18:15:39 +02:00
Alexandre Paillier
d5603857b3 Fix UI display of signed negative integers smaller than 256 bits 2022-08-05 18:15:38 +02:00
Alexandre Paillier
f3e307423e EIP712 now displays integers differently if signed or unsigned 2022-08-05 18:15:38 +02:00
Alexandre Paillier
f0d6a2bba1 Now filters out all fields but the name in the EIP712Domain in the half-blind mode 2022-08-05 17:52:48 +02:00
Alexandre Paillier
239da44d0e Added a new temporary EIP-712 half-bind mode 2022-08-05 17:52:48 +02:00
Alexandre Paillier
a0551e8226 Added a function to check if we are in the domain or the message struct 2022-08-05 17:52:48 +02:00
Alexandre Paillier
2fa6379470 Now only compiles full EIP-712 support for capable devices 2022-08-05 17:52:47 +02:00
Alexandre Paillier
b9820774ba Replaced the debug printf in the EIP712 signature function by two more relevant ones 2022-08-05 17:52:47 +02:00
Alexandre Paillier
59dd149534 Added some NULL checks for global structure pointers 2022-08-05 17:52:46 +02:00
Alexandre Paillier
c0eaf8d106 Proper cleanup after EIP712 message 2022-08-05 17:52:46 +02:00
Alexandre Paillier
0525f7cda8 Fixes bad multi-screen value behaviour 2022-08-05 17:52:46 +02:00
Alexandre Paillier
2badb7b5b2 Now displays the field values
Show ints as uints for now
2022-08-05 17:52:45 +02:00
Alexandre Paillier
9cd39e2c02 Now uses some of the old EIP712 code as common code between the two implementations + approve/reject button now works 2022-08-05 17:52:45 +02:00