Commit Graph

264 Commits

Author SHA1 Message Date
Alexandre Paillier
35c77ff29c Increased EIP712 max array depth to 8 2022-09-14 17:27:34 +02:00
Alexandre Paillier
5ce56bd53e Renamed EIP712 context files to less generic ones 2022-09-14 17:27:33 +02:00
Alexandre Paillier
1b46ccb190 Extract EIP-712 UI code 2022-09-14 17:27:33 +02:00
Alexandre Paillier
ab67ae1cb3 Merge remote-tracking branch 'origin/develop' into HEAD 2022-09-14 17:27:25 +02:00
Alexandre Paillier
a27826dcf6 Fix EIP712 type_hash function description 2022-09-14 09:41:39 +02:00
Alexandre Paillier
ed479128fd EIP712 Filtering count checking 2022-09-14 09:41:39 +02:00
Alexandre Paillier
93b0bb08f7 Better handling of missing EIP721 error codes + add a missing one for EIP712 filtering signature checking 2022-09-14 09:41:38 +02:00
Alexandre Paillier
9e4df4b655 Updated EIP712 filtering signature specs to start with a magic number
Making it impossible for a signature of one type to be valid as another
2022-09-14 09:41:38 +02:00
Alexandre Paillier
3ee1fa419a Now supports EIP-712 filtering with missing chain id & contract address 2022-09-14 09:41:37 +02:00
Alexandre Paillier
770bd9c39d Replaced the signature key used for EIP712 tests by the CAL testing one 2022-08-31 18:09:38 +02:00
Clement Bouvet
89eeaa7b7d eth: split ux from rest of source 2022-08-24 10:35:16 +02:00
Alexandre Paillier
ed7b6541c0 EIP712 - Extra fixes from security review 2022-08-10 16:19:52 +02:00
Alexandre Paillier
98889e2642 Moved EIP712 filtering argument switch from P1 to P2, more in line with other EIP712 APDUs 2022-08-10 15:19:10 +02:00
Alexandre Paillier
6758453dfa Merge remote-tracking branch 'origin/develop' into apr/feature/eip712 2022-08-09 14:05:14 +02:00
Jorge Martins
d384007912 Fix feesToString buffer overflow 2022-08-09 11:30:43 +02:00
Alexandre Paillier
3e3dade0b4 Security review code linting 2022-08-08 13:55:45 +02:00
Jorge Martins
b2ec3eff0a Security review (#331)
* Fix some issues

* add typed_data.c changes

* Make attribution after the check
2022-08-08 13:53:41 +02:00
Alexandre Paillier
de9e895ad9 EIP-712 code linting 2022-08-05 18:15:59 +02:00
Alexandre Paillier
0cf21cdf73 Better EIP-712 array error-handling on APDU parsing 2022-08-05 18:15:58 +02:00
Alexandre Paillier
5e5b3c3621 EIP712 STRUCT FIELD IMPL now checks the APDU payload bounds 2022-08-05 18:15:58 +02:00
Alexandre Paillier
38f199e46b Now only writes to EIP-712 UI buffers data that should be show
Prevents the case if the last field of a message is supposed to be hidden and after reaching the Approve/Reject screens the user goes back to see the last field, he would see the actual last field that should be hidden instead of the last one he saw beforehand.
2022-08-05 18:15:57 +02:00
Alexandre Paillier
b4fe42cd78 EIP712 STRUCT FIELD DEF now checks the APDU payload bounds 2022-08-05 18:15:57 +02:00
Alexandre Paillier
0cc75edf69 EIP712 code Doxygen comments pass 2022-08-05 18:15:57 +02:00
Alexandre Paillier
0cfb16759c Add missing APDU return code 2022-08-05 18:15:56 +02:00
Alexandre Paillier
fcc375a9aa Small refactoring to EIP712 typed data functions 2022-08-05 18:15:56 +02:00
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