Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 544036 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/eap_peer/eap_methods.c (+114 lines)
Lines 342-347 int eap_peer_method_register(struct eap_ Link Here
342
342
343
343
344
/**
344
/**
345
 * eap_peer_register_methods - Register all known EAP peer methods
346
 *
347
 * This function is called at program start to register all compiled
348
 * in EAP peer methods.
349
 */
350
int eap_peer_register_methods(void)
351
{
352
	int ret = 0;
353
354
#ifdef EAP_MD5
355
	if (ret == 0)
356
		ret = eap_peer_md5_register();
357
#endif /* EAP_MD5 */
358
359
#ifdef EAP_TLS
360
	if (ret == 0)
361
		ret = eap_peer_tls_register();
362
#endif /* EAP_TLS */
363
364
#ifdef EAP_MSCHAPv2
365
	if (ret == 0)
366
		ret = eap_peer_mschapv2_register();
367
#endif /* EAP_MSCHAPv2 */
368
369
#ifdef EAP_PEAP
370
	if (ret == 0)
371
		ret = eap_peer_peap_register();
372
#endif /* EAP_PEAP */
373
374
#ifdef EAP_TTLS
375
	if (ret == 0)
376
		ret = eap_peer_ttls_register();
377
#endif /* EAP_TTLS */
378
379
#ifdef EAP_GTC
380
	if (ret == 0)
381
		ret = eap_peer_gtc_register();
382
#endif /* EAP_GTC */
383
384
#ifdef EAP_OTP
385
	if (ret == 0)
386
		ret = eap_peer_otp_register();
387
#endif /* EAP_OTP */
388
389
#ifdef EAP_SIM
390
	if (ret == 0)
391
		ret = eap_peer_sim_register();
392
#endif /* EAP_SIM */
393
394
#ifdef EAP_LEAP
395
	if (ret == 0)
396
		ret = eap_peer_leap_register();
397
#endif /* EAP_LEAP */
398
399
#ifdef EAP_PSK
400
	if (ret == 0)
401
		ret = eap_peer_psk_register();
402
#endif /* EAP_PSK */
403
404
#ifdef EAP_AKA
405
	if (ret == 0)
406
		ret = eap_peer_aka_register();
407
#endif /* EAP_AKA */
408
409
#ifdef EAP_AKA_PRIME
410
	if (ret == 0)
411
		ret = eap_peer_aka_prime_register();
412
#endif /* EAP_AKA_PRIME */
413
414
#ifdef EAP_FAST
415
	if (ret == 0)
416
		ret = eap_peer_fast_register();
417
#endif /* EAP_FAST */
418
419
#ifdef EAP_PAX
420
	if (ret == 0)
421
		ret = eap_peer_pax_register();
422
#endif /* EAP_PAX */
423
424
#ifdef EAP_SAKE
425
	if (ret == 0)
426
		ret = eap_peer_sake_register();
427
#endif /* EAP_SAKE */
428
429
#ifdef EAP_GPSK
430
	if (ret == 0)
431
		ret = eap_peer_gpsk_register();
432
#endif /* EAP_GPSK */
433
434
#ifdef EAP_WSC
435
	if (ret == 0)
436
		ret = eap_peer_wsc_register();
437
#endif /* EAP_WSC */
438
439
#ifdef EAP_IKEV2
440
	if (ret == 0)
441
		ret = eap_peer_ikev2_register();
442
#endif /* EAP_IKEV2 */
443
444
#ifdef EAP_VENDOR_TEST
445
	if (ret == 0)
446
		ret = eap_peer_vendor_test_register();
447
#endif /* EAP_VENDOR_TEST */
448
449
#ifdef EAP_TNC
450
	if (ret == 0)
451
		ret = eap_peer_tnc_register();
452
#endif /* EAP_TNC */
453
454
	return ret;
455
}
456
457
458
/**
345
 * eap_peer_unregister_methods - Unregister EAP peer methods
459
 * eap_peer_unregister_methods - Unregister EAP peer methods
346
 *
460
 *
347
 * This function is called at program termination to unregister all EAP peer
461
 * This function is called at program termination to unregister all EAP peer
(-)a/src/eap_peer/eap_methods.h (+1 lines)
Lines 32-37 EapType eap_peer_get_type(const char *na Link Here
32
const char * eap_get_name(int vendor, EapType type);
32
const char * eap_get_name(int vendor, EapType type);
33
size_t eap_get_names(char *buf, size_t buflen);
33
size_t eap_get_names(char *buf, size_t buflen);
34
char ** eap_get_names_as_string_array(size_t *num);
34
char ** eap_get_names_as_string_array(size_t *num);
35
int eap_peer_register_methods(void);
35
void eap_peer_unregister_methods(void);
36
void eap_peer_unregister_methods(void);
36
37
37
#else /* IEEE8021X_EAPOL */
38
#else /* IEEE8021X_EAPOL */
(-)a/src/eap_peer/libeap0.pc (+10 lines)
Line 0 Link Here
1
prefix=/usr
2
exec_prefix=/usr
3
libdir=${exec_prefix}/lib
4
includedir=${prefix}/include/eap_peer
5
6
Name: libeap0
7
Description: EAP Peer Library API
8
Version: 0.7.2
9
Libs: -L${libdir} -leap
10
Cflags: -I${includedir}
(-)a/src/eap_peer/Makefile (-8 / +187 lines)
Lines 1-11 Link Here
1
all:
1
LIBEAP_NAME = libeap
2
	@echo Nothing to be made.
2
LIBEAP_CURRENT = 0
3
LIBEAP_REVISION = 0
4
LIBEAP_AGE = 0
5
6
LIBEAP = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT).$(LIBEAP_REVISION).$(LIBEAP_AGE)
7
LIBEAP_SO = $(LIBEAP_NAME).so.$(LIBEAP_CURRENT)
8
9
.PHONY: all clean install uninstall
10
11
all: $(LIBEAP)
12
13
ifndef CC
14
CC=gcc
15
endif
16
17
ifndef CFLAGS
18
CFLAGS = -MMD -O0 -Wall -g
19
endif
20
21
CONFIG_TLS=openssl
22
23
INCLUDE_INSTALL_DIR=/usr/include/eap_peer
24
25
# Got to use override all across the board, otherwise a 'make
26
# CFLAGS=XX' will kill us because the command line's CFLAGS will
27
# overwrite Make's and we'll loose all the infrastructure it sets.
28
override CFLAGS += -I. -I.. -I../crypto -I../utils -I../common
29
30
# at least for now, need to include config_ssid.h and config_blob.h from
31
# wpa_supplicant directory
32
override CFLAGS += -I ../../wpa_supplicant
33
34
OBJS_both += ../utils/common.o
35
OBJS_both += ../utils/os_unix.o
36
OBJS_both += ../utils/wpa_debug.o
37
OBJS_both += ../utils/base64.o
38
OBJS_both += ../utils/wpabuf.o
39
ifneq ($(CONFIG_TLS), openssl)
40
OBJS_both += ../crypto/md5.o
41
OBJS_both += ../crypto/sha1.o
42
endif
43
OBJS_both += ../crypto/sha1-tlsprf.o
44
OBJS_both += ../crypto/aes-encblock.o
45
ifneq ($(CONFIG_TLS), openssl)
46
OBJS_both += ../crypto/aes-wrap.o
47
endif
48
OBJS_both += ../crypto/aes-ctr.o
49
OBJS_both += ../crypto/aes-eax.o
50
OBJS_both += ../crypto/aes-omac1.o
51
OBJS_both += ../crypto/ms_funcs.o
52
OBJS_both += ../crypto/sha256.o
53
54
55
OBJS_both += ../eap_common/eap_peap_common.o
56
OBJS_both += ../eap_common/eap_psk_common.o
57
OBJS_both += ../eap_common/eap_pax_common.o
58
OBJS_both += ../eap_common/eap_sake_common.o
59
OBJS_both += ../eap_common/eap_gpsk_common.o
60
OBJS_both += ../eap_common/chap.o
61
62
OBJS_peer += ../eap_peer/eap_tls.o
63
OBJS_peer += ../eap_peer/eap_peap.o
64
OBJS_peer += ../eap_peer/eap_ttls.o
65
OBJS_peer += ../eap_peer/eap_md5.o
66
OBJS_peer += ../eap_peer/eap_mschapv2.o
67
OBJS_peer += ../eap_peer/mschapv2.o
68
OBJS_peer += ../eap_peer/eap_otp.o
69
OBJS_peer += ../eap_peer/eap_gtc.o
70
OBJS_peer += ../eap_peer/eap_leap.o
71
OBJS_peer += ../eap_peer/eap_psk.o
72
OBJS_peer += ../eap_peer/eap_pax.o
73
OBJS_peer += ../eap_peer/eap_sake.o
74
OBJS_peer += ../eap_peer/eap_gpsk.o
75
OBJS_peer += ../eap_peer/eap.o
76
OBJS_peer += ../eap_common/eap_common.o
77
OBJS_peer += ../eap_peer/eap_methods.o
78
OBJS_peer += ../eap_peer/eap_tls_common.o
79
80
override CFLAGS += -DEAP_TLS
81
override CFLAGS += -DEAP_PEAP
82
override CFLAGS += -DEAP_TTLS
83
override CFLAGS += -DEAP_MD5
84
override CFLAGS += -DEAP_MSCHAPv2
85
override CFLAGS += -DEAP_GTC
86
override CFLAGS += -DEAP_OTP
87
override CFLAGS += -DEAP_LEAP
88
override CFLAGS += -DEAP_PSK
89
override CFLAGS += -DEAP_PAX
90
override CFLAGS += -DEAP_SAKE
91
override CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
92
override CFLAGS += -DEAP_TLS_FUNCS
93
94
override CFLAGS += -DIEEE8021X_EAPOL
95
96
ifeq ($(CONFIG_TLS), openssl)
97
override CFLAGS += -DEAP_TLS_OPENSSL
98
OBJS_both += ../crypto/tls_openssl.o
99
OBJS_both += ../crypto/crypto_openssl.o
100
LIBS += -lssl -lcrypto
101
override CFLAGS += -DINTERNAL_SHA256
102
endif
103
104
ifeq ($(CONFIG_TLS), internal)
105
OBJS_both += ../crypto/tls_internal.o
106
OBJS_both += ../tls/tlsv1_common.o ../../tls/tlsv1_record.o
107
OBJS_both += ../tls/tlsv1_cred.o
108
OBJS_both += ../tls/asn1.o ../../tls/x509v3.o
109
OBJS_both += ../crypto/crypto_internal.o ../../tls/rsa.o ../../tls/bignum.o
110
111
OBJS_peer += ../tls/tlsv1_client.o
112
OBJS_peer += ../tls/tlsv1_client_write.o ../../tls/tlsv1_client_read.o
113
override CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
114
115
OBJS_server += ../tls/tlsv1_server.o
116
OBJS_server += ../tls/tlsv1_server_write.o ../../tls/tlsv1_server_read.o
117
override CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
118
119
override CFLAGS += -DCONFIG_TLS_INTERNAL
120
override CFLAGS += -DCONFIG_CRYPTO_INTERNAL
121
override CFLAGS += -DCONFIG_INTERNAL_X509
122
override CFLAGS += -DINTERNAL_AES
123
override CFLAGS += -DINTERNAL_SHA1
124
override CFLAGS += -DINTERNAL_SHA256
125
override CFLAGS += -DINTERNAL_MD5
126
override CFLAGS += -DINTERNAL_MD4
127
override CFLAGS += -DINTERNAL_DES
128
ifdef CONFIG_INTERNAL_LIBTOMMATH
129
override CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
130
else
131
LIBS += -ltommath
132
endif
133
endif
134
135
ifndef LDO
136
LDO=$(CC)
137
endif
138
139
140
OBJS_lib=$(OBJS_both) $(OBJS_peer)
141
142
 #$(OBJS_server)
