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

Managing persistent values #72

Closed
claucece opened this issue Sep 20, 2018 · 8 comments
Closed

Managing persistent values #72

claucece opened this issue Sep 20, 2018 · 8 comments
Assignees
Labels
importance high An issue that is absolutely necessary to have done before final release needs clarification question

Comments

@claucece
Copy link
Member

Some ideas:

  • if the private key file is deleted, the client profile, prekey profile and prekey messages should be regenerated as well.
  • if the forging key file is deleted, the client profile and (maybe) prekey profile should be regenerated as well.
  • if the shared prekey file is deleted, the prekey profile should be regenerated as well.
  • if the prekey messages are deleted should we deleted the published ones as well?
@claucece claucece added question importance high An issue that is absolutely necessary to have done before final release labels Sep 20, 2018
@olabini
Copy link
Contributor

olabini commented Sep 21, 2018

Actually, if the private key file is deleted, we don't need to regenerate the prekey messages. They will still be valid.
And with regard to the forging key, if that file is deleted, we can still get the public key value from a client profile - so we only need to regen the forging key if both client profiles AND the forging key file is gone. We probably don't need to regen the prekey profile in this case

About prekey messages - yeah, if we notice that we don't have as many prekey messages locally as are published for us, then something is definitely wrong - we should probably try to drain the prekey messages from the prekey server to get back to a good state.

@claucece
Copy link
Member Author

Thanks @olabini

It should be then:

  • if the private key file is deleted, the client profile and prekey profile should be regenerated as well.
  • if the forging key file is deleted get it from the client profile.
  • if the shared prekey file is deleted, the prekey profile should be regenerated as well.
  • if the prekey messages are deleted, delete the published ones as well
  • if the client profile is deleted, get its info from the current priv key if there is
  • if the prekey profile is deleted, get its info from the current shared prekey if there is

@claucece
Copy link
Member Author

claucece commented Oct 2, 2018

As discuss, the functionality to check for validity should be done the moment you read the persisted data, but we should have a timer that checks for this validity as well. I've been thinking that when we want to start a conversation; we should also check for the validity of data; but do no publishing/writing action if it is wrong, just fail (for example, if the long-term public key is invalid, just fail and not generate a new one and write it to a file).

@claucece
Copy link
Member Author

claucece commented Oct 2, 2018

@olabini @giovaneliberato @DrWhax thoughts?

@olabini
Copy link
Contributor

olabini commented Oct 2, 2018

Yeah, sounds good to me. So we have two different functions - one that "ensures", including reading from disk, creating stuff - and another that "verifies" and just returns failure if something is incorrect. The second one should ideally be used before most OTR actions are taken.

@claucece claucece added this to the October milestone Oct 2, 2018
@DrWhax
Copy link
Member

DrWhax commented Oct 4, 2018

No extra thoughts, I agree with the idea outlined here.

@olabini
Copy link
Contributor

olabini commented Oct 6, 2018

Basically all of this functionality is there now. The only thing is we don't delete messages on the server if they are deleted locally. I'm not sure how to do this in a good way, honestly, and whether it makes sense.
I'll close this for now.

@olabini olabini closed this as completed Oct 6, 2018
Pidgin plugin with OTRv4 automation moved this from In Progress to Done Oct 6, 2018
@claucece
Copy link
Member Author

claucece commented Oct 7, 2018

The only thing is we don't delete messages on the server if they are deleted locally. I'm not sure how to do this in a good way, honestly, and whether it makes sense.

What we perhaps need to do, is show a good error message for the user in this case. I don't think we are showing anything at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
importance high An issue that is absolutely necessary to have done before final release needs clarification question
Projects
Development

No branches or pull requests

4 participants