Skip to content
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

Support changing cipher and set AES-GCM as default cipher #383

Merged
merged 23 commits into from
Apr 14, 2024
Merged

Conversation

tmpfs
Copy link
Collaborator

@tmpfs tmpfs commented Apr 10, 2024

  • Local account updates files on disc and in-memory summaries
  • Network account force pushes updated account data to remote servers
  • Network account clients handle diverged trees and pull fresh account data
  • Store update identity event in the account event log

Closes #381

@tmpfs tmpfs self-assigned this Apr 10, 2024
tmpfs added 16 commits April 10, 2024 12:19
Requires work to write out the new identity vault and events.

Includes an improvement to the API for VaultBuilder.
To accommodate the need to completely overwrite the account data for
destructive operations such as changing encryption cipher.

create_account  -> PUT (formerly POST)
sync_account    -> PATCH (formerly PUT)

And added a stub handler which will overwrite all account data with the
given ChangeSet:

update_account  -> POST

We now need to re-deploy the demo and test self-hosted services after
this commit is merged.
To be distinct from the ChangeSet type used to create a new account on a
remote server as when forcefully updating we only need the folders to be
entire event logs. Any changes to the account, device and files event
logs can be patched from diffs.
So that a network account can force an update of an account's folders
after making destructive changes.
So that we can handle the case when a comparison is unknown which will
require further communication with the remote to determine if the trees
have completely diverged.
So that the client can test whether event logs have completely diverged.
To overwrite the data for an identity folder; requires work to log
and process an AccountEvent::UpdateIdentity variant which will be
detected on merge of account data to sync identity data after
destructive changes (cipher change or account password change).
@tmpfs
Copy link
Collaborator Author

tmpfs commented Apr 13, 2024

Just saw this error on a test run:

Error: invalid nonce
test change_cipher::network_sync_change_cipher ... FAILED

failures:

failures:
    change_cipher::network_sync_change_cipher

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 26 filtered out; f

Edit: this problem occurs when converting the identity folder before the user folders, fixed by changing the order back. Not sure why this would happen.

The reason this happens is that updating the cipher for a user folder requires looking up the folder password in the identity folder. If we update the cipher on the identity folder first then the identity folder has been invalidated but we don't sign in again until after all changes have completed (identity folder and user folders).

@tmpfs tmpfs merged commit 0e33b17 into main Apr 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support converting ciphers in the CLI
1 participant