summaryrefslogtreecommitdiffstats
path: root/stack/smp
diff options
context:
space:
mode:
authorNitin Arora <niarora@codeaurora.org>2015-06-25 10:48:56 -0700
committerAndre Eisenbach <eisenbach@google.com>2015-07-10 00:48:12 -0700
commit26c3dd41b294b7f6d0ca7198b00ed1e1ef32dfb9 (patch)
tree314b89052a06d5171da628270c9a252baf2eae9c /stack/smp
parent8f766350bbb7026ddf34b73c9d87967decff792b (diff)
downloadandroid_system_bt-26c3dd41b294b7f6d0ca7198b00ed1e1ef32dfb9.tar.gz
android_system_bt-26c3dd41b294b7f6d0ca7198b00ed1e1ef32dfb9.tar.bz2
android_system_bt-26c3dd41b294b7f6d0ca7198b00ed1e1ef32dfb9.zip
Fail LE secure pairing for secure only peripherals
This change allows the host peripheral which initiates the pairing to reject the pairing in case the remote does not support secure LE connections and the host DUT is in secure connections only mode. Bug: 22203134 Change-Id: If58f791cb575d6b66c361f58e574b613d5686047
Diffstat (limited to 'stack/smp')
-rw-r--r--stack/smp/smp_act.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/stack/smp/smp_act.c b/stack/smp/smp_act.c
index 334649ad0..c0c7da7f6 100644
--- a/stack/smp/smp_act.c
+++ b/stack/smp/smp_act.c
@@ -549,11 +549,22 @@ void smp_proc_pair_cmd(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
}
else /* update local i/r key according to pairing request */
{
- /* paring started with this side (slave) sending Security Request */
+ /* pairing started with this side (slave) sending Security Request */
p_cb->local_i_key &= p_cb->peer_i_key;
p_cb->local_r_key &= p_cb->peer_r_key;
p_cb->selected_association_model = smp_select_association_model(p_cb);
+ if (p_cb->secure_connections_only_mode_required &&
+ (!(p_cb->le_secure_connections_mode_is_used) ||
+ (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS)))
+ {
+ SMP_TRACE_ERROR("%s pairing failed - slave requires secure connection only mode",
+ __func__);
+ reason = SMP_PAIR_AUTH_FAIL;
+ smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &reason);
+ return;
+ }
+
if (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_OOB)
{
if (smp_request_oob_data(p_cb)) return;