linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Lowas-Rzechonek" <michal.lowas-rzechonek@silvair.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/4] mesh: Normalize Access Key AID and Index naming in models
Date: Mon, 19 Aug 2019 11:33:22 +0200	[thread overview]
Message-ID: <20190819093324.10566-3-michal.lowas-rzechonek@silvair.com> (raw)
In-Reply-To: <20190819093324.10566-1-michal.lowas-rzechonek@silvair.com>

After 8f0839a1c46300ceb1b129d17a3bff446ff79d08, mesh/crypto uses _aid
suffix for keys' AID property, so let's change the wording in mesh/model
as well.
---
 mesh/model.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/mesh/model.c b/mesh/model.c
index 8f3d67ecf..2ecaf00e9 100644
--- a/mesh/model.c
+++ b/mesh/model.c
@@ -355,7 +355,7 @@ static void forward_model(void *a, void *b)
 
 static int dev_packet_decrypt(struct mesh_node *node, const uint8_t *data,
 				uint16_t size, bool szmict, uint16_t src,
-				uint16_t dst, uint8_t key_id, uint32_t seq,
+				uint16_t dst, uint8_t key_aid, uint32_t seq,
 				uint32_t iv_idx, uint8_t *out)
 {
 	uint8_t dev_key[16];
@@ -366,7 +366,7 @@ static int dev_packet_decrypt(struct mesh_node *node, const uint8_t *data,
 		return -1;
 
 	if (mesh_crypto_payload_decrypt(NULL, 0, data, size, szmict, src,
-					dst, key_id, seq, iv_idx, out, key))
+					dst, key_aid, seq, iv_idx, out, key))
 		return APP_IDX_DEV_LOCAL;
 
 	if (!keyring_get_remote_dev_key(node, src, dev_key))
@@ -374,7 +374,7 @@ static int dev_packet_decrypt(struct mesh_node *node, const uint8_t *data,
 
 	key = dev_key;
 	if (mesh_crypto_payload_decrypt(NULL, 0, data, size, szmict, src,
-					dst, key_id, seq, iv_idx, out, key))
+					dst, key_aid, seq, iv_idx, out, key))
 		return APP_IDX_DEV_REMOTE;
 
 	return -1;
@@ -382,7 +382,7 @@ static int dev_packet_decrypt(struct mesh_node *node, const uint8_t *data,
 
 static int virt_packet_decrypt(struct mesh_net *net, const uint8_t *data,
 				uint16_t size, bool szmict, uint16_t src,
-				uint16_t dst, uint8_t key_id, uint32_t seq,
+				uint16_t dst, uint8_t key_aid, uint32_t seq,
 				uint32_t iv_idx, uint8_t *out,
 				struct mesh_virtual **decrypt_virt)
 {
@@ -397,7 +397,8 @@ static int virt_packet_decrypt(struct mesh_net *net, const uint8_t *data,
 
 		decrypt_idx = appkey_packet_decrypt(net, szmict, seq,
 							iv_idx, src, dst,
-							virt->label, 16, key_id,
+							virt->label, 16,
+							key_aid,
 							data, size, out);
 
 		if (decrypt_idx >= 0) {
@@ -768,7 +769,7 @@ static void send_dev_key_msg_rcvd(struct mesh_node *node, uint8_t ele_idx,
 }
 
 static void send_msg_rcvd(struct mesh_node *node, uint8_t ele_idx, bool is_sub,
-					uint16_t src, uint16_t key_idx,
+					uint16_t src, uint16_t app_idx,
 					uint16_t size, const uint8_t *data)
 {
 	struct l_dbus *dbus = dbus_get_bus();
@@ -790,7 +791,7 @@ static void send_msg_rcvd(struct mesh_node *node, uint8_t ele_idx, bool is_sub,
 	builder = l_dbus_message_builder_new(msg);
 
 	l_dbus_message_builder_append_basic(builder, 'q', &src);
-	l_dbus_message_builder_append_basic(builder, 'q', &key_idx);
+	l_dbus_message_builder_append_basic(builder, 'q', &app_idx);
 	l_dbus_message_builder_append_basic(builder, 'b', &is_sub);
 
 	dbus_append_byte_array(builder, data, size);
-- 
2.19.1


  parent reply	other threads:[~2019-08-19  9:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19  9:33 [PATCH BlueZ 0/4] mesh: Streamline crypto functions Michał Lowas-Rzechonek
2019-08-19  9:33 ` [PATCH BlueZ 1/4] mesh: Remove unused defines Michał Lowas-Rzechonek
2019-08-19  9:33 ` Michał Lowas-Rzechonek [this message]
2019-08-19  9:33 ` [PATCH BlueZ 3/4] mesh: Align appkey_packet_decrypt with dev and virt variants Michał Lowas-Rzechonek
2019-08-19  9:33 ` [PATCH BlueZ 4/4] mesh: Remove redundant code from mesh/crypto Michał Lowas-Rzechonek
2019-09-17  6:55 ` [PATCH BlueZ 0/4] mesh: Streamline crypto functions Michał Lowas-Rzechonek
2019-09-30  9:12   ` Michał Lowas-Rzechonek
2019-10-03 20:06 ` Gix, Brian
2019-10-05 19:01   ` michal.lowas-rzechonek

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=20190819093324.10566-3-michal.lowas-rzechonek@silvair.com \
    --to=michal.lowas-rzechonek@silvair.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).