mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-04 05:57:23 +00:00
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:
committed by
Krzysztof Kopyściński
parent
9e4cd9ae78
commit
d9413d20fb
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user