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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
diff -ur a/wpa_supplicant-2.4/src/eap_peer/Makefile b/wpa_supplicant-2.4/src/eap_peer/Makefile
--- a/wpa_supplicant-2.4/src/eap_peer/Makefile 2015-03-15 19:30:39.000000000 -0200
+++ b/wpa_supplicant-2.4/src/eap_peer/Makefile 2015-04-26 14:40:49.987453098 -0200
@@ -1,11 +1,192 @@
-all:
- @echo Nothing to be made.
+LIBEAP_NAME = libeap
+LIBEAP_CURRENT = 0
+LIBEAP_REVISION = 0
+LIBEAP_AGE = 0
+
+LIBEAP = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT).$(LIBEAP_REVISION).$(LIBEAP_AGE)
+LIBEAP_SO = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT)
+
+.PHONY: all clean install uninstall
+
+all: $(LIBEAP)
+
+ifndef CC
+CC=gcc
+endif
+
+ifndef CFLAGS
+CFLAGS = -MMD -O0 -Wall -g
+endif
+
+CONFIG_TLS=openssl
+
+INCLUDE_INSTALL_DIR=/usr/include/eap_peer
+
+# Got to use override all across the board, otherwise a 'make
+# CFLAGS=XX' will kill us because the command line's CFLAGS will
+# overwrite Make's and we'll loose all the infrastructure it sets.
+override CFLAGS += -I. -I.. -I../crypto -I../utils -I../common
+
+# at least for now, need to include config_ssid.h and config_blob.h from
+# wpa_supplicant directory
+override CFLAGS += -I ../../wpa_supplicant
+
+OBJS_both += ../utils/common.o
+OBJS_both += ../utils/os_unix.o
+OBJS_both += ../utils/wpa_debug.o
+OBJS_both += ../utils/base64.o
+OBJS_both += ../utils/wpabuf.o
+OBJS_both += ../utils/eloop.o
+ifneq ($(CONFIG_TLS), openssl)
+OBJS_both += ../crypto/md5.o
+OBJS_both += ../crypto/sha1.o
+endif
+OBJS_both += ../crypto/sha1-tlsprf.o
+OBJS_both += ../crypto/aes-encblock.o
+ifneq ($(CONFIG_TLS), openssl)
+OBJS_both += ../crypto/aes-wrap.o
+endif
+OBJS_both += ../crypto/aes-ctr.o
+OBJS_both += ../crypto/aes-eax.o
+OBJS_both += ../crypto/aes-omac1.o
+OBJS_both += ../crypto/ms_funcs.o
+OBJS_both += ../crypto/sha256.o
+OBJS_both += ../crypto/random.o
+
+
+OBJS_both += ../eap_common/eap_peap_common.o
+OBJS_both += ../eap_common/eap_psk_common.o
+OBJS_both += ../eap_common/eap_pax_common.o
+OBJS_both += ../eap_common/eap_sake_common.o
+OBJS_both += ../eap_common/eap_gpsk_common.o
+OBJS_both += ../eap_common/chap.o
+
+OBJS_peer += ../eap_peer/eap_tls.o
+OBJS_peer += ../eap_peer/eap_peap.o
+OBJS_peer += ../eap_peer/eap_ttls.o
+OBJS_peer += ../eap_peer/eap_md5.o
+OBJS_peer += ../eap_peer/eap_mschapv2.o
+OBJS_peer += ../eap_peer/mschapv2.o
+OBJS_peer += ../eap_peer/eap_otp.o
+OBJS_peer += ../eap_peer/eap_gtc.o
+OBJS_peer += ../eap_peer/eap_leap.o
+OBJS_peer += ../eap_peer/eap_psk.o
+OBJS_peer += ../eap_peer/eap_pax.o
+OBJS_peer += ../eap_peer/eap_sake.o
+OBJS_peer += ../eap_peer/eap_gpsk.o
+OBJS_peer += ../eap_peer/eap.o
+OBJS_peer += ../eap_common/eap_common.o
+OBJS_peer += ../eap_peer/eap_methods.o
+OBJS_peer += ../eap_peer/eap_tls_common.o
+
+override CFLAGS += -DEAP_TLS
+override CFLAGS += -DEAP_PEAP
+override CFLAGS += -DEAP_TTLS
+override CFLAGS += -DEAP_MD5
+override CFLAGS += -DEAP_MSCHAPv2
+override CFLAGS += -DEAP_GTC
+override CFLAGS += -DEAP_OTP
+override CFLAGS += -DEAP_LEAP
+override CFLAGS += -DEAP_PSK
+override CFLAGS += -DEAP_PAX
+override CFLAGS += -DEAP_SAKE
+override CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
+override CFLAGS += -DEAP_TLS_FUNCS
+
+override CFLAGS += -DIEEE8021X_EAPOL
+
+ifeq ($(CONFIG_TLS), openssl)
+override CFLAGS += -DEAP_TLS_OPENSSL
+OBJS_both += ../crypto/tls_openssl.o
+OBJS_both += ../crypto/crypto_openssl.o
+LIBS += -lssl -lcrypto
+override CFLAGS += -DINTERNAL_SHA256
+endif
+
+ifeq ($(CONFIG_TLS), internal)
+OBJS_both += ../crypto/tls_internal.o
+OBJS_both += ../tls/tlsv1_common.o ../../tls/tlsv1_record.o
+OBJS_both += ../tls/tlsv1_cred.o
+OBJS_both += ../tls/asn1.o ../../tls/x509v3.o
+OBJS_both += ../crypto/crypto_internal.o ../../tls/rsa.o ../../tls/bignum.o
+
+OBJS_peer += ../tls/tlsv1_client.o
+OBJS_peer += ../tls/tlsv1_client_write.o ../../tls/tlsv1_client_read.o
+override CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
+
+OBJS_server += ../tls/tlsv1_server.o
+OBJS_server += ../tls/tlsv1_server_write.o ../../tls/tlsv1_server_read.o
+override CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
+
+override CFLAGS += -DCONFIG_TLS_INTERNAL
+override CFLAGS += -DCONFIG_CRYPTO_INTERNAL
+override CFLAGS += -DCONFIG_INTERNAL_X509
+override CFLAGS += -DINTERNAL_AES
+override CFLAGS += -DINTERNAL_SHA1
+override CFLAGS += -DINTERNAL_SHA256
+override CFLAGS += -DINTERNAL_MD5
+override CFLAGS += -DINTERNAL_MD4
+override CFLAGS += -DINTERNAL_DES
+ifdef CONFIG_INTERNAL_LIBTOMMATH
+override CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
+else
+LIBS += -ltommath
+endif
+endif
+
+ifndef LDO
+LDO=$(CC)
+endif
+
+
+OBJS_lib=$(OBJS_both) $(OBJS_peer)
+
+ #$(OBJS_server)
+
+override CFLAGS += -fPIC -DPIC
+LDFLAGS += -shared
+
+$(LIBEAP): $(OBJS_lib)
+ $(LDO) $(LDFLAGS) $(OBJS_lib) -Wl,-soname -Wl,$(LIBEAP_SO) -o $(LIBEAP) $(LIBS)
+
+
+UTIL_HEADERS = ../utils/includes.h ../utils/common.h \
+ ../utils/wpabuf.h ../utils/build_config.h \
+ ../utils/os.h ../utils/wpa_debug.h
+COMMON_HEADERS = ../common/defs.h
+EAP_COMMON_HEADERS = ../eap_common/eap_defs.h
+MAIN_HEADERS = eap.h eap_methods.h eap_config.h
+CRYPTO_HEADERS = ../crypto/tls.h
+
+install:
+
+ mkdir -p $(DESTDIR)/usr/lib
+# copy the lib file to std lib location
+ cp $(LIBEAP) $(DESTDIR)/usr/lib
+ ln -fs $(LIBEAP_SO) $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so
+ ln -fs $(LIBEAP_NAME).so.0.0.0 $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so.0
+
+# copy the headers reqd by apps using eap peer library in its own subfolder under /usr/include
+ mkdir -p \
+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common \
+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common \
+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util \
+ $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
+ install -m 0644 $(EAP_COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common
+ install -m 0644 $(COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common
+ install -m 0644 $(CRYPTO_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
+ install -m 0644 $(UTIL_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util
+ install -m 0644 $(MAIN_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/
+
+ mkdir -p $(DESTDIR)/usr/lib/pkgconfig
+ cp libeap0.pc $(DESTDIR)/usr/lib/pkgconfig
+
+uninstall:
+
+ rm $(DESTDIR)/usr/lib/$(LIBEAP)
+ rm -fr $(DESTDIR)/$(INCLUDE_INSTALL_DIR)
+ rm -f $(DESTDIR)/usr/lib/pkgconfig/libeap0.pc
clean:
- rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov
+ rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov libeap.a $(LIBEAP) $(OBJS_lib)
-install:
- if ls *.so >/dev/null 2>&1; then \
- install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \
- cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \
- ; fi
diff -ur a/wpa_supplicant-2.4/src/eap_peer/eap_methods.c b/wpa_supplicant-2.4/src/eap_peer/eap_methods.c
--- a/wpa_supplicant-2.4/src/eap_peer/eap_methods.c 2015-03-15 19:30:39.000000000 -0200
+++ b/wpa_supplicant-2.4/src/eap_peer/eap_methods.c 2015-04-26 14:39:58.247099942 -0200
@@ -336,6 +336,120 @@
/**
+ * eap_peer_register_methods - Register all known EAP peer methods
+ *
+ * This function is called at program start to register all compiled
+ * in EAP peer methods.
+ */
+int eap_peer_register_methods(void)
+{
+ int ret = 0;
+
+#ifdef EAP_MD5
+ if (ret == 0)
+ ret = eap_peer_md5_register();
+#endif /* EAP_MD5 */
+
+#ifdef EAP_TLS
+ if (ret == 0)
+ ret = eap_peer_tls_register();
+#endif /* EAP_TLS */
+
+#ifdef EAP_MSCHAPv2
+ if (ret == 0)
+ ret = eap_peer_mschapv2_register();
+#endif /* EAP_MSCHAPv2 */
+
+#ifdef EAP_PEAP
+ if (ret == 0)
+ ret = eap_peer_peap_register();
+#endif /* EAP_PEAP */
+
+#ifdef EAP_TTLS
+ if (ret == 0)
+ ret = eap_peer_ttls_register();
+#endif /* EAP_TTLS */
+
+#ifdef EAP_GTC
+ if (ret == 0)
+ ret = eap_peer_gtc_register();
+#endif /* EAP_GTC */
+
+#ifdef EAP_OTP
+ if (ret == 0)
+ ret = eap_peer_otp_register();
+#endif /* EAP_OTP */
+
+#ifdef EAP_SIM
+ if (ret == 0)
+ ret = eap_peer_sim_register();
+#endif /* EAP_SIM */
+
+#ifdef EAP_LEAP
+ if (ret == 0)
+ ret = eap_peer_leap_register();
+#endif /* EAP_LEAP */
+
+#ifdef EAP_PSK
+ if (ret == 0)
+ ret = eap_peer_psk_register();
+#endif /* EAP_PSK */
+
+#ifdef EAP_AKA
+ if (ret == 0)
+ ret = eap_peer_aka_register();
+#endif /* EAP_AKA */
+
+#ifdef EAP_AKA_PRIME
+ if (ret == 0)
+ ret = eap_peer_aka_prime_register();
+#endif /* EAP_AKA_PRIME */
+
+#ifdef EAP_FAST
+ if (ret == 0)
+ ret = eap_peer_fast_register();
+#endif /* EAP_FAST */
+
+#ifdef EAP_PAX
+ if (ret == 0)
+ ret = eap_peer_pax_register();
+#endif /* EAP_PAX */
+
+#ifdef EAP_SAKE
+ if (ret == 0)
+ ret = eap_peer_sake_register();
+#endif /* EAP_SAKE */
+
+#ifdef EAP_GPSK
+ if (ret == 0)
+ ret = eap_peer_gpsk_register();
+#endif /* EAP_GPSK */
+
+#ifdef EAP_WSC
+ if (ret == 0)
+ ret = eap_peer_wsc_register();
+#endif /* EAP_WSC */
+
+#ifdef EAP_IKEV2
+ if (ret == 0)
+ ret = eap_peer_ikev2_register();
+#endif /* EAP_IKEV2 */
+
+#ifdef EAP_VENDOR_TEST
+ if (ret == 0)
+ ret = eap_peer_vendor_test_register();
+#endif /* EAP_VENDOR_TEST */
+
+#ifdef EAP_TNC
+ if (ret == 0)
+ ret = eap_peer_tnc_register();
+#endif /* EAP_TNC */
+
+ return ret;
+}
+
+
+/**
* eap_peer_unregister_methods - Unregister EAP peer methods
*
* This function is called at program termination to unregister all EAP peer
Only in b/wpa_supplicant-2.4/src/eap_peer: eap_methods.c.orig
diff -ur a/wpa_supplicant-2.4/src/eap_peer/eap_methods.h b/wpa_supplicant-2.4/src/eap_peer/eap_methods.h
--- a/wpa_supplicant-2.4/src/eap_peer/eap_methods.h 2015-03-15 19:30:39.000000000 -0200
+++ b/wpa_supplicant-2.4/src/eap_peer/eap_methods.h 2015-04-26 14:39:58.248099929 -0200
@@ -26,6 +26,7 @@
const char * eap_get_name(int vendor, EapType type);
size_t eap_get_names(char *buf, size_t buflen);
char ** eap_get_names_as_string_array(size_t *num);
+int eap_peer_register_methods(void);
void eap_peer_unregister_methods(void);
#else /* IEEE8021X_EAPOL */
Only in b/wpa_supplicant-2.4/src/eap_peer: eap_methods.h.orig
Only in b/wpa_supplicant-2.4/src/eap_peer: libeap0.pc
|