Bug 329342

Summary: Network manager forgets the 802.1x settings as soon as the dialog box is closed
Product: [Plasma] plasma-nm Reporter: pogliamarci
Component: editorAssignee: Lukáš Tinkl <lukas>
Status: RESOLVED FIXED    
Severity: major CC: dima, dmitry.risenberg, jgrulich, pogliamarci
Priority: NOR    
Version: 0.9.3.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=317568
https://launchpad.net/bugs/1259465
Latest Commit: Version Fixed In:
Attachments: Proposed patch

Description pogliamarci 2013-12-29 00:40:53 UTC
Created attachment 84316 [details]
Proposed patch

+++ This bug was initially created as a clone of Bug #317568 +++
Sorry for the duplicate, but the product in the original bug was wrong IMHO.

In the "802.1x Security" tab, one checks the "Use 802.1x authentication" box, fills out all of the information - Identity, certificates, private key, and so on - and clicks "Ok". Network manager does not connect to the network. Open the connection settings again, all of the information is gone, and "Use 802.1x authentication" is unchecked.

Trying to dig a bit into the problem, I found out that in the function verify_cert (libnm-util/nm-setting-8021x.c), libnm-util checks for array->data[array->len - 1] == '\0'.

plasma-nm does not properly terminates with a NULL byte the QByteArrays relative to the certificates and private keys when using 802.1x security, causing the reported misbehavior. Adding a trailing '\0' to the involved QByteArrays does solve the problem for me.
Comment 1 Jan Grulich 2013-12-29 10:48:13 UTC
Git commit b3aedbb580df338b2daa16dd8ff6786946fd805f by Jan Grulich.
Committed on 29/12/2013 at 10:47.
Pushed by grulich into branch 'master'.

Add missing terminating character to certificate name
Thanks to Marcello Pogliani

M  +6    -6    lib/editor/security802-1x.cpp

http://commits.kde.org/plasma-nm/b3aedbb580df338b2daa16dd8ff6786946fd805f