aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-26 14:09:04 (GMT)
committerJouni Malinen <j@w1.fi>2009-06-22 17:41:10 (GMT)
commitfa4e296f542af01da135d997358d6d45a32dd59e (patch)
treeb3bc084ef292a051dbce572861e54616883fb1c7
parent84a45771d4288849e955c9e5380ec7f08237c0c3 (diff)
downloadhostap-06-fa4e296f542af01da135d997358d6d45a32dd59e.zip
hostap-06-fa4e296f542af01da135d997358d6d45a32dd59e.tar.gz
hostap-06-fa4e296f542af01da135d997358d6d45a32dd59e.tar.bz2
hostapd: Fix internal crypto build without TLS
(cherry picked from commit b63303b86432561988ebaa61e13bc9c74457d7cf)
-rw-r--r--hostapd/Makefile9
-rw-r--r--src/crypto/crypto_internal.c2
-rw-r--r--src/tls/rsa.c2
3 files changed, 13 insertions, 0 deletions
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 0312ed2..8f78461 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -449,6 +449,15 @@ ifeq ($(CONFIG_CRYPTO), internal)
OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
CFLAGS += -DCONFIG_CRYPTO_INTERNAL
+ifdef CONFIG_INTERNAL_LIBTOMMATH
+CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
+ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
+CFLAGS += -DLTM_FAST
+endif
+else
+LIBS += -ltommath
+LIBS_p += -ltommath
+endif
CONFIG_INTERNAL_AES=y
CONFIG_INTERNAL_DES=y
CONFIG_INTERNAL_SHA1=y
diff --git a/src/crypto/crypto_internal.c b/src/crypto/crypto_internal.c
index f9675cd..cddfb4d 100644
--- a/src/crypto/crypto_internal.c
+++ b/src/crypto/crypto_internal.c
@@ -435,6 +435,7 @@ struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len)
}
+#ifdef EAP_TLS_FUNCS
static struct crypto_private_key *
crypto_pkcs8_key_import(const u8 *buf, size_t len)
{
@@ -536,6 +537,7 @@ crypto_pkcs8_key_import(const u8 *buf, size_t len)
return (struct crypto_private_key *)
crypto_rsa_import_private_key(hdr.payload, hdr.length);
}
+#endif /* EAP_TLS_FUNCS */
struct crypto_private_key * crypto_private_key_import(const u8 *key,
diff --git a/src/tls/rsa.c b/src/tls/rsa.c
index bfc0d52..4965a2a 100644
--- a/src/tls/rsa.c
+++ b/src/tls/rsa.c
@@ -35,6 +35,7 @@ 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,6 +224,7 @@ error:
crypto_rsa_free(key);
return NULL;
}
+#endif /* EAP_TLS_FUNCS */
/**