1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-11 10:29:01 +00:00
Commit Graph

68 Commits

Author SHA1 Message Date
Jochen Hoenicke
b5fa8a266a New CoinInfo separated from protobuf structures
Having CoinType using the protobuf structures has several disadvantages.
- We always need to change trezor-common if we need a new field (like
  bech32 prefix)
- Every time Trezor initializes it sends all this information out and
  nobody cares.
- The protobuf structures add storage overhead due to their fixed size.

I also removed most of the `has_` fields except for forkid:
- `has_segwit` was merged with segwit
- `has_coin_shortcut` can be replaced by test for NULL if necessary.

The fields were reordered for better padding.
2017-11-05 19:23:34 +01:00
Pavol Rusnak
18d8cb3c56
add project website (trezor.io) to license header 2017-11-05 17:47:23 +01:00
Jochen Hoenicke
a24e8a0484 Remove magic constants
Use defines for wallet depth and change chain.  Updated some comments
to clarify what is checked.
2017-11-03 19:12:41 +01:00
Jochen Hoenicke
4805f27e8c Fix checking change address
There was a signed/unsigned problem: size_t is unsigned, but we use
-1 to indicate mismatch.  The problem was that when checking the input
address path, it still did this unintentionally when a mismatch was
detected, forbidding to sign with mismatched inputs, even when there
is no change address.

We now use 1 for mismatch.  Also we don't allow change address anymore
if the inputs have a path of length 1.  This simplifies the code a bit.
2017-11-03 19:12:41 +01:00
Jochen Hoenicke
98e617d874
startup: use custom reset_handler
+ group confidential data in one place
+ zero all SRAM where needed
2017-08-16 13:52:01 +02:00
Jochen Hoenicke
3440ead4c9
Fix multisig for BCC 2017-07-30 22:58:26 +02:00
Jochen Hoenicke
5f6948e66b
Remove progress update 2017-07-30 22:57:44 +02:00
Jochen Hoenicke
3c75d28c78 Check input bip32 path again on second pass. 2017-07-30 22:51:18 +02:00
Jochen Hoenicke
6b615ce405 No quadratic hashing for hardfork
Don't hash the whole transaction if forkid is set.  Instead use the
same codepath as for segwit.

Rename segwit_to_spend to authorized_amount and use it for forkid
amount and segwit amount validity checks.

