Hidden network support needs to be fixed

Bug #388116 reported by Dan O'Reilly
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
wicd
Fix Released
Medium
Dan O'Reilly

Bug Description

The way we handle hidden networks right now doesn't work very well. We need to fix it. A couple of things need to happen:
1) When a wireless driver has an entry for an AP both with an essid and without, we should only display the one with an essid.
2) We need to properly remember the real essid of a hidden network. We end up displaying <hidden> when we should already know the real essid in many cases.
3) We should probably switch to a system where the user presses a button to assign an essid to a particular AP, rather than us using iwconfig/iwlist to try and make the real network name appear. This has a tendency to not work very well and cause issues.

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

The fix for #1 on that list has already been checked into trunk.

Changed in wicd:
assignee: nobody → Dan O'Reilly (oreilldf)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Don (don-feliciano) wrote :

To clarify #2 (as discussed in http://wicd.net/punbb/viewtopic.php?id=597), wicd doesn't just "end up displaying <hidden>," it also tries to associate using an essid of <hidden>. The impact is that association fails, and the user must manually initiate the connection rendering the auto connect feature inoperable.

Dan O'Reilly (oreilldf)
Changed in wicd:
milestone: none → 1.6.3
Revision history for this message
Adam Blackburn (adamblackburn) wrote :

Looking at #2:

        # Read the essid because we need to name those hidden
        # wireless networks now - but only read it if it is hidden.
        if cur_network["hidden"]:
            if cur_network.get("essid") in ["", "Hidden", "<hidden>", None]:
                cur_network["essid"] = "<hidden>"

is the code for supposedly naming the hidden networks. However, it appears to me that this doesn't actually load the ESSID out of the configuration file for hidden networks, as it claims it does it the comments. Unless I'm missing something else in that method that does this, I think we need an else statement on the second if that is like:

        # Read the essid because we need to name those hidden
        # wireless networks now - but only read it if it is hidden.
        if cur_network["hidden"]:
            if cur_network.get("essid") in ["", "Hidden", "<hidden>", None]:
                cur_network["essid"] = "<hidden>"
            else:
                cur_network['essid'] = self.config.get(section, 'essid')

Does that look about right, or am I missing something?

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

Sorry for the double post, the code from 1.5 for doing the same thing:

        # Read the essid because we be needing to name those hidden
        # wireless networks now - but only read it if it is hidden.
        if cur_network["hidden"]:
            if config.has_option(section, "essid"):
                cur_network["essid"] = config.get(section, "essid")
                if cur_network["essid"] in ["", "Hidden", "<hidden>"]:
                    cur_network["essid"] = "<hidden>"

Looks to me like 1.6 dropped the part where it loads the ESSID from the config file?

Revision history for this message
Andrew Psaltis (nacl) wrote :

Unless I am missing something, there is a problem with #1.

I regularly go to a place where each AP broadcasts three ESSIDs, two visible and one hidden. Thus, with this enabled, I would not be able to access the hidden one, which sometimes is the only one that actually works.

Revision history for this message
Mr. Norel (sh1v4-0h) wrote :

Hello
It's just a workaround but I haven't found it here so I post it.
With the following template added you can avoid clicking on 'Find a hidden network' wich does not always work.
-------8<---------------------------------
name = Hidden WPA 1/2 (Preshared Key)
author =
version = 1
require hiddenessid *ESSID apsk *Preshared_Key
-----
ctrl_interface=/var/run/wpa_supplicant
network={
       ssid="$_HIDDENESSID"
       scan_ssid=1
       proto=WPA RSN
       key_mgmt=WPA-PSK
       pairwise=CCMP TKIP
       group=CCMP TKIP
       psk="$_APSK"
}
-------8<---------------------------------

Revision history for this message
Stephen Hall (stephenhall) wrote :

In reply to Adam in #3 and #4, I can confirm that adding the line

cur_network["essid"] = config.get(section, "essid")

at line 1202 in wicd-daemon.py and restarting the daemon fixes the problem - simples!

A particularly easy fix for a particularly nasty bug!

Revision history for this message
Dan O'Reilly (oreilldf) wrote :

@Andrew

Do all three essids use the same MAC address?

Revision history for this message
Oleg Lypkan (winchester) wrote :

