diff mbox series

[Bluez,51/62] adapter: Inclusive language for storing LTK

Message ID 20210813201256.Bluez.51.I90a92f48ae29b2a8d8b18f856ea2a43afba52299@changeid (mailing list archive)
State Superseded
Headers show
Series Inclusive language changes | expand

Commit Message

Archie Pusaka Aug. 13, 2021, 12:18 p.m. UTC
From: Archie Pusaka <apusaka@chromium.org>

"central" and "peripheral" are the preferred terms, as reflected in
the BT core spec 5.3.
---

 doc/settings-storage.txt |  4 ++--
 src/adapter.c            | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/doc/settings-storage.txt b/doc/settings-storage.txt
index d21150f09e..79361d4228 100644
--- a/doc/settings-storage.txt
+++ b/doc/settings-storage.txt
@@ -294,9 +294,9 @@  Long term key) related to a remote device.
   Rand			Integer		Randomizer
 
 
-[SlaveLongTermKey] group contains:
+[PeripheralLongTermKey] group contains:
 
-  Same as the [LongTermKey] group, except for slave keys.
+  Same as the [LongTermKey] group, except for peripheral keys.
 
 
 [ConnectionParameters] group contains:
diff --git a/src/adapter.c b/src/adapter.c
index 60712f01a0..a23c438f34 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3651,7 +3651,7 @@  static struct smp_ltk_info *get_ltk(GKeyFile *key_file, const char *peer,
 									NULL);
 	ltk->ediv = g_key_file_get_integer(key_file, group, "EDiv", NULL);
 
-	central = g_key_file_get_boolean(key_file, group, "Master", &gerr);
+	central = g_key_file_get_boolean(key_file, group, "Central", &gerr);
 	if (gerr)
 		g_error_free(gerr);
 	else
@@ -3683,7 +3683,7 @@  static struct smp_ltk_info *get_peripheral_ltk_info(GKeyFile *key_file,
 
 	DBG("%s", peer);
 
-	ltk = get_ltk(key_file, peer, bdaddr_type, "SlaveLongTermKey");
+	ltk = get_ltk(key_file, peer, bdaddr_type, "PeripheralLongTermKey");
 	if (ltk)
 		ltk->central = false;
 
@@ -5623,7 +5623,7 @@  static void convert_ltk_entry(GKeyFile *key_file, void *value)
 	g_free(str);
 
 	g_key_file_set_integer(key_file, "LongTermKey", "Authenticated", auth);
-	g_key_file_set_integer(key_file, "LongTermKey", "Master", central);
+	g_key_file_set_integer(key_file, "LongTermKey", "Central", central);
 	g_key_file_set_integer(key_file, "LongTermKey", "EncSize", enc_size);
 	g_key_file_set_integer(key_file, "LongTermKey", "EDiv", ediv);
 
@@ -8047,7 +8047,7 @@  static void store_longtermkey(struct btd_adapter *adapter, const bdaddr_t *peer,
 				uint8_t enc_size, uint16_t ediv,
 				uint64_t rand)
 {
-	const char *group = central ? "LongTermKey" : "SlaveLongTermKey";
+	const char *group = central ? "LongTermKey" : "PeripheralLongTermKey";
 	char device_addr[18];
 	char filename[PATH_MAX];
 	GKeyFile *key_file;
@@ -8069,7 +8069,7 @@  static void store_longtermkey(struct btd_adapter *adapter, const bdaddr_t *peer,
 	g_key_file_load_from_file(key_file, filename, 0, NULL);
 
 	/* Old files may contain this so remove it in case it exists */
-	g_key_file_remove_key(key_file, "LongTermKey", "Master", NULL);
+	g_key_file_remove_key(key_file, "LongTermKey", "Central", NULL);
 
 	for (i = 0; i < 16; i++)
 		sprintf(key_str + (i * 2), "%2.2X", key[i]);