Remove unnecessary defines
authorJouni Malinen <j@w1.fi>
Sat, 5 Dec 2009 20:51:08 +0000 (22:51 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 5 Dec 2009 20:51:08 +0000 (22:51 +0200)
The following defines are not really needed in most places, so
remove them to clean up source code and build scripts:
EAP_TLS_FUNCS
EAP_TLS_OPENSSL
EAP_TLS_GNUTLS
CONFIG_TLS_INTERNAL

16 files changed:
eap_example/Makefile
src/crypto/crypto_cryptoapi.c
src/crypto/crypto_internal.c
src/crypto/crypto_libtomcrypt.c
src/eapol_supp/eapol_supp_sm.c
src/eapol_supp/eapol_supp_sm.h
src/tls/rsa.c
src/utils/build_config.h
wpa_supplicant/Makefile
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/ctrl_iface_dbus_handlers.c
wpa_supplicant/eapol_test.c
wpa_supplicant/nmake.mak
wpa_supplicant/wpas_glue.c

index 28feb8f..dbbe45e 100644 (file)
@@ -89,7 +89,6 @@ CFLAGS += -DEAP_PSK
 CFLAGS += -DEAP_PAX
 CFLAGS += -DEAP_SAKE
 CFLAGS += -DEAP_GPSK -DEAP_GPSK_SHA256
-CFLAGS += -DEAP_TLS_FUNCS
 
 CFLAGS += -DEAP_SERVER_TLS
 CFLAGS += -DEAP_SERVER_PEAP
@@ -105,7 +104,6 @@ CFLAGS += -DEAP_SERVER_GPSK -DEAP_SERVER_GPSK_SHA256
 CFLAGS += -DIEEE8021X_EAPOL
 
 ifeq ($(CONFIG_TLS), openssl)
-CFLAGS += -DEAP_TLS_OPENSSL
 OBJS_both += ../src/crypto/tls_openssl.o
 OBJS_both += ../src/crypto/crypto_openssl.o
 LIBS += -lssl -lcrypto
@@ -113,7 +111,6 @@ CONFIG_INTERNAL_SHA256=y
 endif
 
 ifeq ($(CONFIG_TLS), gnutls)
-CFLAGS += -DEAP_TLS_GNUTLS
 OBJS_both += ../src/crypto/tls_gnutls.o
 OBJS_both += ../src/crypto/crypto_gnutls.o
 LIBS += -lgnutls -lgcrypt
index aef8d45..568fe0f 100644 (file)
@@ -33,7 +33,6 @@ L"Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"
 #define CALG_HMAC (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
 #endif
 
-#ifdef CONFIG_TLS_INTERNAL
 #ifdef __MINGW32_VERSION
 /*
  * MinGW does not yet include all the needed definitions for CryptoAPI, so
@@ -98,7 +97,6 @@ static int mingw_load_crypto_func(void)
 }
 
 #endif /* __MINGW32_VERSION */
-#endif /* CONFIG_TLS_INTERNAL */
 
 
 static void cryptoapi_report_error(const char *msg)
@@ -238,7 +236,6 @@ void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
 }
 
 
-#ifdef EAP_TLS_FUNCS
 int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
 {
        return cryptoapi_hash_vector(CALG_MD5, 16, num_elem, addr, len, mac);
@@ -364,7 +361,6 @@ void aes_decrypt_deinit(void *ctx)
        aes_encrypt_deinit(ctx);
 }
 
