hostapd: Fix internal crypto build without TLS
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 26 May 2009 14:09:04 +0000 (17:09 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 26 May 2009 14:09:04 +0000 (17:09 +0300)
hostapd/Makefile
src/crypto/crypto_internal.c
src/tls/rsa.c

index a4ec610..9baeea6 100644 (file)
@@ -506,6 +506,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
index c4cebfb..f8d841f 100644 (file)
@@ -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,
index bfc0d52..4965a2a 100644 (file)
@@ -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 */
 
 
 /**