-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove optionals from wallet set up #4984
fix: remove optionals from wallet set up #4984
Conversation
); | ||
return Err(WalletStorageError::InvalidPassphrase); | ||
let cipher = match (db_passphrase_hash, db_encryption_salt) { | ||
(None, None) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will clean up this code in a posterior PR, which goal is to change the Backend
api. Doing so here, would require a lot of further refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
But I would say we need to remove all the possible encryption stuff in this PR.
This PR is already big, but most of the changes are tests.
We still have the ``apply_encryptionand
remove_encryption` functions. I would remove them.
We are enforcing encryption, but in the same breath, we allow a public outward function to decrypt the db.
When this PR gets merged, we should not have the backend be in two possible states, it should only be encrypted.
#5022) Description --- Enforces display of seed words for newly created wallet. Motivation and Context --- In a previous refactor (#4984), a component of the wallet was accidentally removed, namely the prompt of seed words for newly created wallet. How Has This Been Tested? --- In a folder with no wallet db, run `cargo run --release --bin tari_console_wallet` and chose the option create new wallet.
Description --- Improves handling of database encryption keys. Motivation and Context --- A [recent PR](#4984) hardens the codebase's handling of encrypted database fields. It stores the derived key used for encryption as a `Zeroizing` array. This work changes the key type to be a `Hidden` wrapper of a `SafeArray`, which prevents unintended output of the key and tries to prevent copies and moves. How Has This Been Tested? --- Existing tests pass.
Description
Currently, it is possible to set up a wallet (in creation/recovery/existing mode) without a password. This is not desirable, as in that case, sensitive data might be potentially stored in the database and leak in memory. We address this issue by enforcing passphrase creation.
Motivation and Context
For more details see issue #4977.
How Has This Been Tested?