From 34820d3b358fb61a12c465aace4cc45c4a781f10 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 12 Jul 2018 18:29:47 +0300 Subject: [PATCH] main.conf: Rename MinEncKeySize to KeySize There is no conflicts, or other key/encryption related parameter, with just calling this parameter KeySize so we don't have to just enter initial for something one can assume it implicitly. --- src/device.c | 2 +- src/hcid.h | 2 +- src/main.c | 9 ++++----- src/main.conf | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/device.c b/src/device.c index 49c55f02b..716da53f5 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 8924e9b4c..704f0ba37 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 e82508241..f49f29c4c 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 a70997669..224334c5a 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 -- 2.47.3