All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junho Lee <tot0roprog@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ] mesh: Add config for provisioning algorithms
Date: Wed, 11 Sep 2024 09:31:31 +0900	[thread overview]
Message-ID: <66e0e4e6.170a0220.de5c1.1970@mx.google.com> (raw)

This added the Algorithms config of provisioning capabilities to the
mesh conf file.
---
 mesh/mesh-main.conf | 7 +++++++
 mesh/mesh.c         | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/mesh/mesh-main.conf b/mesh/mesh-main.conf
index aca9e6fa5..58fbb9840 100644
--- a/mesh/mesh-main.conf
+++ b/mesh/mesh-main.conf
@@ -41,3 +41,10 @@
 # Setting this value to zero means there's no timeout.
 # Defaults to 60.
 #ProvTimeout = 60
+
+# Bitmask of supported provisioning security algorithms.
+# Bit 0: BTM_ECDH_P256_CMAC_AES128_AES_CCM
+# Bit 1: BTM_ECDH_P256_HMAC_SHA256_AES_CCM
+# Valid range: 0-65535
+# Defaults to 1.
+#Algorithms = 1
diff --git a/mesh/mesh.c b/mesh/mesh.c
index 91cf25175..7b670e40a 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
@@ -245,6 +245,10 @@ static void parse_settings(const char *mesh_conf_fname)
 	if (l_settings_get_uint(settings, "General", "ProvTimeout", &value))
 		mesh.prov_timeout = value;
 
+	if (l_settings_get_uint(settings, "General", "Algorithms", &value) &&
+								value <= 65535)
+		mesh.algorithms = value;
+
 done:
 	l_settings_free(settings);
 }
@@ -262,7 +266,6 @@ bool mesh_init(const char *config_dir, const char *mesh_conf_fname,
 	mesh_model_init();
 	mesh_agent_init();
 
-	/* TODO: read mesh.conf */
 	mesh.prov_timeout = DEFAULT_PROV_TIMEOUT;
 	mesh.algorithms = DEFAULT_ALGORITHMS;
 
-- 
2.34.1


             reply	other threads:[~2024-09-11  0:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  0:31 Junho Lee [this message]
2024-09-11  2:41 ` [BlueZ] mesh: Add config for provisioning algorithms bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66e0e4e6.170a0220.de5c1.1970@mx.google.com \
    --to=tot0roprog@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.