diff options
author | Simon Mikuda <simon.mikuda@streamunlimited.com> | 2022-11-18 06:26:10 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-11-21 16:43:00 -0800 |
commit | 9f5036834ba20226456acc0c430642ce36d4eecc (patch) | |
tree | b8fec6f1b0cd4539ce364298c4b46916c7d9c0f5 /src/main.c | |
parent | 5a872af406ca2d432e79d978f23a85771c7ce6ea (diff) | |
download | bluez-9f5036834ba20226456acc0c430642ce36d4eecc.tar.gz |
main.conf: Add SecureConnections option
This introduces SecureConnections option to main.conf that can be used to
configure this on adapter initialization.
This is useful for:
- disable for adapters that have a problems with SecureConnections enabled
- if you want to disable CTKD (cross transport key derivation)
- add option to enable only SecureConnections
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 1d357161f..99d9c508f 100644 --- a/src/main.c +++ b/src/main.c @@ -80,6 +80,7 @@ static const char *supported_options[] = { "MaxControllers" "MultiProfile", "FastConnectable", + "SecureConnections", "Privacy", "JustWorksRepairing", "TemporaryTimeout", @@ -881,6 +882,19 @@ static void parse_config(GKeyFile *config) btd_opts.name_request_retry_delay = val; } + str = g_key_file_get_string(config, "General", + "SecureConnections", &err); + if (err) + g_clear_error(&err); + else { + if (!strcmp(str, "off")) + btd_opts.secure_conn = SC_OFF; + else if (!strcmp(str, "on")) + btd_opts.secure_conn = SC_ON; + else if (!strcmp(str, "only")) + btd_opts.secure_conn = SC_ONLY; + } + str = g_key_file_get_string(config, "GATT", "Cache", &err); if (err) { DBG("%s", err->message); @@ -993,6 +1007,7 @@ static void init_defaults(void) btd_opts.debug_keys = FALSE; btd_opts.refresh_discovery = TRUE; btd_opts.name_request_retry_delay = DEFAULT_NAME_REQUEST_RETRY_DELAY; + btd_opts.secure_conn = SC_ON; btd_opts.defaults.num_entries = 0; btd_opts.defaults.br.page_scan_type = 0xFFFF; |