From: Luiz Augusto von Dentz Date: Thu, 17 Dec 2020 00:28:00 +0000 (-0800) Subject: bthost: Use bt_crypto_random_bytes to generate a Pairing Random X-Git-Tag: submit/tizen/20220313.220938~522 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32f96cd123d2086d1e1f0ea79cb463f69aa8548c;p=platform%2Fupstream%2Fbluez.git 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. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/emulator/smp.c b/emulator/smp.c index 7c05ba3..f339e15 100755 --- 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; }