Skip to content

Commit 797c174

Browse files
alxelaxcfriedt
authored andcommitted
Bluetooth: Mesh: logging public key in big endian
Local public key has been logged in little endian but remote public key in big endian. That has been changed. Both are logged in big endian to be able to compare in logs. Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent ebf9a59 commit 797c174

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

subsys/bluetooth/mesh/prov_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,15 @@ static void send_pub_key(void)
265265
return;
266266
}
267267

268-
BT_DBG("Local Public Key: %s", bt_hex(key, BT_PUB_KEY_LEN));
269-
270268
bt_mesh_prov_buf_init(&buf, PROV_PUB_KEY);
271269

272270
/* Swap X and Y halves independently to big-endian */
273271
sys_memcpy_swap(net_buf_simple_add(&buf, BT_PUB_KEY_COORD_LEN), key, BT_PUB_KEY_COORD_LEN);
274272
sys_memcpy_swap(net_buf_simple_add(&buf, BT_PUB_KEY_COORD_LEN), &key[BT_PUB_KEY_COORD_LEN],
275273
BT_PUB_KEY_COORD_LEN);
276274

275+
BT_DBG("Local Public Key: %s", bt_hex(buf.data + 1, BT_PUB_KEY_LEN));
276+
277277
/* PublicKeyDevice */
278278
memcpy(bt_mesh_prov_link.conf_inputs.pub_key_device, &buf.data[1], PDU_LEN_PUB_KEY);
279279

subsys/bluetooth/mesh/provisioner.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,15 @@ static void send_pub_key(void)
336336
return;
337337
}
338338

339-
BT_DBG("Local Public Key: %s", bt_hex(key, BT_PUB_KEY_LEN));
340-
341339
bt_mesh_prov_buf_init(&buf, PROV_PUB_KEY);
342340

343341
/* Swap X and Y halves independently to big-endian */
344342
sys_memcpy_swap(net_buf_simple_add(&buf, BT_PUB_KEY_COORD_LEN), key, BT_PUB_KEY_COORD_LEN);
345343
sys_memcpy_swap(net_buf_simple_add(&buf, BT_PUB_KEY_COORD_LEN), &key[BT_PUB_KEY_COORD_LEN],
346344
BT_PUB_KEY_COORD_LEN);
347345

346+
BT_DBG("Local Public Key: %s", bt_hex(buf.data + 1, BT_PUB_KEY_LEN));
347+
348348
/* PublicKeyProvisioner */
349349
memcpy(bt_mesh_prov_link.conf_inputs.pub_key_provisioner, &buf.data[1], PDU_LEN_PUB_KEY);
350350

0 commit comments

Comments
 (0)