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

Collapse All | Expand All

(-)a/src/eap_peer/Makefile (-8 / +183 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
OBJS_both += ../crypto/md5.o
40
OBJS_both += ../crypto/sha1.o
41
OBJS_both += ../crypto/sha1-tlsprf.o
42
OBJS_both += ../crypto/aes-encblock.o
43
OBJS_both += ../crypto/aes-wrap.o
44
OBJS_both += ../crypto/aes-ctr.o
45
OBJS_both += ../crypto/aes-eax.o
46
OBJS_both += ../crypto/aes-omac1.o
47
OBJS_both += ../crypto/ms_funcs.o
48
OBJS_both += ../crypto/sha256.o
49
50
51
OBJS_both += ../eap_common/eap_peap_common.o
52
OBJS_both += ../eap_common/eap_psk_common.o
53
OBJS_both += ../eap_common/eap_pax_common.o
54
OBJS_both += ../eap_common/eap_sake_common.o
55
OBJS_both += ../eap_common/eap_gpsk_common.o
56
OBJS_both += ../eap_common/chap.o
57
58
OBJS_peer += ../eap_peer/eap_tls.o
59
OBJS_peer += ../eap_peer/eap_peap.o
60
OBJS_peer += ../eap_peer/eap_ttls.o
61
OBJS_peer += ../eap_peer/eap_md5.o
62
OBJS_peer += ../eap_peer/eap_mschapv2.o
63
OBJS_peer += ../eap_peer/mschapv2.o
64
OBJS_peer += ../eap_peer/eap_otp.o
65
OBJS_peer += ../eap_peer/eap_gtc.o
66
OBJS_peer += ../eap_peer/eap_leap.o
67
OBJS_peer += ../eap_peer/eap_psk.o
68
OBJS_peer += ../eap_peer/eap_pax.o
69
OBJS_peer += ../eap_peer/eap_sake.o
70
OBJS_peer += ../eap_peer/eap_gpsk.o
71
OBJS_peer += ../eap_peer/eap.o
72
OBJS_peer += ../eap_common/eap_common.o
73
OBJS_peer += ../eap_peer/eap_methods.o
74
OBJS_peer += ../eap_peer/eap_tls_common.o
75
76
override CFLAGS += -DEAP_TLS
77
override CFLAGS += -DEAP_PEAP
78
override CFLAGS += -DEAP_TTLS
79
override CFLAGS += -DEAP_MD5
80
override CFLAGS += -DEAP_MSCHAPv2
81
override CFLAGS += -DEAP_GTC
82
override CFLAGS += -DEAP_OTP
83
override CFLAGS += -DEAP_LEAP
84
override CFLAGS += -DEAP_PSK
85
override CFLAGS += -DEAP_PAX
86
override CFLAGS += -DEAP_SAKE
87
override CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
88
override CFLAGS += -DEAP_TLS_FUNCS
89
90
override CFLAGS += -DIEEE8021X_EAPOL
91
92
ifeq ($(CONFIG_TLS), openssl)
93
override CFLAGS += -DEAP_TLS_OPENSSL
94
OBJS_both += ../crypto/tls_openssl.o
95
OBJS_both += ../crypto/crypto_openssl.o
96
LIBS += -lssl -lcrypto
97
override CFLAGS += -DINTERNAL_SHA256
98
endif
99
100
ifeq ($(CONFIG_TLS), internal)
101
OBJS_both += ../crypto/tls_internal.o
102
OBJS_both += ../tls/tlsv1_common.o ../../tls/tlsv1_record.o
103
OBJS_both += ../tls/tlsv1_cred.o
104
OBJS_both += ../tls/asn1.o ../../tls/x509v3.o
105
OBJS_both += ../crypto/crypto_internal.o ../../tls/rsa.o ../../tls/bignum.o
106
107
OBJS_peer += ../tls/tlsv1_client.o
108
OBJS_peer += ../tls/tlsv1_client_write.o ../../tls/tlsv1_client_read.o
109
override CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
110
111
OBJS_server += ../tls/tlsv1_server.o
112
OBJS_server += ../tls/tlsv1_server_write.o ../../tls/tlsv1_server_read.o
113
override CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
114
115
override CFLAGS += -DCONFIG_TLS_INTERNAL
116
override CFLAGS += -DCONFIG_CRYPTO_INTERNAL
117
override CFLAGS += -DCONFIG_INTERNAL_X509
118
override CFLAGS += -DINTERNAL_AES
119
override CFLAGS += -DINTERNAL_SHA1
120
override CFLAGS += -DINTERNAL_SHA256
121
override CFLAGS += -DINTERNAL_MD5
122
override CFLAGS += -DINTERNAL_MD4
123
override CFLAGS += -DINTERNAL_DES
124
ifdef CONFIG_INTERNAL_LIBTOMMATH
125
override CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
126
else
127
LIBS += -ltommath
128
endif
129
endif
130
131
ifndef LDO
132
LDO=$(CC)
133
endif
134
135
136
OBJS_lib=$(OBJS_both) $(OBJS_peer)
137
138
 #$(OBJS_server)
139
140
override CFLAGS  += -fPIC -DPIC
141
LDFLAGS += -shared
142
143
$(LIBEAP): $(OBJS_lib)
144
	$(LDO) $(LDFLAGS) $(OBJS_lib) -Wl,-soname -Wl,$(LIBEAP_SO) -o $(LIBEAP) $(LIBS)
145
146
147
UTIL_HEADERS = ../utils/includes.h ../utils/common.h \
148
	../utils/wpabuf.h ../utils/build_config.h \
149
	../utils/os.h ../utils/wpa_debug.h
150
COMMON_HEADERS = ../common/defs.h 
151
EAP_COMMON_HEADERS = ../eap_common/eap_defs.h 
152
MAIN_HEADERS = eap.h eap_methods.h eap_config.h
153
CRYPTO_HEADERS =  ../crypto/tls.h  
154
155
install: 
156
157
	mkdir -p $(DESTDIR)/usr/lib
158
#	copy the lib file to std lib location
159
	cp $(LIBEAP) $(DESTDIR)/usr/lib
160
	ln -fs $(LIBEAP_SO) $(DESTDIR)/usr/lib/$(LIBEAP_NAME).so
161
162
#	copy the headers reqd by apps using eap peer library in its own subfolder under /usr/include
163
	mkdir -p \
164
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common \
165
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common \
166
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util \
167
		$(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
168
	install -m 0644 $(EAP_COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/eap_common
169
	install -m 0644 $(COMMON_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/common
170
	install -m 0644 $(CRYPTO_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/crypto
171
	install -m 0644 $(UTIL_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/util
172
	install -m 0644 $(MAIN_HEADERS) $(DESTDIR)/$(INCLUDE_INSTALL_DIR)/
173
174
	mkdir -p $(DESTDIR)/usr/lib/pkgconfig
175
	cp libeap0.pc $(DESTDIR)/usr/lib/pkgconfig
176
177
uninstall: 
178
179
	rm $(DESTDIR)/usr/lib/$(LIBEAP)
180
	rm -fr $(DESTDIR)/$(INCLUDE_INSTALL_DIR)
181
	rm -f $(DESTDIR)/usr/lib/pkgconfig/libeap0.pc
3
182
4
clean:
183
clean:
5
	rm -f *~ *.o *.so *.d
184
	rm -f *~ *.o *.so *.d libeap.a $(LIBEAP) $(OBJS_lib)
6
185
7
install:
186
-include $(OBJS:%.o=%.d)
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
(-)a/src/eap_peer/eap_methods.c (+114 lines)
Lines 340-345 int eap_peer_method_register(struct eap_method *method) Link Here
340
340
341
341
342
/**
342
/**
343
 * eap_peer_register_methods - Register all known EAP peer methods
344
 *
345
 * This function is called at program start to register all compiled
346
 * in EAP peer methods.
347
 */
348
int eap_peer_register_methods(void)
349
{
350
	int ret = 0;
351
352
#ifdef EAP_MD5
353
	if (ret == 0)
354
		ret = eap_peer_md5_register();
355
#endif /* EAP_MD5 */
356
357
#ifdef EAP_TLS
358
	if (ret == 0)
359
		ret = eap_peer_tls_register();
360
#endif /* EAP_TLS */
361
362
#ifdef EAP_MSCHAPv2
363
	if (ret == 0)
364
		ret = eap_peer_mschapv2_register();
365
#endif /* EAP_MSCHAPv2 */
366
367
#ifdef EAP_PEAP
368
	if (ret == 0)
369
		ret = eap_peer_peap_register();
370
#endif /* EAP_PEAP */
371
372
#ifdef EAP_TTLS
373
	if (ret == 0)
374
		ret = eap_peer_ttls_register();
375
#endif /* EAP_TTLS */
376
377
#ifdef EAP_GTC
378
	if (ret == 0)
379
		ret = eap_peer_gtc_register();
380
#endif /* EAP_GTC */
381
382
#ifdef EAP_OTP
383
	if (ret == 0)
384
		ret = eap_peer_otp_register();
385
#endif /* EAP_OTP */
386
387
#ifdef EAP_SIM
388
	if (ret == 0)
389
		ret = eap_peer_sim_register();
390
#endif /* EAP_SIM */
391
392
#ifdef EAP_LEAP
393
	if (ret == 0)
394
		ret = eap_peer_leap_register();
395
#endif /* EAP_LEAP */
396
397
#ifdef EAP_PSK
398
	if (ret == 0)
399
		ret = eap_peer_psk_register();
400
#endif /* EAP_PSK */
401
402
#ifdef EAP_AKA
403
	if (ret == 0)
404
		ret = eap_peer_aka_register();
405
#endif /* EAP_AKA */
406
407
#ifdef EAP_AKA_PRIME
408
	if (ret == 0)
409
		ret = eap_peer_aka_prime_register();
410
#endif /* EAP_AKA_PRIME */
411
412
#ifdef EAP_FAST
413
	if (ret == 0)
414
		ret = eap_peer_fast_register();
415
#endif /* EAP_FAST */
416
417
#ifdef EAP_PAX
418
	if (ret == 0)
419
		ret = eap_peer_pax_register();
420
#endif /* EAP_PAX */
421
422
#ifdef EAP_SAKE
423
	if (ret == 0)
424
		ret = eap_peer_sake_register();
425
#endif /* EAP_SAKE */
426
427
#ifdef EAP_GPSK
428
	if (ret == 0)
429
		ret = eap_peer_gpsk_register();
430
#endif /* EAP_GPSK */
431
432
#ifdef EAP_WSC
433
	if (ret == 0)
434
		ret = eap_peer_wsc_register();
435
#endif /* EAP_WSC */
436
437
#ifdef EAP_IKEV2
438
	if (ret == 0)
439
		ret = eap_peer_ikev2_register();
440
#endif /* EAP_IKEV2 */
441
442
#ifdef EAP_VENDOR_TEST
443
	if (ret == 0)
444
		ret = eap_peer_vendor_test_register();
445
#endif /* EAP_VENDOR_TEST */
446
447
#ifdef EAP_TNC
448
	if (ret == 0)
449
		ret = eap_peer_tnc_register();
450
#endif /* EAP_TNC */
451
452
	return ret;
453
}
454
455
456
/**
343
 * eap_peer_unregister_methods - Unregister EAP peer methods
457
 * eap_peer_unregister_methods - Unregister EAP peer methods
344
 *
458
 *
345
 * This function is called at program termination to unregister all EAP peer
459
 * 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 *name, int *vendor); 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 (-1 / +10 lines)
Line 0 Link Here
0
- 
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}

Return to bug 339841