summaryrefslogtreecommitdiffstats
path: root/contrib/hostapd/eapol_version.patch
blob: c02e3677d0e6de3213792a1495d41c3d6c1e6df8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
? eapol_version.patch
Index: config.c
===================================================================
RCS file: /home/ncvs/src/contrib/hostapd/config.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 config.c
--- config.c	7 Mar 2006 05:46:42 -0000	1.1.1.3
+++ config.c	27 Mar 2006 05:28:09 -0000
@@ -29,6 +29,7 @@
 #include "sha1.h"
 #include "eap.h"
 #include "radius_client.h"
+#include "ieee802_1x.h"		/* XXX for EAPOL_VERSION */
 
 
 static struct hostapd_config *hostapd_config_defaults(void)
@@ -60,6 +61,7 @@
 	conf->logger_stdout = (unsigned int) -1;
 
 	conf->auth_algs = HOSTAPD_AUTH_OPEN | HOSTAPD_AUTH_SHARED_KEY;
+	conf->eapol_version = EAPOL_VERSION;	/* NB: default version */
 
 	conf->wpa_group_rekey = 600;
 	conf->wpa_gmk_rekey = 86400;
@@ -855,6 +857,17 @@
 			}
 		} else if (strcmp(buf, "eapol_key_index_workaround") == 0) {
 			conf->eapol_key_index_workaround = atoi(pos);
+		} else if (strcmp(buf, "eapol_version") == 0) {
+			conf->eapol_version = atoi(pos);
+			if (conf->eapol_version < 1 ||
+			    conf->eapol_version > 2) {
+				printf("Line %d: invalid EAPOL "
+				       "version (%d): '%s'.\n",
+				       line, conf->eapol_version, pos);
+				errors++;
+			} else
+				wpa_printf(MSG_DEBUG, "eapol_version=%d",
+				   conf->eapol_version);
 #ifdef CONFIG_IAPP
 		} else if (strcmp(buf, "iapp_interface") == 0) {
 			conf->ieee802_11f = 1;
Index: config.h
===================================================================
RCS file: /home/ncvs/src/contrib/hostapd/config.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 config.h
--- config.h	7 Mar 2006 05:46:42 -0000	1.1.1.2
+++ config.h	27 Mar 2006 05:28:09 -0000
@@ -73,6 +73,7 @@
 				* EAP Request-Identity */
 	size_t eap_req_id_text_len;
 	int eapol_key_index_workaround;
+	int eapol_version;
 
 	size_t default_wep_key_len;
 	int individual_wep_key_len;
Index: hostapd.conf
===================================================================
RCS file: /home/ncvs/src/contrib/hostapd/hostapd.conf,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 hostapd.conf
--- hostapd.conf	7 Mar 2006 05:46:50 -0000	1.1.1.2
+++ hostapd.conf	27 Mar 2006 05:28:09 -0000
@@ -106,6 +106,14 @@
 # Require IEEE 802.1X authorization
 #ieee8021x=1
 
+# IEEE 802.1X/EAPOL version
+# hostapd is implemented based on IEEE Std 802.1X-2004 which defines EAPOL
+# version 2. However, there are some clients that do not handle
+# the new version number correctly (they seem to drop the frames completely).
+# In order to make hostapd interoperate with these clients, the version number
+# can be set to the older version (1) with this configuration value.
+#eapol_version=2
+
 # Optional displayable message sent with EAP Request-Identity. The first \0
 # in this string will be converted to ASCII-0 (nul). This can be used to
 # separate network info (comma separated list of attribute=value pairs); see,
Index: ieee802_1x.c
===================================================================
RCS file: /home/ncvs/src/contrib/hostapd/ieee802_1x.c,v
retrieving revision 1.4
diff -u -r1.4 ieee802_1x.c
--- ieee802_1x.c	7 Mar 2006 05:51:52 -0000	1.4
+++ ieee802_1x.c	27 Mar 2006 05:28:10 -0000
@@ -76,7 +76,7 @@
 #endif
 
 	xhdr = (struct ieee802_1x_hdr *) buf;
-	xhdr->version = EAPOL_VERSION;
+	xhdr->version = hapd->conf->eapol_version;
 	xhdr->type = type;
 	xhdr->length = htons(datalen);
 
@@ -324,7 +324,7 @@
 
 	/* This header is needed here for HMAC-MD5, but it will be regenerated
 	 * in ieee802_1x_send() */
-	hdr->version = EAPOL_VERSION;
+	hdr->version = hapd->conf->eapol_version;
 	hdr->type = IEEE802_1X_TYPE_EAPOL_KEY;
 	hdr->length = htons(len);
 	hmac_md5(sm->eapol_key_sign, sm->eapol_key_sign_len,
@@ -1665,7 +1665,7 @@
 			"dot1xPaePortInitialize=%d\n"
 			"dot1xPaePortReauthenticate=FALSE\n",
 			sta->aid,
-			EAPOL_VERSION,
+			hapd->conf->eapol_version,
 			sm->initialize);
 
 	/* dot1xAuthConfigTable */
Index: wpa.c
===================================================================
RCS file: /home/ncvs/src/contrib/hostapd/wpa.c,v
retrieving revision 1.4
diff -u -r1.4 wpa.c
--- wpa.c	7 Mar 2006 05:51:52 -0000	1.4
+++ wpa.c	27 Mar 2006 05:28:12 -0000
@@ -1855,7 +1855,7 @@
 	if (hdr == NULL)
 		return;
 	memset(hdr, 0, len);
-	hdr->version = EAPOL_VERSION;
+	hdr->version = hapd->conf->eapol_version;
 	hdr->type = IEEE802_1X_TYPE_EAPOL_KEY;
 	hdr->length = htons(len  - sizeof(*hdr));
 	key = (struct wpa_eapol_key *) (hdr + 1);
OpenPOWER on IntegriCloud