Bug 532723 - NetworkManager rejects 63 character pass keys for wireless network
Summary: NetworkManager rejects 63 character pass keys for wireless network
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: NetworkManager
Version: 5.4
Hardware: i386
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Dan Williams
QA Contact: desktop-bugs@redhat.com
URL: http://bugs.centos.org/view.php?id=3962
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-03 16:19 UTC by john.haberfellner
Modified: 2010-03-30 08:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:35:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0263 0 normal SHIPPED_LIVE NetworkManager bug fix update 2010-03-29 12:53:52 UTC

Description john.haberfellner 2009-11-03 16:19:46 UTC
Description of problem:
This is a bug found on CentOS 5.4. The CentOS developer team requested that I report this problem at upstream. The link to the CentOS 5.4 bug report can be found at:
http://bugs.centos.org/view.php?id=3962

Version of NetworkManager in CentOS 5.4 is reported by yum as NetworkManager-0.7.0-9.el5.i386

I'm running a wireless network using WPA2 encryption with AES. When I try to connect with a 63 character wireless pass key the NetworkManager for CentOS 5.4 fails to connect to the wireless network. If I disable NetworkManager and use wpa_supplicant and dhclient with the same 63 character pass key with CentOS 5.4 I am able to connect to the wireless network without problems. I was also able to use a 63 character pass key with the NetworkManager in CentOS 5.3.

If I use a 62 character pass key with CentOS 5.4 then NetworkManager works fine and I am able to connect to the wireless network. The problem occurs only if the pass key is 63 characters in length.

From the /var/log/messages file on CentOS 5.4:
nm_supplicant_config_add_setting_wireless_security(): Invalid PSK length 63: not between 8 and 63 characters inclusive.

Additional details from the /var/log/messages file are included below:
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
Nov 1 18:59:34 cnlaptop NetworkManager: <info> (wlan0): device state change: 4 -> 5
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Activation (wlan0/wireless): connection 'Auto xxxxxxxxx' has security, and secrets exist. No new secrets needed.
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Config: added 'ssid' value 'xxxxxxxxx'
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Config: added 'scan_ssid' value '1'
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Config: added 'key_mgmt' value 'WPA-PSK'
Nov 1 18:59:34 cnlaptop NetworkManager: <WARN> nm_supplicant_config_add_setting_wireless_security(): Invalid PSK length 63: not between 8 and 63 characters inclusive.
Nov 1 18:59:34 cnlaptop NetworkManager: <WARN> build_supplicant_config(): Couldn't add 802-11-wireless-security setting to supplicant config.
Nov 1 18:59:34 cnlaptop NetworkManager: <WARN> real_act_stage2_config(): Activation (wlan0/wireless): couldn't build wireless configuration.
Nov 1 18:59:34 cnlaptop NetworkManager: <info> (wlan0): device state change: 5 -> 9
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Activation (wlan0) failed for access point (xxxxxxxxx)
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Marking connection 'Auto xxxxxxxxx' invalid.
Nov 1 18:59:34 cnlaptop NetworkManager: <info> Activation (wlan0) failed. 

How reproducible:
Always

Steps to Reproduce:
Described above
  
Actual results:
Can't log into wireless network due using 63 character pass key.

Expected results:
63 character pass key should work fine.


Additional info:

Comment 1 Dan Williams 2009-11-04 21:23:00 UTC
does your phassphrase contain any non-ascii characters?  By the standard, wpa passphrases may only contain ASCII characters.  What may be happening is, if your passphrase does contain non-ascii characters, those may not evaluate to a 1-byte long, and thus your passphrase overflows the check.  Unfortunately, the only way to distinguish between passphrase and hex key is with length, so we can't just accept any length passphrase.

Comment 2 john.haberfellner 2009-11-05 02:25:28 UTC
Hi,

I used the "63 random printable ASCII characters" passwords from the https://www.grc.com/passwords.htm site so the characters in the passphrase should all be printable ASCII characters. I looked at my passphrase and all the characters seemed to be ASCII. I wasn't aware of the issue with non-ASCII characters - thanks for pointing this out.

I'm no expert on wireless networking so please excuse me if this is dumb question but the same 63 character passphrase worked with wpa_supplicant so shouldn't it have worked with NetworkManager as well?

Comment 3 john.haberfellner 2009-11-06 02:33:23 UTC
Hi,

The password I was using when I encountered the problem is:
"pVZ7!WXQ\17L[\av)e;}bL1%oa20e&wuzQn~{2"r'NvMQQP^N,4f+/(wDDC!5JC"

Thanks.

Comment 4 Dan Williams 2009-11-06 08:08:53 UTC
Confirmed, there is a bug validating 63-character passphrases which was fixed upstream earlier this year:

commit f216af1e5d02c2f847d343616b7af7beac0fcdd3
Author: Tambet Ingo <tambet>
Date:   Fri Jun 19 11:34:56 2009 +0300

    wifi: Allow 63 byte long PSK (Patch from Robert Piasek).


PM: the fix is trivial and obviously correct.

QE: using the passphrase above, a buggy system would show the message "nm_supplicant_config_add_setting_wireless_security(): Invalid PSK length 63:
not between 8 and 63 characters inclusive." when attempting to connect to an AP using that WPA passphrase and fail to connect.  A correctly operating system would not show that message in /var/log/messages, and would connect to the AP.

Full patch would be:

diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c
index 6df7168..64a4a06 100644
--- a/src/supplicant-manager/nm-supplicant-config.c
+++ b/src/supplicant-manager/nm-supplicant-config.c
@@ -609,7 +609,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
                                nm_warning ("Error adding 'psk' to supplicant config.");
                                return FALSE;
                        }
-               } else if (psk_len >= 8 && psk_len < 63) {
+               } else if (psk_len >= 8 && psk_len <= 63) {
                        /* Use TYPE_STRING here so that it gets pushed to the
                         * supplicant as a string, and therefore gets quoted,
                         * and therefore the supplicant will interpret it as a

Comment 6 Dan Williams 2009-12-15 00:56:24 UTC
rh532723-long-psk-fix.patch

Comment 10 errata-xmlrpc 2010-03-30 08:35:33 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0263.html


Note You need to log in before you can comment on or make changes to this bug.