-#ifdef CONFIG_TLS_INTERNAL
 
 struct crypto_hash {
        enum crypto_hash_alg alg;
@@ -796,7 +792,3 @@ int crypto_global_init(void)
 void crypto_global_deinit(void)
 {
 }
-
-#endif /* CONFIG_TLS_INTERNAL */
-
-#endif /* EAP_TLS_FUNCS */
index 34b43ae..84d30bb 100644 (file)
@@ -27,8 +27,6 @@
 #include "md5_i.h"
 #include "des_i.h"
 
-#ifdef CONFIG_TLS_INTERNAL
-
 struct crypto_hash {
        enum crypto_hash_alg alg;
        union {
@@ -543,7 +541,6 @@ int crypto_global_init(void)
 void crypto_global_deinit(void)
 {
 }
-#endif /* CONFIG_TLS_INTERNAL */
 
 
 #ifdef CONFIG_MODEXP
index 22ebce8..52b67a7 100644 (file)
@@ -62,7 +62,6 @@ void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
 }
 
 
-#ifdef EAP_TLS_FUNCS
 int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
 {
        hash_state md;
@@ -147,8 +146,6 @@ void aes_decrypt_deinit(void *ctx)
 }
 
 
-#ifdef CONFIG_TLS_INTERNAL
-
 struct crypto_hash {
        enum crypto_hash_alg alg;
        int error;
@@ -733,7 +730,3 @@ fail:
 }
 
 #endif /* CONFIG_MODEXP */
-
-#endif /* CONFIG_TLS_INTERNAL */
-
-#endif /* EAP_TLS_FUNCS */
index 01f0ec1..77cd564 100644 (file)
@@ -1854,11 +1854,9 @@ struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
        sm->authPeriod = 30;
 
        os_memset(&conf, 0, sizeof(conf));
-#ifdef EAP_TLS_OPENSSL
        conf.opensc_engine_path = ctx->opensc_engine_path;
        conf.pkcs11_engine_path = ctx->pkcs11_engine_path;
        conf.pkcs11_module_path = ctx->pkcs11_module_path;
-#endif /* EAP_TLS_OPENSSL */
        conf.wps = ctx->wps;
 
        sm->eap = eap_peer_sm_init(sm, &eapol_cb, sm->ctx->msg_ctx, &conf);
index 00fc886..1d2a32b 100644 (file)
@@ -173,7 +173,6 @@ struct eapol_ctx {
         */
        void (*aborted_cached)(void *ctx);
 
-#ifdef EAP_TLS_OPENSSL
        /**
         * opensc_engine_path - Path to the OpenSSL engine for opensc
         *
@@ -198,7 +197,6 @@ struct eapol_ctx {
         * module is not loaded.
         */
        const char *pkcs11_module_path;
-#endif /* EAP_TLS_OPENSSL */
 
        /**
         * wps - WPS context data
index 03676ba..3084adc 100644 (file)
@@ -34,7 +34,6 @@ struct crypto_rsa_key {
 };
 
 
-#ifdef EAP_TLS_FUNCS
 static const u8 * crypto_rsa_parse_integer(const u8 *pos, const u8 *end,
                                           struct bignum *num)
 {
@@ -223,7 +222,6 @@ error:
        crypto_rsa_free(key);
        return NULL;
 }
-#endif /* EAP_TLS_FUNCS */
 
 
 /**
index 0e1d4dc..7f54b04 100644 (file)
@@ -28,7 +28,6 @@
 #define CONFIG_ANSI_C_EXTRA
 #define CONFIG_WINPCAP
 #define IEEE8021X_EAPOL
-#define EAP_TLS_FUNCS
 #define PKCS12_FUNCS
 #define PCSC_FUNCS
 #define CONFIG_CTRL_IFACE
@@ -48,7 +47,6 @@
 #define _CRT_SECURE_NO_DEPRECATE
 
 #ifdef USE_INTERNAL_CRYPTO
-#define CONFIG_TLS_INTERNAL
 #define CONFIG_TLS_INTERNAL_CLIENT
 #define CONFIG_INTERNAL_LIBTOMMATH
 #define CONFIG_INTERNAL_X509
@@ -65,8 +63,6 @@
 #define CONFIG_BACKEND_FILE
 #define CONFIG_INTERNAL_LIBTOMMATH
 #define CONFIG_INTERNAL_X509
-#define EAP_TLS_FUNCS
-#define CONFIG_TLS_INTERNAL
 #define CONFIG_CRYPTO_INTERNAL
 #define IEEE8021X_EAPOL
 #define PKCS12_FUNCS
@@ -85,7 +81,6 @@
 #define CONFIG_DRIVER_OSX
 #define CONFIG_BACKEND_FILE
 #define IEEE8021X_EAPOL
-#define EAP_TLS_FUNCS
 #define PKCS12_FUNCS
 #define CONFIG_CTRL_IFACE
 #define CONFIG_CTRL_IFACE_UNIX
 #define EAP_WSC
 
 #ifdef USE_INTERNAL_CRYPTO
-#define CONFIG_TLS_INTERNAL
 #define CONFIG_TLS_INTERNAL_CLIENT
 #define CONFIG_INTERNAL_LIBTOMMATH
 #define CONFIG_INTERNAL_X509
index 428f010..00f5dc2 100644 (file)
@@ -694,7 +694,6 @@ endif
 ifdef TLS_FUNCS
 NEED_DES=y
 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
-CFLAGS += -DEAP_TLS_FUNCS
 OBJS += ../src/eap_peer/eap_tls_common.o
 OBJS_h += ../src/eap_server/eap_tls_common.o
 NEED_TLS_PRF=y
@@ -794,7 +793,6 @@ OBJS_p += ../src/crypto/rc4.o
 NEED_BASE64=y
 NEED_TLS_PRF=y
 NEED_MODEXP=y
-CFLAGS += -DCONFIG_TLS_INTERNAL
 CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
 endif
 ifdef NEED_MODEXP
index 35c46fa..b6c5aa8 100644 (file)
@@ -1661,11 +1661,9 @@ void wpa_config_free(struct wpa_config *config)
 
        os_free(config->ctrl_interface);
        os_free(config->ctrl_interface_group);
-#ifdef EAP_TLS_OPENSSL
        os_free(config->opensc_engine_path);
        os_free(config->pkcs11_engine_path);
        os_free(config->pkcs11_module_path);
-#endif /* EAP_TLS_OPENSSL */
        os_free(config->driver_param);
        os_free(config->device_name);
        os_free(config->manufacturer);
index b9f0da6..84eef48 100644 (file)
@@ -169,7 +169,6 @@ struct wpa_config {
         */
        int fast_reauth;
 
-#ifdef EAP_TLS_OPENSSL
        /**
         * opensc_engine_path - Path to the OpenSSL engine for opensc
         *
@@ -194,7 +193,6 @@ struct wpa_config {
         * module is not loaded.
         */
        char *pkcs11_module_path;
-#endif /* EAP_TLS_OPENSSL */
 
        /**
         * driver_param - Driver interface parameters
index 29e494c..07a1e8a 100644 (file)
@@ -434,11 +434,9 @@ static const struct global_parse_data global_fields[] = {
        { INT_RANGE(eapol_version, 1, 2) },
        { INT(ap_scan) },
        { INT(fast_reauth) },
-#ifdef EAP_TLS_OPENSSL
        { STR(opensc_engine_path) },
        { STR(pkcs11_engine_path) },
        { STR(pkcs11_module_path) },
-#endif /* EAP_TLS_OPENSSL */
        { STR(driver_param) },
        { INT(dot11RSNAConfigPMKLifetime) },
        { INT(dot11RSNAConfigPMKReauthThreshold) },
@@ -837,7 +835,6 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
                fprintf(f, "ap_scan=%d\n", config->ap_scan);
        if (config->fast_reauth != DEFAULT_FAST_REAUTH)
                fprintf(f, "fast_reauth=%d\n", config->fast_reauth);
-#ifdef EAP_TLS_OPENSSL
        if (config->opensc_engine_path)
                fprintf(f, "opensc_engine_path=%s\n",
                        config->opensc_engine_path);
@@ -847,7 +844,6 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
        if (config->pkcs11_module_path)
                fprintf(f, "pkcs11_module_path=%s\n",
                        config->pkcs11_module_path);
-#endif /* EAP_TLS_OPENSSL */
        if (config->driver_param)
                fprintf(f, "driver_param=%s\n", config->driver_param);
        if (config->dot11RSNAConfigPMKLifetime)
index d685697..08623ec 100644 (file)
@@ -1262,14 +1262,12 @@ DBusMessage * wpas_dbus_iface_set_smartcard_modules(
                wpa_dbus_dict_entry_clear(&entry);
        }
 
-#ifdef EAP_TLS_OPENSSL
        os_free(wpa_s->conf->opensc_engine_path);
        wpa_s->conf->opensc_engine_path = opensc_engine_path;
        os_free(wpa_s->conf->pkcs11_engine_path);
        wpa_s->conf->pkcs11_engine_path = pkcs11_engine_path;
        os_free(wpa_s->conf->pkcs11_module_path);
        wpa_s->conf->pkcs11_module_path = pkcs11_module_path;
-#endif /* EAP_TLS_OPENSSL */
 
        wpa_sm_set_eapol(wpa_s->wpa, NULL);
        eapol_sm_deinit(wpa_s->eapol);
index 0d49323..2820cfb 100644 (file)
@@ -404,11 +404,9 @@ static int test_eapol(struct eapol_test_data *e, struct wpa_supplicant *wpa_s,
        ctx->eapol_send = eapol_test_eapol_send;
        ctx->set_config_blob = eapol_test_set_config_blob;
        ctx->get_config_blob = eapol_test_get_config_blob;
-#ifdef EAP_TLS_OPENSSL
        ctx->opensc_engine_path = wpa_s->conf->opensc_engine_path;
        ctx->pkcs11_engine_path = wpa_s->conf->pkcs11_engine_path;
        ctx->pkcs11_module_path = wpa_s->conf->pkcs11_module_path;
-#endif /* EAP_TLS_OPENSSL */
 
        wpa_s->eapol = eapol_sm_init(ctx);
        if (wpa_s->eapol == NULL) {
index 2b20f64..f2b1049 100644 (file)
@@ -28,7 +28,6 @@ CFLAGS = $(CFLAGS) /DCONFIG_NDIS_EVENTS_INTEGRATED
 CFLAGS = $(CFLAGS) /DCONFIG_ANSI_C_EXTRA
 CFLAGS = $(CFLAGS) /DCONFIG_WINPCAP
 CFLAGS = $(CFLAGS) /DIEEE8021X_EAPOL
-CFLAGS = $(CFLAGS) /DEAP_TLS_FUNCS
 CFLAGS = $(CFLAGS) /DPKCS12_FUNCS
 CFLAGS = $(CFLAGS) /DEAP_MD5
 CFLAGS = $(CFLAGS) /DEAP_TLS
index f72bf3c..01264de 100644 (file)
@@ -568,11 +568,9 @@ int wpa_supplicant_init_eapol(struct wpa_supplicant *wpa_s)
        ctx->set_config_blob = wpa_supplicant_set_config_blob;
        ctx->get_config_blob = wpa_supplicant_get_config_blob;
        ctx->aborted_cached = wpa_supplicant_aborted_cached;
-#ifdef EAP_TLS_OPENSSL
        ctx->opensc_engine_path = wpa_s->conf->opensc_engine_path;
        ctx->pkcs11_engine_path = wpa_s->conf->pkcs11_engine_path;
        ctx->pkcs11_module_path = wpa_s->conf->pkcs11_module_path;
-#endif /* EAP_TLS_OPENSSL */
        ctx->wps = wpa_s->wps;
        ctx->eap_param_needed = wpa_supplicant_eap_param_needed;
        ctx->port_cb = wpa_supplicant_port_cb;