You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore: clear wear restore secrets from memory #2179
On the watch, the restore flow and the seed store hold the recovery words and the passphrase as Kotlin Strings, which can't be wiped and stay on the heap until GC. The seed bytes are zeroed after use, but the words, the joined mnemonic passed to bitkit-core and the passphrase are not.
Proposal
Keep the words and passphrase in CharArray/ByteArray buffers owned by the restore view model, and zero them on save, failure, background and onCleared.
Check what bitkit-core and the Breez SDK accept without a String, and keep the String lifetime to the single call where one is required.
Done when
The restore flow keeps no String copy of a word or passphrase past the save call, and unit tests check that the buffers are zeroed.
Found in the pre-PR review of the Wear OS foundation PR.
Activity