abandonware/wireless-tools

iwlist 'security' should be an array

skandragon opened this issue · 2 comments

It is possible to have more than one security scheme in play at the same time. Eg:

Cell 06 - Address: 00:19:A9:7B:96:E0
    ESSID:"Rn4INSTa3q"
    Protocol:IEEE 802.11b
    Mode:Master
    Frequency:2.462 GHz (Channel 11)
    Encryption key:on
    Bit Rates:11 Mb/s
    Extra:wpa_ie=dd180050f20101000050f20201000050f20201000050f2010000
    IE: WPA Version 1
        Group Cipher : TKIP
        Pairwise Ciphers (1) : TKIP
        Authentication Suites (1) : 802.1x
    Extra:rsn_ie=30140100000fac020100000fac040100000fac012900
    IE: IEEE 802.11i/WPA2 Version 1
        Group Cipher : TKIP
        Pairwise Ciphers (1) : CCMP
        Authentication Suites (1) : 802.1x
        Preauthentication Supported
    Quality=0/100  Signal level=61/100  

The security values are currently prioritized by strength. For the example above, it would choose WPA2 rather than WPA as the security method. There are cases where returning all available security methods would be preferred. Although an easy change, it will break backwards compatibility and so this will have to wait for a 1.0.0 release.

Alternately, you could make another field which lists all the available modes, and keep this one as as the "preferred mode" or something.