Added CONFIG_NO_AES_EXTRAS for hostapd
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 12 Jan 2009 13:15:35 +0000 (15:15 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 12 Jan 2009 13:15:35 +0000 (15:15 +0200)
This allows unneeded AES routines to be removed from the build to reduce
binary size.

hostapd/Makefile
src/crypto/aes_wrap.c

index f9d78a2..f9ee66b 100644 (file)
@@ -528,6 +528,14 @@ ifdef CONFIG_NO_STDOUT_DEBUG
 CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
 endif
 
+ifdef CONFIG_NO_AES_EXTRAS
+CFLAGS += -DCONFIG_NO_AES_UNWRAP
+CFLAGS += -DCONFIG_NO_AES_CTR -DCONFIG_NO_AES_OMAC1
+CFLAGS += -DCONFIG_NO_AES_EAX -DCONFIG_NO_AES_CBC
+CFLAGS += -DCONFIG_NO_AES_DECRYPT
+CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK
+endif
+
 ALL=hostapd hostapd_cli
 
 all: verify_config $(ALL)
index b8b7971..b1448b0 100644 (file)
@@ -86,6 +86,8 @@ int aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher)
 #endif /* CONFIG_NO_AES_WRAP */
 
 
+#ifndef CONFIG_NO_AES_UNWRAP
+
 /**
  * aes_unwrap - Unwrap key with AES Key Wrap Algorithm (128-bit KEK) (RFC3394)
  * @kek: Key encryption key (KEK)
@@ -145,6 +147,8 @@ int aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain)
        return 0;
 }
 
+#endif /* CONFIG_NO_AES_UNWRAP */
+
 
 #define BLOCK_SIZE 16