01.03.2023 17:47, Klemens Nanni пишет:
> Same diff as nov 2021 "Re: installer: prompt for WEP only if available"
> https://marc.info/?l=openbsd-tech&m=163680942623448&w=2
> 
> bwfm(4) still has no WEP support and using it for installs keeps showing
> 
>     Which network interface do you wish to configure? (or 'done') [bse0] bwfm0
>     ifconfig: SIOCS80211NWKEY: Operation not supported by device
>     Access point? (ESSID, 'any', list# or '?') [any] 2
>     Security protocol? (O)pen, (W)EP, WPA-(P)SK [O] 
> 
> Silence the error and disable (W)EP as answer which cannot work.
> As soon as someone fixes, no matter which driver, WEP will be offered again.

There is no reason to keep it broken like that, so I'll commit this fix
in two days unless I hear objections.

> OK?
> 
> Index: install.sub
> ===================================================================
> RCS file: /cvs/src/distrib/miniroot/install.sub,v
> retrieving revision 1.1230
> diff -u -p -r1.1230 install.sub
> --- install.sub       21 Feb 2023 12:56:50 -0000      1.1230
> +++ install.sub       1 Mar 2023 17:30:38 -0000
> @@ -1245,10 +1245,11 @@ ieee80211_scan() {
>  # Configure 802.11 interface $1 and append ifconfig options to hostname.if 
> $2.
>  # Ask the user for the access point ESSID, the security protocol and a 
> secret.
>  ieee80211_config() {
> -     local _if=$1 _hn=$2 _prompt _nwid _haswpa=0 _err
> +     local _if=$1 _hn=$2 _prompt _nwid _haswep=0 _haswpa=0 _err
>  
> -     # Reset 802.11 settings and determine wpa capability.
> -     ifconfig $_if -nwid -nwkey
> +     # Reset 802.11 settings and determine WEP and WPA capabilities.
> +     ifconfig $_if -nwid
> +     ifconfig $_if -nwkey 2>/dev/null && _haswep=1
>       ifconfig $_if -wpa 2>/dev/null && _haswpa=1
>  
>       # Empty scan cache.
> @@ -1273,17 +1274,18 @@ ieee80211_config() {
>       # 'any' implies that only open access points are considered.
>       if [[ $_nwid != any ]]; then
>  
> -             _prompt="Security protocol? (O)pen, (W)EP"
> +             _prompt="Security protocol? (O)pen"
> +             ((_haswep == 1)) && _prompt="$_prompt, (W)EP"
>               ((_haswpa == 1)) && _prompt="$_prompt, WPA-(P)SK"
>               while :; do
>                       ask_until "$_prompt" "O"
> -                     case "$_haswpa-$resp" in
> -                     ?-[Oo]) # No further questions
> +                     case "${_haswep}${_haswpa}-${resp}" in
> +                     ??-[Oo]) # No further questions
>                               ifconfig $_if join "$_nwid"
>                               quote join "$_nwid" >>$_hn
>                               break
>                               ;;
> -                     ?-[Ww]) ask_passphrase "WEP key?"
> +                     1?-[Ww])        ask_passphrase "WEP key?"
>                               # Make sure ifconfig accepts the key.
>                               if _err=$(ifconfig $_if join "$_nwid" nwkey 
> "$_passphrase" 2>&1) &&
>                                       [[ -z $_err ]]; then
> @@ -1292,7 +1294,7 @@ ieee80211_config() {
>                               fi
>                               echo "$_err"
>                               ;;
> -                     1-[Pp]) ask_passphrase "WPA passphrase?"
> +                     ?1-[Pp])        ask_passphrase "WPA passphrase?"
>                               # Make sure ifconfig accepts the key.
>                               if ifconfig $_if join "$_nwid" wpakey 
> "$_passphrase"; then
>                                       quote join "$_nwid" wpakey 
> "$_passphrase" >>$_hn
> 

Reply via email to