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

Add support to importing libotr file containing multiple private keys #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

juniorz
Copy link

@juniorz juniorz commented Jul 3, 2015

libotr supports OTR private key files (otr.private_key) containing multiple accounts/keys[1] but golang.org/x/crypto/otr simply import the first key it finds.

This is the config output after the change:

$ ./xmpp-client
 * (10:55AM) Failed to parse config file: open /Users/user/.xmpp-client: no such file or directory
 * (10:55AM) Enrolling new config file
Account (i.e. [email protected], enter to quit): [email protected]
Enable debug logging to /tmp/xmpp-client-debug.log?
 * (10:55AM) Not enabling debug logging...
Use Tor?: y
 * (10:55AM) Using Tor...
File to import libotr private key from (enter to generate): /Users/user/Desktop/otr.private_key
 * (10:55AM) 2 keys found:
 * (10:55AM) (1) fingerprint: a334e9d5a334e9d5a334e9d5a334e9d5a334e9d5
 * (10:55AM) (2) fingerprint: a7032f1ea7032f1ea7032f1ea7032f1ea7032f1e
Choose one to import (enter to choose another file):
File to import libotr private key from (enter to generate): /Users/user/Desktop/another-otr.private_key
 * (10:55AM) 2 keys found:
 * (10:55AM) (1) fingerprint: 5d0a15585d0a15585d0a15585d0a15585d0a1558
 * (10:55AM) (2) fingerprint: fcf3b648fcf3b648fcf3b648fcf3b648fcf3b648
Choose one to import (enter to choose another file): 2
 * (10:55AM) Importing private key with fingerprint fcf3b648fcf3b648fcf3b648fcf3b648fcf3b648
Proxy (i.e socks5://127.0.0.1:9050, which is the default):
 * (10:56AM) Since you selected a proxy, we need to know the server and port to connect to as a SRV lookup would leak information every time.
Server (i.e. xmpp.example.com, enter to lookup using unproxied DNS): foo.com
Port (enter for 5222):
Password for [email protected] (will not be saved to disk):
 * (10:56AM) Making connection to foo.com:5222 via proxy

1 - See test_suite/otr.private_key in git://git.otr.im/libotr.git

@agl
Copy link
Owner

agl commented Jul 4, 2015

Rather than import github.com/juniorz/otr-keychain, that code should be merged to go.crypto. Have you signed the CLA (https://golang.org/doc/contribute.html#copyright)? If so I can take care of that.

@juniorz
Copy link
Author

juniorz commented Jul 4, 2015

I totally agree. I've just signed the individual CLA.

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.

None yet

2 participants