1 |
alexxy 10/07/26 22:05:19 |
2 |
|
3 |
Added: wpa_supplicant-0.6.10-generate-libeap-peer.patch |
4 |
Log: |
5 |
[net-wireless/libeap] Initial import of standalone libeap for wimax. It always builds as 32bit app since wimax network service doesnt suport 64bit mode |
6 |
|
7 |
(Portage version: 2.2_rc67_p258/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-wireless/libeap/files/wpa_supplicant-0.6.10-generate-libeap-peer.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/libeap/files/wpa_supplicant-0.6.10-generate-libeap-peer.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-wireless/libeap/files/wpa_supplicant-0.6.10-generate-libeap-peer.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: wpa_supplicant-0.6.10-generate-libeap-peer.patch |
16 |
=================================================================== |
17 |
diff -urN wpa_supplicant-0.6.10.orig/src/eap_peer/eap_methods.c wpa_supplicant-0.6.10/src/eap_peer/eap_methods.c |
18 |
--- wpa_supplicant-0.6.10.orig/src/eap_peer/eap_methods.c 2010-01-12 17:55:02.000000000 +0300 |
19 |
+++ wpa_supplicant-0.6.10/src/eap_peer/eap_methods.c 2010-07-22 03:45:02.000000000 +0400 |
20 |
@@ -339,6 +339,146 @@ |
21 |
} |
22 |
|
23 |
|
24 |
+// ###################################################### |
25 |
+ |
26 |
+#ifdef EAP_MD5 |
27 |
+ int eap_peer_md5_register(void); |
28 |
+#endif /* EAP_MD5 */ |
29 |
+ |
30 |
+#ifdef EAP_TLS |
31 |
+ int eap_peer_tls_register(void); |
32 |
+#endif /* EAP_TLS */ |
33 |
+ |
34 |
+#ifdef EAP_MSCHAPv2 |
35 |
+ int eap_peer_mschapv2_register(void); |
36 |
+#endif /* EAP_MSCHAPv2 */ |
37 |
+ |
38 |
+#ifdef EAP_PEAP |
39 |
+ int eap_peer_peap_register(void); |
40 |
+#endif /* EAP_PEAP */ |
41 |
+ |
42 |
+#ifdef EAP_TTLS |
43 |
+ int eap_peer_ttls_register(void); |
44 |
+#endif /* EAP_TTLS */ |
45 |
+ |
46 |
+#ifdef EAP_GTC |
47 |
+ int eap_peer_gtc_register(void); |
48 |
+#endif /* EAP_GTC */ |
49 |
+ |
50 |
+#ifdef EAP_OTP |
51 |
+ int eap_peer_otp_register(void); |
52 |
+#endif /* EAP_OTP */ |
53 |
+ |
54 |
+#ifdef EAP_SIM |
55 |
+ int eap_peer_sim_register(void); |
56 |
+#endif /* EAP_SIM */ |
57 |
+ |
58 |
+#ifdef EAP_LEAP |
59 |
+ int eap_peer_leap_register(void); |
60 |
+#endif /* EAP_LEAP */ |
61 |
+ |
62 |
+#ifdef EAP_PSK |
63 |
+ int eap_peer_psk_register(void); |
64 |
+#endif /* EAP_PSK */ |
65 |
+ |
66 |
+#ifdef EAP_AKA |
67 |
+ int eap_peer_aka_register(void); |
68 |
+#endif /* EAP_AKA */ |
69 |
+ |
70 |
+#ifdef EAP_AKA_PRIME |
71 |
+ int eap_peer_aka_prime_register(void); |
72 |
+#endif /* EAP_AKA_PRIME */ |
73 |
+ |
74 |
+#ifdef EAP_FAST |
75 |
+ int eap_peer_fast_register(void); |
76 |
+#endif /* EAP_FAST */ |
77 |
+ |
78 |
+#ifdef EAP_PAX |
79 |
+ int eap_peer_pax_register(void); |
80 |
+#endif /* EAP_PAX */ |
81 |
+ |
82 |
+#ifdef EAP_SAKE |
83 |
+ int eap_peer_sake_register(void); |
84 |
+#endif /* EAP_SAKE */ |
85 |
+ |
86 |
+#ifdef EAP_GPSK |
87 |
+ int eap_peer_gpsk_register(void); |
88 |
+#endif /* EAP_GPSK */ |
89 |
+ |
90 |
+#ifdef EAP_WSC |
91 |
+ int eap_peer_wsc_register(void); |
92 |
+#endif /* EAP_WSC */ |
93 |
+ |
94 |
+#ifdef EAP_IKEV2 |
95 |
+ int eap_peer_ikev2_register(void); |
96 |
+#endif /* EAP_IKEV2 */ |
97 |
+ |
98 |
+#ifdef EAP_VENDOR_TEST |
99 |
+ int eap_peer_vendor_test_register(void); |
100 |
+#endif /* EAP_VENDOR_TEST */ |
101 |
+ |
102 |
+#ifdef EAP_TNC |
103 |
+ int eap_peer_tnc_register(void); |
104 |
+#endif |
105 |
+ |
106 |
+// ###################################################### |
107 |
+ |
108 |
+int eap_peer_set_method(int eap_method) |
109 |
+{ |
110 |
+ typedef int (*eap_method_register)(); |
111 |
+ |
112 |
+ static eap_method_register eap_method_register_funcs[] = |
113 |
+ { |
114 |
+ NULL, /* EAP_TYPE_NONE = 0, */ |
115 |
+ NULL, /* EAP_TYPE_IDENTITY */ |
116 |
+ NULL, /* EAP_TYPE_NOTIFICATION */ |
117 |
+ NULL, /* EAP_TYPE_NAK */ |
118 |
+#ifdef EAP_MD5 |
119 |
+ eap_peer_md5_register, |
120 |
+#else |
121 |
+ NULL, /* EAP_TYPE_MD5 */ |
122 |
+#endif |
123 |
+ NULL, // EAP_TYPE_OTP |
124 |
+ NULL, // EAP_TYPE_GTC |
125 |
+ NULL, // EAP_TYPE_LEAP |
126 |
+ NULL, // EAP_TYPE_SIM |
127 |
+ NULL, // EAP_TYPE_AKA |
128 |
+ |
129 |
+ NULL, // EAP_TYPE_PEAP |
130 |
+ NULL, // EAP_TYPE_MSCHAPV2 |
131 |
+ NULL, // EAP_TYPE_TLV |
132 |
+#ifdef EAP_TLS |
133 |
+ eap_peer_tls_register, |
134 |
+#else |
135 |
+ NULL, // EAP_TYPE_TLS |
136 |
+#endif |
137 |
+ NULL, // EAP_TYPE_TNC |
138 |
+ NULL, // EAP_TYPE_FAST |
139 |
+ NULL, // EAP_TYPE_PAX |
140 |
+ NULL, // EAP_TYPE_PSK |
141 |
+ NULL, // EAP_TYPE_SAKE |
142 |
+ NULL, // EAP_TYPE_IKEV2 |
143 |
+ NULL, // EAP_TYPE_AKA_PRIME |
144 |
+#ifdef EAP_TTLS |
145 |
+ eap_peer_ttls_register, |
146 |
+#else |
147 |
+ NULL, // EAP_TYPE_TTLS |
148 |
+#endif |
149 |
+ NULL // EAP_TYPE_GPSK |
150 |
+ |
151 |
+ }; |
152 |
+ |
153 |
+ |
154 |
+ if ( eap_method_register_funcs[eap_method] != NULL ) |
155 |
+ { |
156 |
+ eap_method_register_funcs[eap_method](); |
157 |
+ return 1; |
158 |
+ } |
159 |
+ else |
160 |
+ return -1; |
161 |
+} |
162 |
+ |
163 |
+ |
164 |
/** |
165 |
* eap_peer_register_methods - Register statically linked EAP peer methods |
166 |
* Returns: 0 on success, -1 on failure |
167 |
diff -urN wpa_supplicant-0.6.10.orig/src/eap_peer/libeap0.pc wpa_supplicant-0.6.10/src/eap_peer/libeap0.pc |
168 |
--- wpa_supplicant-0.6.10.orig/src/eap_peer/libeap0.pc 1970-01-01 03:00:00.000000000 +0300 |
169 |
+++ wpa_supplicant-0.6.10/src/eap_peer/libeap0.pc 2010-07-22 03:45:02.000000000 +0400 |
170 |
@@ -0,0 +1,10 @@ |
171 |
+prefix=/usr |
172 |
+exec_prefix=/usr |
173 |
+libdir=${exec_prefix}/lib |
174 |
+includedir=${prefix}/include/eap_peer |
175 |
+ |
176 |
+Name: libeap0 |
177 |
+Description: EAP Peer Library API |
178 |
+Version: 0.6.7 |
179 |
+Libs: -L${libdir} -leap |
180 |
+Cflags: -I${includedir} |
181 |
diff -urN wpa_supplicant-0.6.10.orig/src/eap_peer/Makefile wpa_supplicant-0.6.10/src/eap_peer/Makefile |
182 |
--- wpa_supplicant-0.6.10.orig/src/eap_peer/Makefile 2010-01-12 17:55:02.000000000 +0300 |
183 |
+++ wpa_supplicant-0.6.10/src/eap_peer/Makefile 2010-07-22 03:45:31.000000000 +0400 |
184 |
@@ -1,12 +1,179 @@ |
185 |
-all: |
186 |
- @echo Nothing to be made. |
187 |
+LIBEAP_NAME = libeap |
188 |
+LIBEAP_CURRENT = 0 |
189 |
+LIBEAP_REVISION = 0 |
190 |
+LIBEAP_AGE = 0 |
191 |
+ |
192 |
+LIBEAP = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT).$(LIBEAP_REVISION).$(LIBEAP_AGE) |
193 |
+LIBEAP_SO = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT) |
194 |
+ |
195 |
+.PHONY: all clean install uninstall |
196 |
+ |
197 |
+all: $(LIBEAP) |
198 |
+ |
199 |
+ifndef CC |
200 |
+CC=gcc |
201 |
+endif |
202 |
+ |
203 |
+ifndef CFLAGS |
204 |
+CFLAGS = -MMD -O2 -Wall -g |
205 |
+endif |
206 |
+ |
207 |
+CFLAGS += -fPIC |
208 |
+ |
209 |
+CONFIG_TLS=openssl |
210 |
+ |
211 |
+INCLUDE_INSTALL_DIR=/usr/include/eap_peer |
212 |
+ |
213 |
+CFLAGS += -I. |
214 |
+CFLAGS += -I .. |
215 |
+CFLAGS += -I ../crypto |
216 |
+CFLAGS += -I ../utils |
217 |
+CFLAGS += -I ../common |
218 |
+ |
219 |
+# at least for now, need to include config_ssid.h and config_blob.h from |
220 |
+# wpa_supplicant directory |
221 |
+CFLAGS += -I ../../wpa_supplicant |
222 |
+ |
223 |
+OBJS_both += ../utils/common.o |
224 |
+OBJS_both += ../utils/os_unix.o |
225 |
+OBJS_both += ../utils/wpa_debug.o |
226 |
+OBJS_both += ../utils/base64.o |
227 |
+OBJS_both += ../utils/wpabuf.o |
228 |
+OBJS_both += ../crypto/md5.o |
229 |
+OBJS_both += ../crypto/rc4.o |
230 |
+OBJS_both += ../crypto/md4.o |
231 |
+OBJS_both += ../crypto/sha1.o |
232 |
+OBJS_both += ../crypto/des.o |
233 |
+OBJS_both += ../crypto/aes_wrap.o |
234 |
+OBJS_both += ../crypto/aes.o |
235 |
+OBJS_both += ../crypto/ms_funcs.o |
236 |
+OBJS_both += ../crypto/sha256.o |
237 |
+ |
238 |
+ |
239 |
+OBJS_both += ../eap_common/eap_peap_common.o |
240 |
+OBJS_both += ../eap_common/eap_psk_common.o |
241 |
+OBJS_both += ../eap_common/eap_pax_common.o |
242 |
+OBJS_both += ../eap_common/eap_sake_common.o |
243 |
+OBJS_both += ../eap_common/eap_gpsk_common.o |
244 |
+OBJS_both += ../eap_common/chap.o |
245 |
+ |
246 |
+OBJS_peer += ../eap_peer/eap_tls.o |
247 |
+OBJS_peer += ../eap_peer/eap_peap.o |
248 |
+OBJS_peer += ../eap_peer/eap_ttls.o |
249 |
+OBJS_peer += ../eap_peer/eap_md5.o |
250 |
+OBJS_peer += ../eap_peer/eap_mschapv2.o |
251 |
+OBJS_peer += ../eap_peer/mschapv2.o |
252 |
+OBJS_peer += ../eap_peer/eap_otp.o |
253 |
+OBJS_peer += ../eap_peer/eap_gtc.o |
254 |
+OBJS_peer += ../eap_peer/eap_leap.o |
255 |
+OBJS_peer += ../eap_peer/eap_psk.o |
256 |
+OBJS_peer += ../eap_peer/eap_pax.o |
257 |
+OBJS_peer += ../eap_peer/eap_sake.o |
258 |
+OBJS_peer += ../eap_peer/eap_gpsk.o |
259 |
+OBJS_peer += ../eap_peer/eap.o |
260 |
+OBJS_peer += ../eap_common/eap_common.o |
261 |
+OBJS_peer += ../eap_peer/eap_methods.o |
262 |
+OBJS_peer += ../eap_peer/eap_tls_common.o |
263 |
+ |
264 |
+CFLAGS += -DEAP_TLS |
265 |
+CFLAGS += -DEAP_PEAP |
266 |
+CFLAGS += -DEAP_TTLS |
267 |
+CFLAGS += -DEAP_MD5 |
268 |
+CFLAGS += -DEAP_MSCHAPv2 |
269 |
+CFLAGS += -DEAP_GTC |
270 |
+CFLAGS += -DEAP_OTP |
271 |
+CFLAGS += -DEAP_LEAP |
272 |
+CFLAGS += -DEAP_PSK |
273 |
+CFLAGS += -DEAP_PAX |
274 |
+CFLAGS += -DEAP_SAKE |
275 |
+CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256 |
276 |
+CFLAGS += -DEAP_TLS_FUNCS |
277 |
+ |
278 |
+CFLAGS += -DIEEE8021X_EAPOL |
279 |
+ |
280 |
+ifeq ($(CONFIG_TLS), openssl) |
281 |
+CFLAGS += -DEAP_TLS_OPENSSL |
282 |
+OBJS_both += ../crypto/tls_openssl.o |
283 |
+OBJS_both += ../crypto/crypto_openssl.o |
284 |
+LIBS += -lssl -lcrypto |
285 |
+CFLAGS += -DINTERNAL_SHA256 |
286 |
+endif |
287 |
+ |
288 |
+ifeq ($(CONFIG_TLS), internal) |
289 |
+OBJS_both += ../crypto/tls_internal.o |
290 |
+OBJS_both += ../tls/tlsv1_common.o ../../tls/tlsv1_record.o |
291 |
+OBJS_both += ../tls/tlsv1_cred.o |
292 |
+OBJS_both += ../tls/asn1.o ../../tls/x509v3.o |
293 |
+OBJS_both += ../crypto/crypto_internal.o ../../tls/rsa.o ../../tls/bignum.o |
294 |
+ |
295 |
+OBJS_peer += ../tls/tlsv1_client.o |
296 |
+OBJS_peer += ../tls/tlsv1_client_write.o ../../tls/tlsv1_client_read.o |
297 |
+CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT |
298 |
+ |
299 |
+OBJS_server += ../tls/tlsv1_server.o |
300 |
+OBJS_server += ../tls/tlsv1_server_write.o ../../tls/tlsv1_server_read.o |
301 |
+CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER |
302 |
+ |
303 |
+CFLAGS += -DCONFIG_TLS_INTERNAL |
304 |
+CFLAGS += -DCONFIG_CRYPTO_INTERNAL |
305 |
+CFLAGS += -DCONFIG_INTERNAL_X509 |
306 |
+CFLAGS += -DINTERNAL_AES |
307 |
+CFLAGS += -DINTERNAL_SHA1 |
308 |
+CFLAGS += -DINTERNAL_SHA256 |
309 |
+CFLAGS += -DINTERNAL_MD5 |
310 |
+CFLAGS += -DINTERNAL_MD4 |
311 |
+CFLAGS += -DINTERNAL_DES |
312 |
+ifdef CONFIG_INTERNAL_LIBTOMMATH |
313 |
+CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH |
314 |
+else |
315 |
+LIBS += -ltommath |
316 |
+endif |
317 |
+endif |
318 |
+ |
319 |
+ifndef LDO |
320 |
+LDO=$(CC) |
321 |
+endif |
322 |
+ |
323 |
+ |
324 |
+OBJS_lib=$(OBJS_both) $(OBJS_peer) |
325 |
+ |
326 |
+ #$(OBJS_server) |
327 |
+ |
328 |
+CFLAGS += -fPIC -DPIC |
329 |
+LDFLAGS += -shared |
330 |
+ |
331 |
+$(LIBEAP): $(OBJS_lib) |
332 |
+ $(LDO) $(LDFLAGS) $(OBJS_lib) -Wl,-soname -Wl,$(LIBEAP_SO) -o $(LIBEAP) $(LIBS) |
333 |
+ |
334 |
+ |
335 |
+INCLUDE_HEADERS = ../utils/includes.h ../utils/common.h eap.h ../common/defs.h ../eap_common/eap_defs.h eap_methods.h eap_config.h ../utils/wpabuf.h ../crypto/tls.h ../utils/build_config.h ../utils/os.h ../utils/wpa_debug.h |
336 |
+ |
337 |
+install: |
338 |
+ |
339 |
+ mkdir -p $(DESTDIR)/usr/lib |
340 |
+# copy the lib file to std lib location |
341 |
+ cp $(LIBEAP) $(DESTDIR)/usr/lib |
342 |
+ |
343 |
+# copy the headers reqd by apps using eap peer library in its own subfolder under /usr/include |
344 |
+ test -z $(DESTDIR)/$(INCLUDE_INSTALL_DIR) || mkdir -p $(DESTDIR)/$(INCLUDE_INSTALL_DIR) |
345 |
+ |
346 |
+# the header folder structure needs to be preserved. |
347 |
+ test -z $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common || mkdir -p $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common |
348 |
+ |
349 |
+ cp $(INCLUDE_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR) |
350 |
+ |
351 |
+ mv $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_defs.h $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common |
352 |
+ |
353 |
+ mkdir -p $(DESTDIR)/usr/lib/pkgconfig |
354 |
+ cp libeap0.pc $(DESTDIR)/usr/lib/pkgconfig |
355 |
+ |
356 |
+uninstall: |
357 |
+ |
358 |
+ rm $(DESTDIR)/usr/lib/$(LIBEAP) |
359 |
+ rm -fr $(DESTDIR)/$(INCLUDE_INSTALL_DIR) |
360 |
+ rm -f $(DESTDIR)/usr/lib/pkgconfig/libeap0.pc |
361 |
|
362 |
clean: |
363 |
- for d in $(SUBDIRS); do make -C $$d clean; done |
364 |
- rm -f *~ *.o *.so *.d |
365 |
+ rm -f core *~ *.o *.d libeap.a $(LIBEAP) |
366 |
|
367 |
-install: |
368 |
- if ls *.so >/dev/null 2>&1; then \ |
369 |
- install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \ |
370 |
- cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \ |
371 |
- ; fi |
372 |
+-include $(OBJS:%.o=%.d) |
373 |
diff -urN wpa_supplicant-0.6.10.orig/wpa_supplicant/Makefile wpa_supplicant-0.6.10/wpa_supplicant/Makefile |
374 |
--- wpa_supplicant-0.6.10.orig/wpa_supplicant/Makefile 2010-01-12 17:55:02.000000000 +0300 |
375 |
+++ wpa_supplicant-0.6.10/wpa_supplicant/Makefile 2010-07-22 04:04:36.000000000 +0400 |
376 |
@@ -6,6 +6,8 @@ |
377 |
CFLAGS = -MMD -O2 -Wall -g |
378 |
endif |
379 |
|
380 |
+CFLAGS += -fPIC |
381 |
+ |
382 |
export LIBDIR ?= /usr/local/lib/ |
383 |
export BINDIR ?= /usr/local/sbin/ |
384 |
|
385 |
@@ -17,7 +19,7 @@ |
386 |
|
387 |
ALL=wpa_supplicant wpa_passphrase wpa_cli |
388 |
|
389 |
-all: verify_config $(ALL) dynamic_eap_methods |
390 |
+all: verify_config $(ALL) dynamic_eap_methods eap_peer_lib |
391 |
|
392 |
verify_config: |
393 |
@if [ ! -r .config ]; then \ |
394 |
@@ -1102,6 +1104,9 @@ |
395 |
wpa_cli: $(OBJS_c) |
396 |
$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) |
397 |
|
398 |
+eap_peer_lib: |
399 |
+ $(MAKE) -C ../src/eap_peer |
400 |
+ |
401 |
link_test: $(OBJS) $(OBJS_h) tests/link_test.o |
402 |
$(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS) |