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

Private key transfer #1090

Merged
merged 16 commits into from
Nov 2, 2017
Merged

Private key transfer #1090

merged 16 commits into from
Nov 2, 2017

Conversation

daniele-athome
Copy link
Member

@daniele-athome daniele-athome commented Nov 1, 2017

Use the session channel to deliver the private key safely to another device.

Server: kontalk/tigase-extension#85

@daniele-athome daniele-athome added the enhancement New feature or request label Nov 1, 2017
@daniele-athome daniele-athome self-assigned this Nov 1, 2017
Although it's a bit tricky because the actual work
is done in NumberValidation, meaning that if it fails,
form data in ImportDeviceActivity will be lost.
So next step would be to retrieve the private key from
ImportDeviceActivity and pass it on via activity result
to NumberValidation.

Signed-off-by: Daniele Ricci <[email protected]>
Signed-off-by: Daniele Ricci <[email protected]>
@daniele-athome
Copy link
Member Author

@abika I finished the implementation and I did some modifications to your code too. Particularly, I had to also receive the public key along with the private key because the public key contains the signature that is needed to actually login. The public key is not uploaded though, it is automatically returned by the server along with the private key (since the server has a copy).
Feel free to tell me comments or remarks about the procedure and the code in general.

Needless to say, the new code still requires massive testing. I might publish it on the Google Play alpha channel.

@daniele-athome daniele-athome merged commit 42613ff into master Nov 2, 2017
@daniele-athome daniele-athome deleted the feature/privatekey-transfer branch November 2, 2017 20:30
@daniele-athome daniele-athome added this to the Next milestone Nov 2, 2017
@webratte
Copy link
Contributor

webratte commented Nov 4, 2017

It seems this #122 is closed by this.

@daniele-athome
Copy link
Member Author

You're right, thanks!

@abika
Copy link
Member

abika commented Nov 12, 2017

Thanks for your work Daniele! I will look into it and implement the key transfer on the Desktop-Client side. Seems like I already started some of it two years ago to make the integration in the import wizard easier - although I can't remember doing so.)
This will definitely be done but I totally lack the time recently so it won't be finished soon...

@daniele-athome
Copy link
Member Author

Don't worry, no rush.
I'll use this time to update the spec page: https://github.com/kontalk/specs/blob/master/account.md

@daniele-athome
Copy link
Member Author

I've updated the specs page with the protocol. The Account class for private key retrieval is in client-common-java. For uploading the key you can use a plain Data Form (don't ask me why I used a custom element for the retrieval part, I don't really remember).

The private key will be encrypted so you should ask for the passphrase before trying to import it.
For the moment, trust information is not included in the transferred data: there is just 1 private key packet and 1 public key packet (but it is enough to login: you'll need to generate the X.509 bridge certificate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants