Crypto build cleanup: remove INTERNAL_AES

In addition, rename aes.c to aes-internal.c to match in style with
SHA-1 conditionally built internal implementation.
This commit is contained in:
Johannes Berg 2009-07-28 21:09:57 +03:00 committed by Jouni Malinen
parent 657f038102
commit 246157cba6
5 changed files with 20 additions and 28 deletions

View file

@ -36,13 +36,13 @@ OBJS_both += ../src/crypto/rc4.o
OBJS_both += ../src/crypto/md4.o OBJS_both += ../src/crypto/md4.o
OBJS_both += ../src/crypto/sha1.o OBJS_both += ../src/crypto/sha1.o
OBJS_both += ../src/crypto/aes_wrap.o OBJS_both += ../src/crypto/aes_wrap.o
OBJS_both += ../src/crypto/aes.o
OBJS_both += ../src/crypto/ms_funcs.o OBJS_both += ../src/crypto/ms_funcs.o
OBJS_both += ../src/crypto/sha256.o OBJS_both += ../src/crypto/sha256.o
ifeq ($(CONFIG_TLS), internal) ifeq ($(CONFIG_TLS), internal)
OBJS_both += ../src/crypto/sha1-internal.o OBJS_both += ../src/crypto/sha1-internal.o
OBJS_both += ../src/crypto/des-internal.o OBJS_both += ../src/crypto/des-internal.o
OBJS_both += ../src/crypto/aes-internal.o
endif endif
@ -124,7 +124,6 @@ CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
CFLAGS += -DCONFIG_TLS_INTERNAL CFLAGS += -DCONFIG_TLS_INTERNAL
CFLAGS += -DCONFIG_CRYPTO_INTERNAL CFLAGS += -DCONFIG_CRYPTO_INTERNAL
CFLAGS += -DCONFIG_INTERNAL_X509 CFLAGS += -DCONFIG_INTERNAL_X509
CFLAGS += -DINTERNAL_AES
CFLAGS += -DINTERNAL_SHA256 CFLAGS += -DINTERNAL_SHA256
CFLAGS += -DINTERNAL_MD5 CFLAGS += -DINTERNAL_MD5
CFLAGS += -DINTERNAL_MD4 CFLAGS += -DINTERNAL_MD4

View file

