From e3098be40bbde0fdd5fcfa6bf28491db421d333a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 28 Feb 2014 18:10:03 +0200 Subject: Bluetooth: Delay LTK encryption to let remote receive all keys Some devices may refuse to re-encrypt with the LTK if they haven't received all our keys yet. This patch adds a 250ms delay before attempting re-encryption with the LTK. Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann --- net/bluetooth/smp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'net/bluetooth/smp.h') diff --git a/net/bluetooth/smp.h b/net/bluetooth/smp.h index 676395f..f55d836 100644 --- a/net/bluetooth/smp.h +++ b/net/bluetooth/smp.h @@ -121,6 +121,8 @@ struct smp_cmd_security_req { #define SMP_FLAG_LTK_ENCRYPT 4 #define SMP_FLAG_COMPLETE 5 +#define SMP_REENCRYPT_TIMEOUT msecs_to_jiffies(250) + struct smp_chan { struct l2cap_conn *conn; u8 preq[7]; /* SMP Pairing Request */ @@ -140,6 +142,7 @@ struct smp_chan { unsigned long smp_flags; struct work_struct confirm; struct work_struct random; + struct delayed_work reencrypt; }; /* SMP Commands */ -- cgit v1.1