Diff between b47b36de67ce866a15fafde07804de80553377db and 34820d3b358fb61a12c465aace4cc45c4a781f10

Changed Files

File Additions Deletions Status
src/device.c +1 -1 modified
src/hcid.h +1 -1 modified
src/main.c +4 -5 modified
src/main.conf +1 -1 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index 49c55f0..716da53 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4911,7 +4911,7 @@ static void gatt_server_init(struct btd_device *device,
 	gatt_server_cleanup(device);
 
 	device->server = bt_gatt_server_new(db, device->att, device->att_mtu,
-						main_opts.min_enc_key_size);
+						main_opts.key_size);
 	if (!device->server) {
 		error("Failed to initialize bt_gatt_server");
 		return;
diff --git a/src/hcid.h b/src/hcid.h
index 8924e9b..704f0ba 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -56,7 +56,7 @@ struct main_opts {
 	bt_gatt_cache_t gatt_cache;
 	uint16_t	gatt_mtu;
 
-	uint8_t		min_enc_key_size;
+	uint8_t		key_size;
 };
 
 extern struct main_opts main_opts;
diff --git a/src/main.c b/src/main.c
index e825082..f49f29c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,7 +104,7 @@ static const char *policy_options[] = {
 
 static const char *gatt_options[] = {
 	"Cache",
-	"MinEncKeySize",
+	"KeySize",
 	"ExchangeMTU",
 	NULL
 };
@@ -410,16 +410,15 @@ static void parse_config(GKeyFile *config)
 		g_free(str);
 	}
 
-	val = g_key_file_get_integer(config, "GATT",
-						"MinEncKeySize", &err);
+	val = g_key_file_get_integer(config, "GATT", "KeySize", &err);
 	if (err) {
 		DBG("%s", err->message);
 		g_clear_error(&err);
 	} else {
-		DBG("MinEncKeySize=%d", val);
+		DBG("KeySize=%d", val);
 
 		if (val >=7 && val <= 16)
-			main_opts.min_enc_key_size = val;
+			main_opts.key_size = val;
 	}
 
 	val = g_key_file_get_integer(config, "GATT", "ExchangeMTU", &err);
diff --git a/src/main.conf b/src/main.conf
index a709976..224334c 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -80,7 +80,7 @@
 # Minimum required Encryption Key Size for accessing secured characteristics.
 # Possible values: 0 and 7-16. 0 means don't care.
 # Defaults to 0
-# MinEncKeySize = 0
+#KeySize = 0
 
 # Exchange MTU size.
 # Possible values: 23-517