xmpp-client icon indicating copy to clipboard operation
xmpp-client copied to clipboard

Add support to importing libotr file containing multiple private keys

Open juniorz opened this issue 10 years ago • 2 comments

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

juniorz avatar Jul 03 '15 16:07 juniorz

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.

agl avatar Jul 04 '15 15:07 agl

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

juniorz avatar Jul 04 '15 17:07 juniorz