Removed some duplicated code.
2017-07-30 22:51:18 +02:00
Saleem Rashid
979a6ef266 signing: Skip TX_META with SIGHASH_FORKID 2017-07-30 22:51:18 +02:00
Saleem Rashid
a34554b091 signing: Add SIGHASH_FORKID support 2017-07-30 22:51:18 +02:00
Pavol Rusnak
3d7d0f0734
use C99 for loop where possible 2017-07-23 22:20:51 +02:00
Pavol Rusnak
c6fd70b471
gettext: mark localizable strings as proof-of-concept 2017-06-18 22:47:32 +02:00
Pavol Rusnak
00f6312a81
rename failures, unify strings where possible 2017-06-18 21:19:21 +02:00
Pavol Rusnak
317363f84c
enable mixing of segwit and non-segwit inputs 2017-05-19 17:40:57 +02:00
Pavol Rusnak
391e3940e5
refactor fee computation, but keep ceil logic 2017-05-15 12:08:54 +02:00
Pavol Rusnak
24ac52079f
disable native segwit for now 2017-05-13 01:05:10 +02:00
Pavol Rusnak
49f44d296c
refactor signing_check_output 2017-05-13 00:45:11 +02:00
Pavol Rusnak
1ecbca8338
signing: add option to enable/disable mixing of segwit/non-segwit inputs 2017-05-09 23:26:18 +02:00
Pavol Rusnak
261b8d5e41
multisig: allow mismatched change addresses, show them as non-change 2017-05-06 19:52:49 +02:00
Pavol Rusnak
e31e55e505
simplify bip32 change logic 2017-05-05 15:12:47 +02:00
Pavol Rusnak
b1995bb8d1
remove segwit warning, don't enable segwit on coins that don't have segwit=true in definition 2017-05-04 18:54:54 +02:00
Pavol Rusnak
4183b6cbbc
update logic for change addresses (address_n length 1 is allowed now) 2017-05-04 18:16:45 +02:00
Jochen Hoenicke
d70ac623a4 Small bugfixes in signing
Segwit progress bar fixed.
Call `signing_abort` instead of `layoutHome` on all errors
The second `compile_output` does not work for user button and cannot
return -1.
2017-04-08 22:39:49 +02:00
Jochen Hoenicke
420471889d Refactored signing method.
Put larger pieces of codes into functions of their own.
No changes to this code.
2017-04-08 21:59:51 +02:00
Jochen Hoenicke
9d9377438c Fix missing returns after signing_abort 2017-04-08 20:33:27 +02:00
Jochen Hoenicke
e5c9b361d3 Better error message for segwit without amount 2017-04-08 20:29:58 +02:00
Jochen Hoenicke
7b1381766f
Change address support for segwit.
Rewrote change address support for segwit.
Also checks the bip32 path of change address.
2017-03-29 20:59:01 +02:00
Jochen Hoenicke
8e84a6716c Merge master into segwit 2017-01-06 16:55:12 +01:00
Jochen Hoenicke
52da2fc5e7
Segwit: Fix problems introduced by rebase 2017-01-04 18:41:26 +01:00
Pavol Rusnak
1763a5b647
use new hdnode_private_ckd_cached API 2016-12-12 12:17:48 +01:00
Pavol Rusnak
810d478f4c
check return values of ecdsa_sign calls 2016-11-08 15:48:44 +01:00
Jochen Hoenicke
2950588271
Fix segwit multisig.
Tested, see f41cbedd8becee05a830f418d13aa665125464547db5c7a6cd28f21639fe1228
and c9348040bbc2024e12dcb4a0b4806b0398646b91acf314da028c3f03dd0179fc
on testnet
2016-11-05 22:47:21 +01:00
Jochen Hoenicke
895da908e0
Simplified InputScriptType
Distinguish between single signature and multisig via has_multisig.
2016-11-05 22:47:21 +01:00
Jochen Hoenicke
388750f2d1
Support for P2SH compatible segwit 2016-11-05 22:47:21 +01:00
Jochen Hoenicke
b7b9891cb4
Signing for Segnet Transaction works
see segnet4 txid:
aa434a6ef4fcf350e319bacbd725fa7446f797cb3ed0cd0582826a49d3351ffa
2016-11-05 22:47:21 +01:00
Jochen Hoenicke
e5000fb196
segwit sign (completely untested) 2016-11-05 22:47:18 +01:00
Jochen Hoenicke
5c60be9854
hashes for segwit signature 2016-11-05 22:37:01 +01:00
Pavol Rusnak
e9f0706c2e
fix prevtx hashing when input count is 0 2016-10-21 13:20:57 +02:00
Pavol Rusnak
c288a0e328
implement TXEXTRADATA transaction RequestType 2016-10-20 13:25:40 +02:00
Jochen Hoenicke
a0ade6343e Reworked rfc6979 signing. (#116)
New parameter is_canonical that allows for generating signatures that
have additional requirements.
2016-10-06 16:58:05 +02:00
Jochen Hoenicke
ae4dff6e5f Only compute pubkey on demand.
Changed all hdnode callers to call hdnode_fill_public_key if
they need the public key.
2016-06-27 10:13:18 +02:00
Pavol Rusnak
5e5138066a
adapt the reorder of hash_final functions 2016-04-26 11:53:58 +02:00
Pavol Rusnak
d8aeb63854
pass version/lock_time parameters from SignTx message to signing_init function 2016-04-16 04:47:09 +02:00
Roman Zeyde
0ac032917b enable Trezor to perform SSH public key authentication
support both NIST256P1 and SECP256K1 ECDSA curves.
2015-06-26 10:43:39 +03:00
Pavol Rusnak
ea7e92f5dd make gears turn faster when signing 2015-04-13 18:53:58 +02:00
Pavol Rusnak
eefa689b33 call layout functions where needed to rewrite the display after dialog choice 2015-02-25 17:57:47 +01:00
Pavol Rusnak
137a60ce01 set multisig_fp_mismatch when non-multisig input is encountered 2015-02-25 17:03:46 +01:00
Pavol Rusnak
399d4d31b7 replace transaction check hashing 2015-02-25 17:03:46 +01:00
Jochen Hoenicke
5d8135be1a Faster signing, smoother progressbar.
Most time in signing transaction on the Trezor side is spent
in layoutProgress.  This patch reduces the calls to this functions.
We also compute the progress differently, reserving 50 % for downloading
input transactions and 50 % for the signing process.  This gives a
smoother experience if the input transactions are large.
2015-02-25 16:37:08 +01:00