Bug 367897 - Device::encryptionInfo returns wrong value
Summary: Device::encryptionInfo returns wrong value
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (other bugs)
Version First Reported In: 1.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-27 14:48 UTC by Thomas Posch
Modified: 2016-08-29 18:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
core/device.cpp patch (1.89 KB, patch)
2016-08-27 14:49 UTC, Thomas Posch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Posch 2016-08-27 14:48:51 UTC
Device::encryptionInfo states to return the SHA1 sums of the local and remote certificates.
Actually returned are the DER (binary) encoded local certificate, as well as the PEM (base64) encoded remote certificate.
See attached patch for a possible fix.

Reproducible: Always

Steps to Reproduce:
1. kdeconnect-cli --encryption-info --device <device>

Actual Results:  
SHA1 fingerprint of your device certificate is: XX:XX:XX:XX: ::::::*:H:รท
SHA1 fingerprint of remote device certificate is: --:--:-B:EG:IN: C:ER:TI:FI:CA:TE:--:--:-
:XX:XX:XX:...
...
...
...XX:XX

Expected Results:  
SHA1 fingerprint of your device certificate is: f9:5c:b3:0c:57:aa:31:5c:fc:13:0a:cc:de:9b:df:07:f9:5c:90:79
SHA1 fingerprint of remote device certificate is: 6c:b1:4d:c1:18:d7:81:32:da:10:96:8e:4e:4b:eb:94:e6:dc:1d:f8
Comment 1 Thomas Posch 2016-08-27 14:49:30 UTC
Created attachment 100807 [details]
core/device.cpp patch
Comment 2 Albert Vaca Cintora 2016-08-28 08:57:27 UTC
Thanks for the patch! Could you please provide me with your name and email? So I can apply it in your name, for authoring reasons. Contact me at albertvaka@gmail.com if you don't want to make it public.
Comment 3 Thomas Posch 2016-08-29 18:12:14 UTC
I am very happy you accepted my very first open source contribution.
Thank you for your work on kdeconnect.

--
Thomas Posch
Comment 4 Albert Vaca Cintora 2016-08-29 18:45:10 UTC
Thanks to you! I'm happy you decided to contribute and I look forward to more patches from you :)
Comment 5 Albert Vaca Cintora 2016-08-29 18:45:20 UTC
Git commit a759cdf678c80837a3737dac7a0c0cfb42329720 by Albert Vaca, on behalf of Thmoas Posch.
Committed on 29/08/2016 at 18:41.
Pushed by albertvaka into branch '1.x'.

Device::encryptionInfo returned the entire certificate instead of the hash

M  +11   -8    core/device.cpp

http://commits.kde.org/kdeconnect-kde/a759cdf678c80837a3737dac7a0c0cfb42329720