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