GNOME Bugzilla – Bug 394956
Truncated value sent to supplicant where hex-encoded PSK contains '00'
Last modified: 2007-03-07 20:43:25 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:
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.
committed to trunk, thanks