Warren Turkal wrote:
> The wifi-iface actually supports an undocumented option to choose
> whether to treat a passphrase as a text passphrase or an encoded
> passphrase (like encoded by the wpa_passphrase utility). This patch
> documents that functionality.
> 
> Signed-off-by: Warren Turkal <w...@penguintechs.org>
> ---
>  docs/wireless.tex |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/docs/wireless.tex b/docs/wireless.tex
> index 0f87810..a093cbf 100644
> --- a/docs/wireless.tex
> +++ b/docs/wireless.tex
> @@ -116,6 +116,7 @@ config wifi-iface
>      option key2     key 2
>      option key3     key 3
>      option key4     key 4
> +    option passphrase 0,1
>      option server   ip address
>      option port     port
>      option hidden   0,1
> @@ -210,6 +211,13 @@ config wifi-iface
>      \item \texttt{key, key1, key2, key3, key4} (wep, wpa and psk) \\
>          WEP key, WPA key (PSK mode) or the RADIUS shared secret (WPA RADIUS 
> mode)
>  
> +    \item \texttt{passphrase} (wpa) \\
> +        0 treats the wpa psk as a text passphrase; 1 treats wpa psk as
> +        encoded passphrase. You can generate an encoded passphrase with
> +        the wpa\_passphrase utility. This is especially useful if your
> +        passphrase contains special characters. This option only works
> +        when using mac80211 or atheros type devices.
> +
>      \item \texttt{server} (wpa) \\
>          The RADIUS server ip address
>  
This documentation looks to be correct for wpa_supplicant but hostapd 
appears to detect an encoded passphrase by the number of characters, as 
seen in the current version of hostapd.sh (same code in 8.09 and trunk) 
https://dev.openwrt.org/browser/branches/8.09/package/hostapd/files/hostapd.sh?rev=14040
{{{
         case "$enc" in
                 *psk*|*PSK*)
                         config_get psk "$vif" key
                         if [ ${#psk} -eq 64 ]; then
                                 append hostapd_cfg "wpa_psk=$psk" "$N"
                         else
                                 append hostapd_cfg 
"wpa_passphrase=$psk" "$N"
                         fi
                 ;;
}}}
IMO we should consolidate on one convention or the other; my preference 
is autodetecting based on the key length. I'm going to cross-link with 
the trac ticket on the same topic and see who bites in either location. 
https://dev.openwrt.org/ticket/4240

-Andy
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to