Modify

Opened 7 years ago

Closed 4 years ago

Last modified 4 years ago

#7891 closed enhancement (obsolete)

Problem with wpa_supplicant.sh

Reported by: rpc@… Owned by: nbd
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Backfire 10.03 RC3
Keywords: Cc:

Description

The default scripts wpa_supplicant.sh is set to WPA2 + AES encryption.
Not given other opportunities to connect to a different encryption method.
It is often necessary to connect to WiFi with WPA encryption or WPA2 + TKIP. Many people ask about this possibility because the universities configure this wifi network. And here comes the problem with wpa_supplicant and is unable to implement such functionality.
Below patch, which implements additional functionality.

Index: package/hostapd/files/wpa_supplicant.sh
===================================================================
--- package/hostapd/files/wpa_supplicant.sh	(wersja 22871)
+++ package/hostapd/files/wpa_supplicant.sh	(kopia robocza)
@@ -66,7 +66,14 @@
 			esac
 		;;
 		*wpa*|*8021x*)
-			proto='proto=WPA2'
+			case "$enc" in
+				wpa)
+					proto='proto=WPA'
+				;;
+				*)
+					proto='proto=WPA2'
+				;;
+			esac
 			key_mgmt='WPA-EAP'
 			config_get ieee80211w "$vif" ieee80211w
 			config_get ca_cert "$vif" ca_cert
@@ -74,8 +81,20 @@
 			ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
 			case "$eap_type" in
 				tls)
-					pairwise='pairwise=CCMP'
-					group='group=CCMP'
+					case "$enc" in
+			                	*tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip) 
+							pairwise='pairwise=CCMP TKIP'
+							group='group=CCMP TKIP'
+						;;
+						*tkip) 
+                                                        pairwise='pairwise=TKIP'
+                                                        group='group=TKIP'
+                                                ;;
+                				*) 
+							pairwise='pairwise=CCMP'
+							group='group=CCMP'
+						;;
+        				esac
 					config_get priv_key "$vif" priv_key
 					config_get priv_key_pwd "$vif" priv_key_pwd
 					priv_key="private_key=\"$priv_key\""

Attachments (3)

wpa_supplicant.diff (1.3 KB) - added by rpc@… 7 years ago.
Patch wpa_supplicant WPA,WPA2,TKIP, AES
wpa_supplicant_patch2.diff (1.2 KB) - added by rpc@… 7 years ago.
Patch2 - Extended capabilities added wpa_supplicant.sh.
wpa_supplicant_patch3.diff (1.2 KB) - added by rpc@… 7 years ago.
Fix patch2 - bug paste apostrophe

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by rpc@…

Patch wpa_supplicant WPA,WPA2,TKIP, AES

comment:1 Changed 7 years ago by rpc@…

Fixed patch. Now, more options are also concerned TTLS and PEAP. If anyone uses them. The original functionality remains unchanged.

Index: package/hostapd/files/wpa_supplicant.sh
===================================================================
--- package/hostapd/files/wpa_supplicant.sh	(wersja 23080)
+++ package/hostapd/files/wpa_supplicant.sh	(kopia robocza)
@@ -66,7 +66,28 @@
 			esac
 		;;
 		*wpa*|*8021x*)
-			proto='proto=WPA2'
+			case "$enc" in
+				wpa)
+					proto='proto=WPA'
+				;;
+				*)
+					proto='proto=WPA2'
+				;;
+			esac
+			case "$enc" in
+				*tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip)
+					pairwise='pairwise=CCMP TKIP'
+					group='group=CCMP TKIP'
+					;;
+				*tkip)
+					pairwise='pairwise=TKIP'
+					group='group=TKIP'
+					;;
+				*aes|*ccmp)
+					pairwise='pairwise=CCMP'
+					group='group=CCMP'
+				;;
+			esac
 			key_mgmt='WPA-EAP'
 			config_get ieee80211w "$vif" ieee80211w
 			config_get ca_cert "$vif" ca_cert
@@ -74,8 +95,10 @@
 			ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
 			case "$eap_type" in
 				tls)
-					pairwise='pairwise=CCMP'
-					group='group=CCMP'
+					test -n "$pairwise" || {
+						pairwise='pairwise=CCMP'
+						group='group=CCMP
+					}
 					config_get priv_key "$vif" priv_key
 					config_get priv_key_pwd "$vif" priv_key_pwd
 					priv_key="private_key=\"$priv_key\""

Changed 7 years ago by rpc@…

Patch2 - Extended capabilities added wpa_supplicant.sh.

comment:2 Changed 7 years ago by rpc@…

Sorry an error in pasting. Somewhere I melted into an apostrophe when posting.
I send a revised patch.

Index: package/hostapd/files/wpa_supplicant.sh
===================================================================
--- package/hostapd/files/wpa_supplicant.sh	(wersja 23080)
+++ package/hostapd/files/wpa_supplicant.sh	(kopia robocza)
@@ -66,7 +66,28 @@
 			esac
 		;;
 		*wpa*|*8021x*)
-			proto='proto=WPA2'
+			case "$enc" in
+				wpa)
+					proto='proto=WPA'
+				;;
+				*)
+					proto='proto=WPA2'
+				;;
+			esac
+			case "$enc" in
+				*tkip+aes|*tkip+ccmp|*aes+tkip|*ccmp+tkip)
+					pairwise='pairwise=CCMP TKIP'
+					group='group=CCMP TKIP'
+					;;
+				*tkip)
+					pairwise='pairwise=TKIP'
+					group='group=TKIP'
+					;;
+				*aes|*ccmp)
+					pairwise='pairwise=CCMP'
+					group='group=CCMP'
+				;;
+			esac
 			key_mgmt='WPA-EAP'
 			config_get ieee80211w "$vif" ieee80211w
 			config_get ca_cert "$vif" ca_cert
@@ -74,8 +95,10 @@
 			ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
 			case "$eap_type" in
 				tls)
-					pairwise='pairwise=CCMP'
-					group='group=CCMP'
+					test -n "$pairwise" || {
+						pairwise='pairwise=CCMP'
+						group='group=CCMP'
+					}
 					config_get priv_key "$vif" priv_key
 					config_get priv_key_pwd "$vif" priv_key_pwd
 					priv_key="private_key=\"$priv_key\""

Changed 7 years ago by rpc@…

Fix patch2 - bug paste apostrophe

comment:3 Changed 6 years ago by swalker

  • Owner changed from developers to nbd
  • Status changed from new to assigned

comment:4 Changed 4 years ago by nbd

  • Resolution set to obsolete
  • Status changed from assigned to closed

comment:5 Changed 4 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.