Re: [PATCH 3/4] android/bluetooth: Load IRK on adapter start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lukasz,

> If IRK is not found it will be generated
> ---
> android/bluetooth.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
> 
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 8865eac..1d5d26d 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -294,6 +294,22 @@ static void store_adapter_config(void)
> 	g_key_file_free(key_file);
> }
> 
> +static void generate_irk(void)
> +{
> +	int i;
> +
> +	srand(time(NULL));
> +
> +	/* Need to generate 16 octets */
> +	for (i = 0; i < 16; i =+ 4) {
> +		int a = rand();
> +
> +		memcpy(&adapter.irk[i], &a, 4);
> +	}
> +
> +	store_adapter_config();
> +}

bt_crypto_random_bytes() please.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux