BitBoxSwiss / bitbox02-firmware

Firmware code of the BitBox02 hardware wallet
https://bitbox.swiss/bitbox02
Apache License 2.0
217 stars 81 forks source link

keystore: copy instead of returning static pointer #1053

Closed benma closed 1 year ago

benma commented 1 year ago

Currently the seed is in RAM in plaintext after unlock. We want to encrypt it instead, using the secure chip.

This refactors the _get_seed and _get_bip39_seed functions to not simply return the static pointer, but a copy, allowing us to perform decryption later once the seeds are encrypted in RAM.