@ -44,7 +44,7 @@ OBJS = hostapd.o main.o ieee802_1x.o eapol_sm.o \
preauth.o pmksa_cache.o \ preauth.o pmksa_cache.o \
drv_callbacks.o \ drv_callbacks.o \
tkip_countermeasures.o \ tkip_countermeasures.o \
mlme.o wpa_auth_ie.o mlme.o wpa_auth_ie.o $(AESOBJS)
OBJS += ../src/drivers/drivers.o OBJS += ../src/drivers/drivers.o
OBJS += ../src/drivers/scan_helpers.o OBJS += ../src/drivers/scan_helpers.o
@ -90,10 +90,8 @@ OBJS += ../src/crypto/md5.o
OBJS += ../src/crypto/rc4.o OBJS += ../src/crypto/rc4.o
OBJS += ../src/crypto/md4.o OBJS += ../src/crypto/md4.o
OBJS += ../src/crypto/sha1.o OBJS += ../src/crypto/sha1.o
OBJS += ../src/crypto/aes_wrap.o
OBJS += ../src/crypto/aes.o
HOBJS=../src/hlr_auc_gw/hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/hlr_auc_gw/milenage.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o AESOBJS = ../src/crypto/aes_wrap.o
CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
@ -430,7 +428,7 @@ OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o
OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o
OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o
OBJS_p += ../src/tls/asn1.o OBJS_p += ../src/tls/asn1.o
OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o OBJS_p += ../src/crypto/rc4.o $(AESOBJS)
NEED_BASE64=y NEED_BASE64=y
CFLAGS += -DCONFIG_TLS_INTERNAL CFLAGS += -DCONFIG_TLS_INTERNAL
CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
@ -531,7 +529,7 @@ CONFIG_INTERNAL_SHA256=y
endif endif
ifdef CONFIG_INTERNAL_AES ifdef CONFIG_INTERNAL_AES
CFLAGS += -DINTERNAL_AES AESOBJS += ../src/crypto/aes-internal.o
endif endif
ifdef CONFIG_INTERNAL_SHA1 ifdef CONFIG_INTERNAL_SHA1
OBJS += ../src/crypto/sha1-internal.o OBJS += ../src/crypto/sha1-internal.o
@ -653,6 +651,8 @@ ifdef TLS_FUNCS
LIBS_n += -lcrypto LIBS_n += -lcrypto
endif endif
HOBJS=../src/hlr_auc_gw/hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/hlr_auc_gw/milenage.o $(AESOBJS)
nt_password_hash: $(NOBJS) nt_password_hash: $(NOBJS)
$(CC) -o nt_password_hash $(NOBJS) $(LIBS_n) $(CC) -o nt_password_hash $(NOBJS) $(LIBS_n)
@ -685,10 +685,10 @@ clean-docs:
rm -rf doc/latex doc/html rm -rf doc/latex doc/html
rm -f doc/hostapd.{eps,png} hostapd-devel.pdf rm -f doc/hostapd.{eps,png} hostapd-devel.pdf
TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes_wrap.c ../src/crypto/aes.c ../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes_wrap.c ../src/crypto/aes-internal.c ../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c
test-milenage: $(TEST_SRC_MILENAGE) test-milenage: $(TEST_SRC_MILENAGE)
$(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \ $(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \
-DTEST_MAIN_MILENAGE -I. -DINTERNAL_AES \ -DTEST_MAIN_MILENAGE -I. \
-I../src/crypto -I../src/utils -I../src/crypto -I../src/utils
./test-milenage ./test-milenage
rm test-milenage rm test-milenage

View file

@ -24,9 +24,6 @@
#include "includes.h" #include "includes.h"
#include "common.h" #include "common.h"
#ifdef INTERNAL_AES
#include "crypto.h" #include "crypto.h"
/* /*
@ -1123,5 +1120,3 @@ void aes_decrypt_deinit(void *ctx)
os_free(ctx); os_free(ctx);
} }
#endif /* CONFIG_NO_AES_DECRYPT */ #endif /* CONFIG_NO_AES_DECRYPT */
#endif /* INTERNAL_AES */

View file

@ -51,7 +51,6 @@
#define CONFIG_TLS_INTERNAL #define CONFIG_TLS_INTERNAL
#define CONFIG_TLS_INTERNAL_CLIENT #define CONFIG_TLS_INTERNAL_CLIENT
#define CONFIG_INTERNAL_LIBTOMMATH #define CONFIG_INTERNAL_LIBTOMMATH
#define INTERNAL_AES
#define INTERNAL_SHA256 #define INTERNAL_SHA256
#define INTERNAL_MD5 #define INTERNAL_MD5
#define INTERNAL_MD4 #define INTERNAL_MD4
@ -67,7 +66,6 @@
#define CONFIG_NO_HOSTAPD_LOGGER #define CONFIG_NO_HOSTAPD_LOGGER
#define CONFIG_NO_STDOUT_DEBUG #define CONFIG_NO_STDOUT_DEBUG
#define CONFIG_BACKEND_FILE #define CONFIG_BACKEND_FILE
#define INTERNAL_AES
#define INTERNAL_MD5 #define INTERNAL_MD5
#define INTERNAL_MD4 #define INTERNAL_MD4
#define CONFIG_INTERNAL_LIBTOMMATH #define CONFIG_INTERNAL_LIBTOMMATH

View file

@ -43,6 +43,7 @@ install: all
SHA1OBJS = ../src/crypto/sha1.o SHA1OBJS = ../src/crypto/sha1.o
DESOBJS = # none needed when not internal DESOBJS = # none needed when not internal
AESOBJS = ../src/crypto/aes_wrap.o
OBJS = config.o OBJS = config.o
@ -775,7 +776,7 @@ OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_client.o
OBJS += ../src/tls/tlsv1_client_write.o ../src/tls/tlsv1_client_read.o OBJS += ../src/tls/tlsv1_client_write.o ../src/tls/tlsv1_client_read.o
OBJS += ../src/tls/asn1.o ../src/tls/rsa.o ../src/tls/x509v3.o OBJS += ../src/tls/asn1.o ../src/tls/rsa.o ../src/tls/x509v3.o
OBJS_p += ../src/tls/asn1.o ../src/tls/rsa.o OBJS_p += ../src/tls/asn1.o ../src/tls/rsa.o
OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o OBJS_p += ../src/crypto/rc4.o
NEED_BASE64=y NEED_BASE64=y
NEED_TLS_PRF=y NEED_TLS_PRF=y
CFLAGS += -DCONFIG_TLS_INTERNAL CFLAGS += -DCONFIG_TLS_INTERNAL
@ -903,7 +904,7 @@ CONFIG_INTERNAL_MD5=y
endif endif
ifdef CONFIG_INTERNAL_AES ifdef CONFIG_INTERNAL_AES
CFLAGS += -DINTERNAL_AES AESOBJS += ../src/crypto/aes-internal.o
endif endif
ifdef CONFIG_INTERNAL_SHA1 ifdef CONFIG_INTERNAL_SHA1
SHA1OBJS += ../src/crypto/sha1-internal.o SHA1OBJS += ../src/crypto/sha1-internal.o
@ -1065,7 +1066,7 @@ CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK
endif endif
ifdef NEED_AES ifdef NEED_AES
OBJS += ../src/crypto/aes_wrap.o ../src/crypto/aes.o OBJS += $(AESOBJS)
endif endif
ifdef NEED_DH_GROUPS ifdef NEED_DH_GROUPS
@ -1118,7 +1119,7 @@ endif
OBJS += ../src/drivers/scan_helpers.o OBJS += ../src/drivers/scan_helpers.o
OBJS += $(SHA1OBJS) $(DESOBJS) OBJS += $(SHA1OBJS) $(DESOBJS)
OBJS_p += $(SHA1OBJS) $(DESOBJS) OBJS_p += $(SHA1OBJS) $(DESOBJS) $(AESOBJS)
OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
@ -1212,16 +1213,15 @@ test_wpa: $(OBJS_wpa) $(OBJS_h)
OBJSa=../src/tls/asn1_test.o ../src/tls/asn1.o ../src/tls/x509v3.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \ OBJSa=../src/tls/asn1_test.o ../src/tls/asn1.o ../src/tls/x509v3.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
../src/crypto/crypto_$(CONFIG_CRYPTO).o ../src/crypto/md5.o $(SHA1OBSJ) \ ../src/crypto/crypto_$(CONFIG_CRYPTO).o ../src/crypto/md5.o $(SHA1OBSJ) \
../src/crypto/rc4.o $(DESOBJS) ../src/crypto/aes_wrap.o \ ../src/crypto/rc4.o $(DESOBJS) $(AESOBJS) ../src/tls/bignum.o ../src/tls/rsa.o
../src/crypto/aes.o ../src/tls/bignum.o ../src/tls/rsa.o
asn1_test: $(OBJSa) asn1_test: $(OBJSa)
$(LDO) $(LDFLAGS) -o asn1_test $(OBJSa) $(LDO) $(LDFLAGS) -o asn1_test $(OBJSa)
OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \ OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \
../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \ ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
../src/crypto/crypto_$(CONFIG_CRYPTO).o \ ../src/crypto/crypto_$(CONFIG_CRYPTO).o \
../src/crypto/md5.o $(SHA1OBJS) ../src/crypto/aes.o \ ../src/crypto/md5.o $(SHA1OBJS) $(AESOBJS) \
../src/crypto/rc4.o $(DESOBJS) ../src/crypto/aes_wrap.o \ ../src/crypto/rc4.o $(DESOBJS) \
../src/crypto/sha256.o \ ../src/crypto/sha256.o \
../src/tls/bignum.o ../src/tls/rsa.o ../src/tls/bignum.o ../src/tls/rsa.o
test_x509v3: $(OBJSx) test_x509v3: $(OBJSx)
@ -1312,15 +1312,15 @@ test-sha256: $(TEST_SHA256_OBJS)
./test-sha256 ./test-sha256
rm test-sha256 rm test-sha256
TEST_AES_OBJS = ../src/crypto/aes_wrap.o ../src/crypto/aes.o tests/test_aes.o TEST_AES_OBJS = tests/test_aes.o $(AESOBJS)
test-aes: $(TEST_AES_OBJS) test-aes: $(TEST_AES_OBJS)
$(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS) $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
./test-aes ./test-aes
rm test-aes rm test-aes
TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) ../src/crypto/md5.o \ TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) ../src/crypto/md5.o \
../src/crypto/aes_wrap.o ../src/utils/common.o ../src/utils/os_unix.o \ ../src/utils/common.o ../src/utils/os_unix.o \
../src/utils/wpa_debug.o ../src/crypto/aes.o \ ../src/utils/wpa_debug.o $(AESOBJS) \
tests/test_eap_sim_common.o tests/test_eap_sim_common.o
test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS) test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
$(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS) $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)