ReneVolution / profanity-omemo-plugin

A Python plugin to use (axolotl / Signal Protocol) encryption for the profanity XMPP messenger
GNU General Public License v3.0
64 stars 14 forks source link

Show own fingerprint #29

Closed flocke closed 6 years ago

flocke commented 7 years ago

Is there a way to show the fingerprint of my own account for trust verification? If not it should be implemented with something like /omemo fingerprint <account>.

Sent from my LGE Nexus 5X using FastHub

ReneVolution commented 7 years ago

It's not there yet, but I've been planning to implement it for a while now and ... well, for some reason did not implement it. Thanks for creating this ticket which should help me to remember :)

flocke commented 7 years ago

I was already expecting something like this since this is a very essential feature ;)

Maybe you could also try to implement a text-based QR code, I could find this open source app/library: https://fukuchi.org/works/qrencode/index.html.en I tried some of the text-based output variants and most of them worked very well with my phone (especially ANSI and UTF8). Obviously this should be a optional dependency.

There are some python bindings for it, but this also looks promising and is pure-python: https://github.com/mnooner256/pyqrcode

flocke commented 7 years ago

Ok, after a little testing with the QR codes created by Conversations on Android this may not be a good idea. The same QR code generated in terminal format (with the python module in the second link) takes almost my full screen. The only thing that generates a small enough QR code is qrencode -t UTF8 "..." but I don't know how to use that in your python code ....

ReneVolution commented 7 years ago

What do you think about a browser solution? E.g. creating a QR code with http://goqr.me/de/api/ and show it in the browser? That would at least not add any additional requirements.

flocke commented 7 years ago

That seems like the best option to me as well. Maybe something using the Google Charts API, which I have been using for a while now while working on my OTP app for Android. Or if you want to avoid using Google your site looks fine as well.

Sent from my LGE Nexus 5X using FastHub

bascht commented 7 years ago

I might be late to the party, but why is a scannable QR Code even necessary? Just displaying the Fingerprints looks like a reasonable solution (for me). 😃

flocke commented 7 years ago

@bascht Conversations, the Android client that introduced OMEMO, offers the feature to trust a key/fingerprint by scanning a QR code. It's not really a needed feature, but it would be nice to have. And if we use a browser-based solution it wouldn't really add any dependencies/major code so I don't see anything that speaks against it. Maybe have a config option to disable/enable automatically opening a browser with the QR code whenever /omemo fingerprint ... is called (disabled by default).

bascht commented 7 years ago

@flocke Yup, I know about that feature. But even then it would be a one-way solution, otherwise you'd have to scan the QR code off of your contacts mobile phone with your laptop webcam. 😼 But, I see where you're going and it would be a nice feature. 😄

bascht commented 7 years ago

Ding ding. Me again. This could even work "offline":

screenshot_20170630_231234

ReneVolution commented 7 years ago

@bascht: Doesn't that add dependencies?

bascht commented 7 years ago

Oh, yip. It would add https://pypi.python.org/pypi/qrcode. It would just work around having to render the whole barcode in the terminal.

maiki commented 7 years ago

The QR code is a nice to have feature, but ought to be a separate issue from showing the fingerprint. Showing it at all is a critical feature, generating a QR code is a feature enhancement. :smile:

ReneVolution commented 7 years ago

Hey @flocke. Did you see my last commit to show the fingerprints in profanity? You can now /omemo fingerprints <jid> to show all fingerprints for jid. I chose fingerprints as you could have multiple devices for one account and so have multiple fingerprints. If you omit that argument, it will show the ones for your account. Does that work for you so far?

marvinwankersteen commented 6 years ago

Can please someone explain me how to show the fingerprints? If I type /omemo fingerprints <jid>, nothing is displayed. Only 18:00:12 - Fingerprints for account: <jid> is displayed.

Edit: Hm, okay. It just works for other contacts, not for my own. Is it possible to show the fingerprint of the profanity client?

ReneVolution commented 6 years ago

Hey @marvinwankersteen, did you actually type /omemo fingerprints <jid>? <jid> in this context is a placeholder which should be replaced by an actual jabber-id. If you run /omemo fingerprints, that should show all your personal fingerprints.

Hope this helps.

marvinwankersteen commented 6 years ago

@ReneVolution: No, I replaced <jid> with the jid of some of my contacts ;-) If I just run /omemo fingerprints then this is the reply: 13:05:46 - Fingerprints for account: marco

Nothing more. No fingerprints. marco is my account-name.

dholl commented 6 years ago

@ReneVolution - I'm having the same trouble as @marvinwankersteen

[ But I'm on Mac, and I compiled profanity from MacPorts........ does that void my warranty? ;) ]

decentral1se commented 6 years ago

Same as https://github.com/ReneVolution/profanity-omemo-plugin/issues/29#issuecomment-362569547 here. I just see:

00:02:55 -                                                                                                                                                                                     
00:03:19 - OMEMO Plugin Enabled: True                                                                                                                                                          
00:03:30 - Fingerprints for account: foo@bar.com 

No fingerprint is seen.

bitkeks commented 6 years ago

Using 7c66c0d4cea43ea15f7747a8a4479d021040b8b7 I found the following fix after looking into the omemo.db sqlite database.

581c581
<         contact_jid = arg2 or ProfOmemoUser.account
---
>         contact_jid = arg2 or "-1"

-1 is the identifier of the local account in the database, which the query for fingerprints uses. See: https://github.com/ReneVolution/profanity-omemo-plugin/blob/f0a6465d17440f312992f2956b845b3c2f4239e2/src/profanity_omemo_plugin/omemo/liteidentitykeystore.py#L56-L61