143
144
override CFLAGS  += -fPIC -DPIC
145
LDFLAGS += -shared
146
147
$(LIBEAP): $(OBJS_lib)
148
	$(LDO) $(LDFLAGS) $(OBJS_lib) -Wl,-soname -Wl,$(LIBEAP_SO) -o $(LIBEAP) $(LIBS)
149
150
151
UTIL_HEADERS = ../utils/includes.h ../utils/common.h \
152
	../utils/wpabuf.h ../utils/build_config.h \
153
	../utils/os.h ../utils/wpa_debug.h
154
COMMON_HEADERS = ../common/defs.h 
155
EAP_COMMON_HEADERS = ../eap_common/eap_defs.h 
156
MAIN_HEADERS = eap.h eap_methods.h eap_config.h
157
CRYPTO_HEADERS =  ../crypto/tls.h  
158
159
install: 
160
161
	mkdir -p $(DESTDIR)/usr/lib
162
#	copy the lib file to std lib location
163
	cp $(LIBEAP) $(DESTDIR)/usr/lib
164
	ln -fs $(LIBEAP_SO) $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so
165
	ln -fs $(LIBEAP_NAME).so.0.0.0 $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so.0
166
167
#	copy the headers reqd by apps using eap peer library in its own subfolder under /usr/include
168
	mkdir -p \
169
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common \
170
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common \
171
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util \
172
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
173
	install -m 0644 $(EAP_COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common
174
	install -m 0644 $(COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common
175
	install -m 0644 $(CRYPTO_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
176
	install -m 0644 $(UTIL_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util
177
	install -m 0644 $(MAIN_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/
178
179
	mkdir -p $(DESTDIR)/usr/lib/pkgconfig
180
	cp libeap0.pc $(DESTDIR)/usr/lib/pkgconfig
181
182
uninstall: 
183
184
	rm $(DESTDIR)/usr/lib/$(LIBEAP)
185
	rm -fr $(DESTDIR)/$(INCLUDE_INSTALL_DIR)
186
	rm -f $(DESTDIR)/usr/lib/pkgconfig/libeap0.pc
3
187
4
clean:
188
clean:
5
	rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov
189
	rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov libeap.a $(LIBEAP) $(OBJS_lib)
6
190
7
install:
8
	if ls *.so >/dev/null 2>&1; then \
9
		install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \
10
		cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \
11
	; fi

Return to bug 544036