Browse Source

Fix CONFIG_NO_WPA=y build

Number of places were calling functions that are not included in
CONFIG_NO_WPA=y build anymore. Comment out such calls. In addition, pull
in SHA1 and MD5 for config_internal.c, if needed.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 9 years ago
parent
commit
9e68742ef1

+ 3 - 2
src/rsn_supp/wpa.h

@@ -181,7 +181,7 @@ static inline void wpa_sm_notify_disassoc(struct wpa_sm *sm)
 }
 }
 
 
 static inline void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk,
 static inline void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk,
-				  size_t pmk_len)
+				  size_t pmk_len, const u8 *bssid)
 {
 {
 }
 }
 
 
@@ -321,7 +321,8 @@ static inline void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm,
 }
 }
 
 
 static inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, const u8 *ptk_kck,
 static inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, const u8 *ptk_kck,
-					  const u8 *ptk_kek)
+					  size_t ptk_kck_len,
+					  const u8 *ptk_kek, size_t ptk_kek_len)
 {
 {
 }
 }
 
 

+ 4 - 0
wpa_supplicant/Makefile

@@ -288,6 +288,10 @@ NEED_MD5=y
 NEED_RC4=y
 NEED_RC4=y
 else
 else
 CFLAGS += -DCONFIG_NO_WPA
 CFLAGS += -DCONFIG_NO_WPA
+ifeq ($(CONFIG_TLS), internal)
+NEED_SHA1=y
+NEED_MD5=y
+endif
 endif
 endif
 
 
 ifdef CONFIG_IBSS_RSN
 ifdef CONFIG_IBSS_RSN

+ 8 - 0
wpa_supplicant/config.c

@@ -899,6 +899,9 @@ static char * wpa_config_write_key_mgmt(const struct parse_data *data,
 
 
 static int wpa_config_parse_cipher(int line, const char *value)
 static int wpa_config_parse_cipher(int line, const char *value)
 {
 {
+#ifdef CONFIG_NO_WPA
+	return -1;
+#else /* CONFIG_NO_WPA */
 	int val = wpa_parse_cipher(value);
 	int val = wpa_parse_cipher(value);
 	if (val < 0) {
 	if (val < 0) {
 		wpa_printf(MSG_ERROR, "Line %d: invalid cipher '%s'.",
 		wpa_printf(MSG_ERROR, "Line %d: invalid cipher '%s'.",
@@ -911,12 +914,16 @@ static int wpa_config_parse_cipher(int line, const char *value)
 		return -1;
 		return -1;
 	}
 	}
 	return val;
 	return val;
+#endif /* CONFIG_NO_WPA */
 }
 }
 
 
 
 
 #ifndef NO_CONFIG_WRITE
 #ifndef NO_CONFIG_WRITE
 static char * wpa_config_write_cipher(int cipher)
 static char * wpa_config_write_cipher(int cipher)
 {
 {
+#ifdef CONFIG_NO_WPA
+	return NULL;
+#else /* CONFIG_NO_WPA */
 	char *buf = os_zalloc(50);
 	char *buf = os_zalloc(50);
 	if (buf == NULL)
 	if (buf == NULL)
 		return NULL;
 		return NULL;
@@ -927,6 +934,7 @@ static char * wpa_config_write_cipher(int cipher)
 	}
 	}
 
 
 	return buf;
 	return buf;
+#endif /* CONFIG_NO_WPA */
 }
 }
 #endif /* NO_CONFIG_WRITE */
 #endif /* NO_CONFIG_WRITE */
 
 

+ 5 - 0
wpa_supplicant/wpa_supplicant.c

@@ -1155,6 +1155,10 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
 			return -1;
 			return -1;
 	}
 	}
 
 
+#ifdef CONFIG_NO_WPA
+	wpa_s->group_cipher = WPA_CIPHER_NONE;
+	wpa_s->pairwise_cipher = WPA_CIPHER_NONE;
+#else /* CONFIG_NO_WPA */
 	sel = ie.group_cipher & ssid->group_cipher;
 	sel = ie.group_cipher & ssid->group_cipher;
 	wpa_s->group_cipher = wpa_pick_group_cipher(sel);
 	wpa_s->group_cipher = wpa_pick_group_cipher(sel);
 	if (wpa_s->group_cipher < 0) {
 	if (wpa_s->group_cipher < 0) {
@@ -1174,6 +1178,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
 	}
 	}
 	wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using PTK %s",
 	wpa_dbg(wpa_s, MSG_DEBUG, "WPA: using PTK %s",
 		wpa_cipher_txt(wpa_s->pairwise_cipher));
 		wpa_cipher_txt(wpa_s->pairwise_cipher));
+#endif /* CONFIG_NO_WPA */
 
 
 	sel = ie.key_mgmt & ssid->key_mgmt;
 	sel = ie.key_mgmt & ssid->key_mgmt;
 #ifdef CONFIG_SAE
 #ifdef CONFIG_SAE

+ 1 - 1
wpa_supplicant/wpas_glue.c

@@ -1013,7 +1013,6 @@ static void wpa_supplicant_set_rekey_offload(void *ctx,
 
 
 	wpa_drv_set_rekey_info(wpa_s, kek, kek_len, kck, kck_len, replay_ctr);
 	wpa_drv_set_rekey_info(wpa_s, kek, kek_len, kck, kck_len, replay_ctr);
 }
 }
-#endif /* CONFIG_NO_WPA */
 
 
 
 
 static int wpa_supplicant_key_mgmt_set_pmk(void *ctx, const u8 *pmk,
 static int wpa_supplicant_key_mgmt_set_pmk(void *ctx, const u8 *pmk,
@@ -1028,6 +1027,7 @@ static int wpa_supplicant_key_mgmt_set_pmk(void *ctx, const u8 *pmk,
 	else
 	else
 		return 0;
 		return 0;
 }
 }
+#endif /* CONFIG_NO_WPA */
 
 
 
 
 int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)
 int wpa_supplicant_init_wpa(struct wpa_supplicant *wpa_s)