From d48330c8eaa52ff7a90eb905b11f3065b99bc516 Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakob.olsson@iopsys.eu>
Date: Tue, 11 May 2021 12:46:17 +0200
Subject: [PATCH] map-controller: deprecate bk_ssid and bk_key from wsc ext

---
 src/core/cntlr_tlv_generator.c |  2 --
 src/core/config.c              | 12 +-----------
 src/core/config.h              |  2 --
 3 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/core/cntlr_tlv_generator.c b/src/core/cntlr_tlv_generator.c
index c3e184a6..494e60bd 100644
--- a/src/core/cntlr_tlv_generator.c
+++ b/src/core/cntlr_tlv_generator.c
@@ -255,8 +255,6 @@ int cntlr_gen_wsc(struct controller *c, struct cmdu_buff *frm,
 		ATTR_PROTO, strlen(iface_cred->br->proto), iface_cred->br->proto,
 		ATTR_BR_IP, 4, &iface_cred->br->ipaddr.addr.ip4.s_addr,
 		ATTR_VID, 2, &(iface_cred->br->id),
-		ATTR_BK_KEY, strlen(iface_cred->bk_key), iface_cred->bk_key,
-		ATTR_BK_SSID, strlen(iface_cred->bk_ssid), iface_cred->bk_ssid,
 		-1);
 
 	ret = wsc_build_m2(msg, msglen, &cred, out, olen, &m2, &m2_size);
diff --git a/src/core/config.c b/src/core/config.c
index 5f64225c..85aa598d 100644
--- a/src/core/config.c
+++ b/src/core/config.c
@@ -431,8 +431,6 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 		CRED_VLAN,
 		CRED_MAP,
 		CRED_D_BSTA,
-		CRED_BK_SSID,
-		CRED_BK_KEY,
 		NUM_CREDS,
 	};
 	const struct uci_parse_option opts[] = {
@@ -442,9 +440,7 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 		[CRED_KEY] = { .name = "key", .type = UCI_TYPE_STRING },
 		[CRED_VLAN] = { .name = "vlan", .type = UCI_TYPE_STRING },
 		[CRED_MAP] = { .name = "multi_ap", .type = UCI_TYPE_STRING },
-		[CRED_D_BSTA] = { .name = "disallow_bsta", .type = UCI_TYPE_STRING },
-		[CRED_BK_SSID] = { .name = "bk_ssid", .type = UCI_TYPE_STRING },
-		[CRED_BK_KEY] = { .name = "bk_key", .type = UCI_TYPE_STRING },
+		[CRED_D_BSTA] = { .name = "disallow_bsta", .type = UCI_TYPE_STRING }
 	};
 	struct uci_option *tb[NUM_CREDS];
 	struct iface_credential *cred;
@@ -531,12 +527,6 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 	if (tb[CRED_D_BSTA])
 		cred->disallow_bsta = atoi(tb[CRED_D_BSTA]->v.string);
 
-	if (tb[CRED_BK_SSID])
-		strncpy((char *) cred->bk_ssid, tb[CRED_BK_SSID]->v.string, sizeof(cred->bk_ssid) - 1);
-
-	if (tb[CRED_BK_KEY])
-		strncpy((char *) cred->bk_key, tb[CRED_BK_KEY]->v.string, sizeof(cred->bk_key) - 1);
-
 	(*num)++;
 	list_add_tail(&cred->list, iface_list);
 	return 0;
diff --git a/src/core/config.h b/src/core/config.h
index 537ca667..7c1672e4 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -43,8 +43,6 @@ struct iface_credential {
 	uint8_t key[65];
 	uint8_t bssid[6];
 	uint8_t ssid[33];
-	uint8_t bk_key[65];
-	uint8_t bk_ssid[33];
 	uint16_t vlanid;
 	uint8_t multi_ap;
 	enum aptype mode;
-- 
GitLab