summaryrefslogtreecommitdiff
path: root/emulator/smp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-12-16 16:28:00 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2020-12-16 16:37:57 -0800
commita729fe0de9376759680c793adc0af6f490e954c1 (patch)
tree63a839427b844a6a46c0d34afecfd7875751d17e /emulator/smp.c
parentff70f24b3162e7c0e8bebb6a80824cfbd4946ce3 (diff)
downloadbluez-a729fe0de9376759680c793adc0af6f490e954c1.tar.gz
bthost: Use bt_crypto_random_bytes to generate a Pairing Random
This makes it more consistent with how stacks are implemented instead of setting the response all zero which is not secure.
Diffstat (limited to 'emulator/smp.c')
-rw-r--r--emulator/smp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/emulator/smp.c b/emulator/smp.c
index 7c05ba342..f339e1512 100644
--- a/emulator/smp.c
+++ b/emulator/smp.c
@@ -857,6 +857,8 @@ void *smp_conn_add(void *smp_data, uint16_t handle, const uint8_t *ia,
memcpy(conn->ia, ia, 6);
memcpy(conn->ra, ra, 6);
+ bt_crypto_random_bytes(smp->crypto, conn->prnd, sizeof(conn->prnd));
+
return conn;
}