host/mesh: Fix setting remote public key in provisioner

This aligns provisioner and provisionee APIs in terms of endianess
of public key provided by an application.

This is port of f5ba999257e977688e7eae6a36a554ceed51d95f
This commit is contained in:
Krzysztof Kopyściński
2021-11-10 06:24:00 +01:00
committed by Krzysztof Kopyściński
parent 9e4cd9ae78
commit d9413d20fb
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ int bt_mesh_input_number(uint32_t num);
/** @brief Provide Device public key.
*
* @param public_key Device public key.
* @param public_key Device public key in big-endian.
*
* @return Zero on success or (negative) error code otherwise.
*/
+1 -2
View File
@@ -724,8 +724,7 @@ int bt_mesh_prov_remote_pub_key_set(const uint8_t public_key[64])
}
/* Swap X and Y halves independently to big-endian */
memcpy(&bt_mesh_prov_link.conf_inputs[81], public_key, 32);
memcpy(&bt_mesh_prov_link.conf_inputs[81 + 32], &public_key[32], 32);
memcpy(&bt_mesh_prov_link.conf_inputs[81], public_key, 64);
return 0;
}