From a729fe0de9376759680c793adc0af6f490e954c1 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 16 Dec 2020 16:28:00 -0800 Subject: [PATCH] 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. --- emulator/smp.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.47.3