After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 394956 - Truncated value sent to supplicant where hex-encoded PSK contains '00'
Truncated value sent to supplicant where hex-encoded PSK contains '00'
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other All
: Normal major
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2007-01-10 09:13 UTC by Simon Geard
Modified: 2007-03-07 20:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pass length to nm_supplicant_config_add_option instead of calling strlen on non-string. (431 bytes, patch)
2007-01-15 10:14 UTC, Simon Geard
none Details | Review

Description Simon Geard 2007-01-10 09:13:28 UTC
Please describe the problem:
NM fetches the hex-encoded WPA key from user/keyring, and converts it to a binary sequence before sending to the supplicant. However, the cipher_hexstr2bin() function appears to treat the binary sequence as a zero-terminated string.

In my case, the hex string contains consecutive '0's which cause a zero byte to appear in the middle of the binary sequence. This causes the key sent to the supplicant to be truncated, preventing the supplicant from accepting it.

Presumably cipher_hexstr2bin() and the code calling it should be treating the returned value as a sequence of bytes of known length, rather than as a string? Or why not just pass the hex string over the bus to the supplicant?

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Simon Geard 2007-01-15 10:14:25 UTC
Created attachment 80306 [details] [review]
Pass length to nm_supplicant_config_add_option instead of calling strlen on non-string.

The attached patch fixes the bug for me, by passing the correct length to nm_supplicant_config_add_option() instead of having that function inappropriately call strlen on the binary data.
Comment 2 Dan Williams 2007-03-07 20:43:25 UTC
committed to trunk, thanks