I installed WICD 1.6.2.2 today on my Ubuntu laptop.
I noticed that the following code (from Adam Blackburn's post #3) was already added to "wicd-daemon.py" in this version:
        if cur_network["hidden"]:
            if cur_network.get("essid") in ["", "Hidden", "<hidden>", None]:
                cur_network["essid"] = "<hidden>"
            else:
                cur_network['essid'] = self.config.get(section, 'essid')

The problem is that the code does not work for me (I have AP with hidden essid). I am not sure why condition "if cur_network.get("essid") in ["", "Hidden", "<hidden>", None]:" is necessary at all.

I changed it like Stephen Hall advised in post #7 and it works OK.
        if cur_network["hidden"]:
                cur_network['essid'] = self.config.get(section, 'essid')

Revision history for this message
Andrew Psaltis (nacl) wrote :

Dan:

Sorry for not noticing this.

Yes, all three ESSIDs use the same MAC address.

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

I committed some new code based on comments 9 and 7 for hidden network loading:

        # Read the essid because we need to name those hidden
        # wireless networks now - but only read it if it is hidden.
        if cur_network["hidden"]:
            # check if there is an essid in the config file
            # if there isn't, .get( will return None
            stored_essid = self.config.get(section, 'essid')
            if stored_essid:
                # set the current network's ESSID to the stored one
                cur_network['essid'] = stored_essid

I think this will solve the problem of loading the hidden network ESSIDs.

Revision history for this message
Jason (bostonvaulter) wrote :

Adam (#11), I can confirm that the latest bzr version fixes this issue for me (I have a hidden ESSID I connect to)

Revision history for this message
Karl Larsen (klarsen1) wrote :

    I just checked and I reset my version 1.5.9 to give the wireless signal in DBM and show all signals present. It does this fine showing the three I have signals from and I trained it to use my wireless router. It works fine and has done so for several months.

Revision history for this message
Stuart (stuart-ward) wrote :

If this is fixed upstream for a couple of weeks why hasn't it been pushed into a release?

Revision history for this message
Karl Larsen (klarsen1) wrote : Re: [Bug 388116] Re: Hidden network support needs to be fixed

Stuart wrote:
> If this is fixed upstream for a couple of weeks why hasn't it been
> pushed into a release?
>

No idea but I have a bug I put in that has not changed from
new in 6 months!

Karl

--

 Karl F. Larsen, AKA K5DI
 Linux User
 #450462 http://counter.li.org.
         Key ID = 3951B48D

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

Cleaning up for our release.

Looks like both 1) and 2) from the original bug report have been fixed. The only question left, then, is whether we should fix 3) for 1.6.3/1.7.0. Thoughts?

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

From the original bug report, 3) is not going to be fixed for 1.7.0.

Marking this as fix committed, because I believe it's fixed. If not, please reopen.

Changed in wicd:
status: In Progress → Fix Committed
Revision history for this message
Fatih Ekin (f-ekin22-deactivatedaccount) wrote :
Revision history for this message
Wiktor Janas (wixor) wrote :

Has this bug been addressed in 1.7.0?
I am running debian's 1.7.0-2 packages, custom 2.6.32.2 kernel with ath5k driver and the behavior is as follows: upon encountering a hidden network, its name is shown as \x00\x00\x00....\x00. By specifying hidden network's essid, the name shows up correctly and I can connect. The wireless-settings.conf file carries correct information, except hidden=False setting. When restarted, the name becomes \x00\x00...\x00 again. After next restart, the essid in config file is set to \x00\x00.....
With previous wicd versions I was able to get this running reliably (involved fiddling with config file and restarting the thing once or twice). However, 1.7.0 resists my efforts.

Changed in wicd:
status: Fix Committed → Fix Released
Revision history for this message
Matheus Gaudencio (matheusgr) wrote :

I also had the same problem as Wiktor. While trying to connect to a hidden network, the essid is set to \x00\x00 (Debian Wicd 1.7.0-2).

At wnettools.py the only way to detect if a essid is hidden, is testing if it receives a name as "Hidden", "<hidden>" or "":

       if ap['essid'] in ['Hidden', '<hidden>', "", None]:
           print 'hidden'
           ap['hidden'] = True
           ap['essid'] = "<hidden>"
       else:
           ap['hidden'] = False

But when I do a scanning for a hidden network, the essid is set to the desired network essid (wnettools.py SetEssid). Wpa_supplicant will use this essid and will return the hidden network essid when wnettools parses the wpa_supplicant stdout. So the ap['hidden'] is again set to False.

At wicd-daemon.py, ReadWirelessNetworkProfile(self, id) function, I explicitly set the hidden option to be the same as defined previously at the config file:

Original:

       for option in ['use_static_dns', 'use_global_dns', 'encryption',
                      'use_settings_globally']:
           cur_network[option] = bool(cur_network.get(option))
       # Read the essid because we need to name those hidden
       # wireless networks now - but only read it if it is hidden.
       if cur_network["hidden"]:

New:

       for option in ['use_static_dns', 'use_global_dns', 'encryption',
                      'use_settings_globally']:
           cur_network[option] = bool(cur_network.get(option))
       cur_network["hidden"] = bool(self.config.get(section, 'hidden'))
       # Read the essid because we need to name those hidden
       # wireless networks now - but only read it if it is hidden.
       if cur_network["hidden"]:

(sry, to lazy to do a patch)

This may not be the best solution, but since the scan doesn't know about the wireless configuration... Its the best way that I could find to keep the "hidden" configuration. By doing this, the hidden config remains True, and the configured ESSID is kept (no more \x00 for me).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.