Commit b501d6a1 authored by Anderson Briglia's avatar Anderson Briglia Committed by Gustavo F. Padovan

Bluetooth: Start SMP procedure

Start SMP procedure for LE connections. This modification intercepts
l2cap received frames and call proper SMP functions to start the SMP
procedure. By now, no keys are being used.
Signed-off-by: default avatarVinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: default avatarAnderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent eb492e01
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h> #include <net/bluetooth/l2cap.h>
#include <net/bluetooth/smp.h>
int disable_ertm; int disable_ertm;
...@@ -909,12 +910,15 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) ...@@ -909,12 +910,15 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
__clear_chan_timer(chan); __clear_chan_timer(chan);
l2cap_state_change(chan, BT_CONNECTED); l2cap_state_change(chan, BT_CONNECTED);
sk->sk_state_change(sk); sk->sk_state_change(sk);
if (smp_conn_security(conn, chan->sec_level))
BT_DBG("Insufficient security");
} }
if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
__clear_chan_timer(chan); __clear_chan_timer(chan);
l2cap_state_change(chan, BT_CONNECTED); l2cap_state_change(chan, BT_CONNECTED);
sk->sk_state_change(sk); sk->sk_state_change(sk);
} else if (chan->state == BT_CONNECT) } else if (chan->state == BT_CONNECT)
l2cap_do_start(chan); l2cap_do_start(chan);
...@@ -4060,6 +4064,11 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -4060,6 +4064,11 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
l2cap_att_channel(conn, cid, skb); l2cap_att_channel(conn, cid, skb);
break; break;
case L2CAP_CID_SMP:
if (smp_sig_channel(conn, skb))
l2cap_conn_del(conn->hcon, EACCES);
break;
default: default:
l2cap_data_channel(conn, cid, skb); l2cap_data_channel(conn, cid, skb);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment