1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-27 07:40:59 +00:00

legacy: allow spending coins from Bitcoin paths if the coin ...

has implemented strong replay protection via SIGHASH_FORKID
This commit is contained in:
Pavol Rusnak 2020-08-15 17:59:51 +02:00 committed by Tomas Susanka
parent 5359509483
commit 503ac8d801
2 changed files with 13 additions and 0 deletions

View File

@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Print inverted question mark for non-printable characters.
- Allow spending coins from Bitcoin paths if the coin has implemented strong replay protection via `SIGHASH_FORKID`. [#1188]
### Deprecated
@ -331,3 +332,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
[#1030]: https://github.com/trezor/trezor-firmware/issues/1030
[#1098]: https://github.com/trezor/trezor-firmware/issues/1098
[#1165]: https://github.com/trezor/trezor-firmware/pull/1165
[#1188]: https://github.com/trezor/trezor-firmware/issues/1188

View File

@ -509,7 +509,18 @@ int cryptoIdentityFingerprint(const IdentityType *identity, uint8_t *hash) {
}
static bool check_cointype(const CoinInfo *coin, uint32_t slip44, bool full) {
#if BITCOIN_ONLY
(void)full;
#else
if (!full) {
// some wallets such as Electron-Cash (BCH) store coins on Bitcoin paths
// we can allow spending these coins from Bitcoin paths if the coin has
// implemented strong replay protection via SIGHASH_FORKID
if (slip44 == 0x80000000 && coin->has_fork_id) {
return true;
}
}
#endif
return coin->coin_type == slip44;
}