LedgerHQ / app-bitcoin-new

Modern Bitcoin Application based on PSBT and Descriptors
Apache License 2.0
93 stars 69 forks source link

Missing return checks on some hash functions #234

Closed bigspider closed 5 months ago

bigspider commented 6 months ago

Some functions that return void call SDK functions that potentially return an error code, which is currently unchecked. The error doesn't ever happen since the parameters of the functions are correct, but we should add a LEDGER_ASSERT as defensive programming.

Functions to cover: crypto_get_checksum, crypto_ripemd160, crypto_hash160, crypto_tr_tagged_hash_init and crypto_tr_tapleaf_hash_init.