From bd4e28950d8141a8dd82da26e5ea6336437bd09c Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 28 Jul 2009 21:27:02 +0300 Subject: [PATCH] Crypto build cleanup: remove INTERNAL_MD4 In addition, rename md4.c to md4-internal.c to match in style with SHA-1 conditionally built internal implementation. --- eap_example/Makefile | 3 +-- hostapd/Makefile | 3 +-- src/crypto/{md4.c => md4-internal.c} | 5 ----- src/utils/build_config.h | 2 -- wpa_supplicant/Makefile | 10 ++++++---- wpa_supplicant/symbian/wpa_supplicant.mmp | 2 +- .../vs2005/wpa_supplicant/wpa_supplicant.vcproj | 4 ---- wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj | 4 ---- 8 files changed, 9 insertions(+), 24 deletions(-) rename src/crypto/{md4.c => md4-internal.c} (99%) diff --git a/eap_example/Makefile b/eap_example/Makefile index 2abe171ae..80cd003e2 100644 --- a/eap_example/Makefile +++ b/eap_example/Makefile @@ -33,7 +33,7 @@ OBJS_both += ../src/utils/base64.o OBJS_both += ../src/utils/wpabuf.o OBJS_both += ../src/crypto/md5.o OBJS_both += ../src/crypto/rc4.o -OBJS_both += ../src/crypto/md4.o +OBJS_both += ../src/crypto/md4-internal.o OBJS_both += ../src/crypto/sha1.o OBJS_both += ../src/crypto/aes_wrap.o OBJS_both += ../src/crypto/ms_funcs.o @@ -126,7 +126,6 @@ CFLAGS += -DCONFIG_CRYPTO_INTERNAL CFLAGS += -DCONFIG_INTERNAL_X509 CONFIG_INTERNAL_SHA256=y CFLAGS += -DINTERNAL_MD5 -CFLAGS += -DINTERNAL_MD4 ifdef CONFIG_INTERNAL_LIBTOMMATH CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH else diff --git a/hostapd/Makefile b/hostapd/Makefile index 00e9f605f..e7aa3d702 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -88,7 +88,6 @@ endif OBJS += ../src/crypto/md5.o OBJS += ../src/crypto/rc4.o -OBJS += ../src/crypto/md4.o OBJS += ../src/crypto/sha1.o AESOBJS = ../src/crypto/aes_wrap.o @@ -538,7 +537,7 @@ ifdef CONFIG_INTERNAL_MD5 CFLAGS += -DINTERNAL_MD5 endif ifdef CONFIG_INTERNAL_MD4 -CFLAGS += -DINTERNAL_MD4 +OBJS += ../src/crypto/md4-internal.o endif ifdef CONFIG_INTERNAL_DES OBJS += ../src/crypto/des-internal.o diff --git a/src/crypto/md4.c b/src/crypto/md4-internal.c similarity index 99% rename from src/crypto/md4.c rename to src/crypto/md4-internal.c index 41c84a3a7..872872d92 100644 --- a/src/crypto/md4.c +++ b/src/crypto/md4-internal.c @@ -17,9 +17,6 @@ #include "common.h" #include "crypto.h" - -#ifdef INTERNAL_MD4 - #define MD4_BLOCK_LENGTH 64 #define MD4_DIGEST_LENGTH 16 @@ -278,5 +275,3 @@ MD4Transform(u32 state[4], const u8 block[MD4_BLOCK_LENGTH]) state[3] += d; } /* ===== end - public domain MD4 implementation ===== */ - -#endif /* INTERNAL_MD4 */ diff --git a/src/utils/build_config.h b/src/utils/build_config.h index 9289073e2..544ab02d3 100644 --- a/src/utils/build_config.h +++ b/src/utils/build_config.h @@ -52,7 +52,6 @@ #define CONFIG_TLS_INTERNAL_CLIENT #define CONFIG_INTERNAL_LIBTOMMATH #define INTERNAL_MD5 -#define INTERNAL_MD4 #define CONFIG_INTERNAL_X509 #define CONFIG_CRYPTO_INTERNAL #endif /* USE_INTERNAL_CRYPTO */ @@ -66,7 +65,6 @@ #define CONFIG_NO_STDOUT_DEBUG #define CONFIG_BACKEND_FILE #define INTERNAL_MD5 -#define INTERNAL_MD4 #define CONFIG_INTERNAL_LIBTOMMATH #define CONFIG_INTERNAL_X509 #define EAP_TLS_FUNCS diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index bd42025ed..b43586036 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -45,6 +45,7 @@ SHA1OBJS = ../src/crypto/sha1.o DESOBJS = # none needed when not internal AESOBJS = ../src/crypto/aes_wrap.o SHA256OBJS = # none by default +MD4OBJS = # none by default OBJS = config.o @@ -53,12 +54,10 @@ OBJS += ../src/utils/wpa_debug.o OBJS += ../src/utils/wpabuf.o OBJS += ../src/crypto/md5.o OBJS += ../src/crypto/rc4.o -OBJS += ../src/crypto/md4.o OBJS_p = wpa_passphrase.o OBJS_p += ../src/utils/common.o OBJS_p += ../src/utils/wpa_debug.o OBJS_p += ../src/crypto/md5.o -OBJS_p += ../src/crypto/md4.o OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o -include .config @@ -914,8 +913,11 @@ ifdef CONFIG_INTERNAL_MD5 CFLAGS += -DINTERNAL_MD5 endif ifdef CONFIG_INTERNAL_MD4 -CFLAGS += -DINTERNAL_MD4 +MD4OBJS += ../src/crypto/md4-internal.o endif +OBJS += $(MD4OBJS) +OBJS_p += $(MD4OBJS) + ifdef CONFIG_INTERNAL_DES DESOBJS += ../src/crypto/des-internal.o endif @@ -1328,7 +1330,7 @@ test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS) ./test-eap_sim_common rm test-eap_sim_common -TEST_MD4_OBJS = ../src/crypto/md4.o tests/test_md4.o #../src/crypto/crypto_openssl.o +TEST_MD4_OBJS = ../src/crypto/md4-internal.o tests/test_md4.o #../src/crypto/crypto_openssl.o test-md4: $(TEST_MD4_OBJS) $(LDO) $(LDFLAGS) -o $@ $(TEST_MD4_OBJS) $(LIBS) ./test-md4 diff --git a/wpa_supplicant/symbian/wpa_supplicant.mmp b/wpa_supplicant/symbian/wpa_supplicant.mmp index fad9626b8..4072756f3 100644 --- a/wpa_supplicant/symbian/wpa_supplicant.mmp +++ b/wpa_supplicant/symbian/wpa_supplicant.mmp @@ -21,7 +21,7 @@ SOURCE wpa_common.c SOURCEPATH ..\..\src\utils SOURCE os_none.c common.c wpa_debug.c eloop_none.c base64.c SOURCEPATH ..\..\src\crypto -SOURCE sha1.c md5.c rc4.c md4.c des.c aes_wrap.c aes.c ms_funcs.c +SOURCE sha1.c md5.c rc4.c des.c aes_wrap.c aes.c ms_funcs.c SOURCE tls_internal.c crypto_internal.c SOURCEPATH ..\..\src\tls SOURCE asn1.c bignum.c rsa.c x509v3.c tlsv1_client.c tlsv1_common.c diff --git a/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj b/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj index a733fea07..0920db196 100755 --- a/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj +++ b/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj @@ -310,10 +310,6 @@ RelativePath="..\..\main.c" > - - diff --git a/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj b/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj index 9f9e4384b..052f5a453 100755 --- a/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj +++ b/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj @@ -310,10 +310,6 @@ RelativePath="..\..\main_winsvc.c" > - -