Skip to content
Permalink
Browse files

Bluetooth: SMP: Use error code for OOB data not available

If no callback for oob data request is registered, or the user decided
to abort authentication during OOB data request, we should return the
error code for no OOB data available to indicate that the user does not
have the correct OOB, or no OOB interface at all.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
  • Loading branch information...
joerchan authored and carlescufi committed Aug 7, 2019
1 parent a80ab8b commit 16c24ea8d232a0bd3869d3de89a4b4ffd147d0da
Showing with 3 additions and 2 deletions.
  1. +3 −2 subsys/bluetooth/host/smp.c
@@ -3134,7 +3134,7 @@ static u8_t smp_pairing_random(struct bt_smp *smp, struct net_buf *buf)

return 0;
} else {
return BT_SMP_ERR_UNSPECIFIED;
return BT_SMP_ERR_OOB_NOT_AVAIL;
}
default:
return BT_SMP_ERR_UNSPECIFIED;
@@ -3544,7 +3544,7 @@ static u8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf)
bt_auth->oob_data_request(smp->chan.chan.conn,
&info);
} else {
return BT_SMP_ERR_UNSPECIFIED;
return BT_SMP_ERR_OOB_NOT_AVAIL;
}
break;
default:
@@ -4658,6 +4658,7 @@ int bt_smp_auth_cancel(struct bt_conn *conn)
case PASSKEY_CONFIRM:
return smp_error(smp, BT_SMP_ERR_CONFIRM_FAILED);
case LE_SC_OOB:
return smp_error(smp, BT_SMP_ERR_OOB_NOT_AVAIL);
case JUST_WORKS:
return smp_error(smp, BT_SMP_ERR_UNSPECIFIED);
default:

0 comments on commit 16c24ea

Please sign in to comment.
You can’t perform that action at this time.