aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-06-14 12:37:42 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-06-14 13:54:10 -0400
commit3158c50c33c1acddcfa3c57fab812435aa459750 (patch)
tree24c74d141b44a26e788f4ce0e22767fd28ba9720 /include/net/bluetooth
parent5d3de7df18077a0f508ae2c3e3f1866da65fdffd (diff)
Bluetooth: Add key size checks for SMP
This patch implements a check in smp cmd pairing request and pairing response to verify if encryption key maximum size is compatible in both slave and master when SMP Pairing is requested. Keys are also masked to the correct negotiated size. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/l2cap.h1
-rw-r--r--include/net/bluetooth/smp.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 157419afe532..bf1c7f681932 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -400,6 +400,7 @@ struct l2cap_conn {
400 __u8 prnd[16]; /* SMP Pairing Random */ 400 __u8 prnd[16]; /* SMP Pairing Random */
401 __u8 pcnf[16]; /* SMP Pairing Confirm */ 401 __u8 pcnf[16]; /* SMP Pairing Confirm */
402 __u8 tk[16]; /* SMP Temporary Key */ 402 __u8 tk[16]; /* SMP Temporary Key */
403 __u8 smp_key_size;
403 404
404 struct timer_list security_timer; 405 struct timer_list security_timer;
405 406
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index 111853ab239a..4fb7d198a876 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -112,6 +112,9 @@ struct smp_cmd_security_req {
112#define SMP_UNSPECIFIED 0x08 112#define SMP_UNSPECIFIED 0x08
113#define SMP_REPEATED_ATTEMPTS 0x09 113#define SMP_REPEATED_ATTEMPTS 0x09
114 114
115#define SMP_MIN_ENC_KEY_SIZE 7
116#define SMP_MAX_ENC_KEY_SIZE 16
117
115/* SMP Commands */ 118/* SMP Commands */
116int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); 119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
117int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); 120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);