History log of /system/bt/stack/smp/smp_act.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9ded3b71deeb06a6de8bdba36dca198d481ca34c 15-Mar-2016 Nitin Arora <niarora@codeaurora.org> Remote device changes for SMP certification

Use Case:
Certification test cases for SMP require various scenarios
where the remote device needs to show a specific behavior
where it fails the pairing in a certain way, and the DUT is
required to abort the pairing properly.
In abcense of a proper PTS suite to execute these test cases,
we can use another device running the same host by configuring
certain run time property.

Test Cases:
TP/SCJW/BI-02-C
TP/SCJW/BV-02-C
TP/SCPK/BI-03-C
TP/SCPK/BI-04-C
TP/SCPK/BV-02-C
TP/SCPK/BV-03-C
TP/SCJW/BI-01-C
TP/SCCT/BV-01-C
TP/SCCT/BV-02-C
TP/SCPK/BI-01-C
TP/SCPK/BI-02-C
TP/SCPK/BV-04-C
TP/SCPK/BV-01-C

Fix:
Added a property in the bt_stack.conf file. The property name
is "SmpFailureCase". The values 2 to 6(inclusive), are forcausing SMP
failures with various failure reasons.
Failure case 1 and 9 are for producing error "Confirm value failure".
Cases 7 and 8 are for generating specific errors at pair cancel.

Note:
The default use of this feature is controlled using a compile
time flag BTM_BLE_SMP_CERTIFICATION.
The BTM_BLE_SMP_CERTIFICATION = TRUE is needed only while we
wait for the PTS support for the LE Secure connections.

Bug: 27852645
Change-Id: I1f7a8ff2659d85b5978b75870c57162a34d394d0
(cherry picked from commit 0bd0c8fc88a7141691a7ca839b11cb711945ee33)
/system/bt/stack/smp/smp_act.c
95673843582fccf026d8af7592428f9b864f52fd 11-Apr-2016 Andre Eisenbach <eisenbach@google.com> Move autopair blacklist to interop database

Blacklist by partial name etc. was not working and had no effect; all
BDAs in the config file start with 00:, which is implausible at best, so
deleted...

Added new mechanism to blacklist by BDA only initially and added Subaru
car kit to blacklist.

Bug: 27347017
Change-Id: Ie2941cb1ab663b5444b02c44f85032f13be4ab46
/system/bt/stack/smp/smp_act.c
4da5ccfe438cd3f65ff37674bd9a3ee38cb2ecb3 04-Nov-2015 Andre Eisenbach <eisenbach@google.com> Do not mask out secure connections (SC) bit for BT <4.2

Bug: 25467621
Change-Id: Ifdb52295fa5b8c5a39524a722dc044227c735240
/system/bt/stack/smp/smp_act.c
864e7734f21d7ebe3f3a6840d187a2696498e9f4 29-Oct-2015 Andre Eisenbach <eisenbach@google.com> Serialize remote version query over LE

Some devices (ex. Nexus Player remote) do not take well to having the
remote version queried while a remote feature request is also sent and
subsequently fail encryption.

This patch serializes the query of the remote version and requires both
remote features and the remote version to be read before calling a
connection established.

Bug: 25357767
Change-Id: Ie70eea241b47b81778d8e0df47f3a8f376316932
/system/bt/stack/smp/smp_act.c
4f7c4f67320bbb35c85b478d2ac7aa29d732acca 26-Oct-2015 Andre Eisenbach <eisenbach@google.com> Check remote LMP version before enabling secure connections

Request remote version information for LE links when connecting and
ensure LMP version is >= 8 (Bluetooth 4.2) before setting the LinkKey
bits in the pairing request.

This is to ensure older remote devices do not get confused by the
additional bit(s) in the pairing request.

Bug: 25277879
Change-Id: I25424e541fa5244d8f522dffc62cdedc24f4f35b
/system/bt/stack/smp/smp_act.c
1da48a3600c980fe4ba825d287ff0ac5038be3ff 18-Jul-2015 Nitin Arora <niarora@codeaurora.org> Use pseudo address while re-pairing peripheral

In case of pairing to an already paired device (in an instance
where the central remote has removed the keys), the change
makes sure that the correct address is used when LTK key
request occurs at the peripheral.

Bug: 22605510
Change-Id: I959003f39f70281ff1e6af8d4c4549138bc1682c
/system/bt/stack/smp/smp_act.c
26c3dd41b294b7f6d0ca7198b00ed1e1ef32dfb9 25-Jun-2015 Nitin Arora <niarora@codeaurora.org> 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
/system/bt/stack/smp/smp_act.c
97269982095f2da252d667542688d98e5fee128f 07-Jul-2015 Andre Eisenbach <eisenbach@google.com> Remove extraneous patch from secure connections workaround

Bug: 21817410
Change-Id: I55b3753b0ae9f389f1531bb588c4868e96842aeb
/system/bt/stack/smp/smp_act.c
7927f68bb2d9b963288261e1e858463b43c52a2d 03-Jul-2015 Andre Eisenbach <eisenbach@google.com> Blacklist Nexus Remote for LE secure connections

The Nexus remote will disconnect during encryption when paired with the
secure connections feature enabled. This patch will blacklist the remote
and mask out the feature during pairing.

This patch introduces a new interop database with the aim of
consolodating various blacklists and interop workarounds into a single
database for code readability and maintainability of the list.

Bug: 21817410
Change-Id: I6f510e1c8c6050ab4e313209122d028e12e5f54f
/system/bt/stack/smp/smp_act.c
c0a4342caa940e4d214d748c09583e7c8bff7c74 30-Apr-2015 Satya Calloji <satyac@broadcom.com> Fixed cross key for LE when paired over BR-EDR

SMP state machine was resending security request and waiting for a response
when paired over BR-EDR. The state machine state timed out due to this and
SMP failed while doing cross key pairing. Thus, user was asked for pairing
again.

Original author: Priti Aghera <paghera@broadcom.com>
Change-Id: I568f936bb7bee21fb78e8454469ecad3445f026f
/system/bt/stack/smp/smp_act.c
d0aa8e53aa7ac1137a47570e08c2b963aaa49141 06-May-2015 Satya Calloji <satyac@broadcom.com> Fix SMP pairing request issue on LE

The cause of the failure:
- the master device sent the three keys to slave, but slave only receive
two and got the link drop before the third key is received.
- the slave device treats it as pairing failure due to the key missing.
SMP should wait for all keys been sent to controller before dropping the link.

Implement L2CAP fix channel tx_complete callback for this reason,
and it has been applied on the channel 6 (SMP).
Channel 7 (BR_SMP channel) was not keeping track of total_tx_unacked
number and closed the link too early. Added check in the
smp_br_key_distribution() and the ACL data tracking there before
posting SMP_BR_AUTH_CMPL_EVT.

Original author: Chaojing Sun <cjsun@broadcom.com>

Change-Id: If48a4c5e28b1d177f14ff089e8dfa3ace41eba83
/system/bt/stack/smp/smp_act.c
877123f5b9df90e7a71ea7b15997c521229decc1 24-Apr-2015 Satya Calloji <satyac@broadcom.com> Static address is seen on scanner after unpairing

Fix for bonded devices that cannot be removed from resolving list when
scanning, advertising or when a connection is being initiated.
Suspend all active adv, scanning or connection initiation upon
completion of any resolving list operation.

Original author: Chaojing Sun <cjsun@broadcom.com>
Change-Id: Id104dace2944b1878eaf65b93aba3d01e477191d
/system/bt/stack/smp/smp_act.c
1287166da9c34f041d54a78800b79cb2738675a9 09-May-2015 Andre Eisenbach <eisenbach@google.com> DO NOT MERGE Fix compilation on platforms with BLE_INCLUDED == FALSE

This is not a comprehensive fix. More work is necessary to ensure the
correct separation of BLE_INCLUDED TRUE/FALSE as well as removing many
of the hacked-up if() statements resulting from this patch.

Change-Id: I1812594feba0bf43369096e472a8b18cde305255
/system/bt/stack/smp/smp_act.c
e28055315f96c0d06e73a66a9bb06df85247b5a7 22-Apr-2015 Chaojing Sun <cjsun@broadcom.com> Cross transport key mapping fixes

Change-Id: I22d97303054eccc876c4a9c7c0a50e369ff4fa62
/system/bt/stack/smp/smp_act.c
444a8da807abaf5f9e813ce70c56a79160495fb3 06-Mar-2015 Satya Calloji <satyac@broadcom.com> LE Privacy 1.2 and LE secure connections

Bug: 19816438
Original author: Chaojing Sun <cjsun@broadcom.com>
Change-Id: I5951f4d4e038f8348a62aa6d19b2111bae0b3ecc
/system/bt/stack/smp/smp_act.c
c918d08763ec547f7f226553ab75ca885db357ac 17-Sep-2014 Andre Eisenbach <eisenbach@google.com> Document LE IO capabilities and use BR/EDR constant for LE

This removes a hack to set LE IO capabilities and reuses the existing
constant defined in bt_target.h.

Change-Id: I3c97629bd092ac78bd673afc29458775b2bce836
/system/bt/stack/smp/smp_act.c
98283bb879d26d0c29a76988e1bffebd6f730fc5 09-Sep-2014 Priti Aghera <paghera@broadcom.com> Fixed SMP pairing failure due to race condition

SMP pairing failure if remote send security request before master
side receive LE link connection callback. The racing condition will
cause master side bonding failure upon ignoring remote security request
and flush out all SMP information. Retain SMP information when a
locally initiated pairing is in process solves the problem.

Bug: 17412687
Change-Id: Ia2256160c866413f93c6f49e5db82b4c6489d9d2
/system/bt/stack/smp/smp_act.c
2772dac59971dd9c135cfac73a1ba77a912324f4 17-Jul-2014 Thomas.TT_Lin <Thomas.TT_Lin@htc.com> Bluetooth: fix the HOGP device(iBUFFALO BSMBB09DS) pair and reconnect problem.

in bta_hh_le.c (fix reconnect issue)
Since new LE security flags are import, (BTM_SEC_LE_AUTHENTICATED, BTM_SEC_LE_ENCRYPTED,
BTM_SEC_LE_NAME_KNOWN, BTM_SEC_LE_LINK_KEY_KNOWN, BTM_SEC_LE_LINK_KEY_AUTHED),
we have to use new BTM_GetSecurityFlagsByTransport() function with LE transport to get right sec_flag,
or will cause cannot correctly add to white list and cause reconnect fail.

in btif_dm.c (fix HOGP mouse pair issue)
the HOGP mouse will become abnormal if we update connection parameter too many times.
Therefore the is_hid case is not suitable for HOGP mouse,
it will trigger call to L2CA_EnableUpdateBleConnParams() several times due to service discovery and bonded state.
L2CA_EnableUpdateBleConnParams() update connection cause mouse abnormal.
The change will make the flow: complete bonding procedure first, then do service discovery, connect to mouse.

in gap_ble.c (fix HOGP device pair issue)
After pairing status is bonded, host start to create ATT layer to get some information from HOGP device.
If host send "disconnect" command during period. Device will stop to feedback anything.
Suggest to delete it.

in smp_act.c (fix HOGP device pair issue)
update connection parameter too many times may cause mouse abnormal,
so remove this code since this will be called again after service discovery.
Suggest to delete it.

Change-Id: I4b722343c2b08d33530bc6b928bc9ffe89fd09e9
Signed-off-by: Thomas.TT_Lin <Thomas.TT_Lin@htc.com>
/system/bt/stack/smp/smp_act.c
7475a5098339d763aa6e3a0374ee2f1c16e002c4 21-Feb-2014 Nitin Arora <niarora@codeaurora.org> Bluetooth: Adds SMP response timer for security request

This adds timer to cancel security request from remote if there
is no response from user for pairing popup.

Change-Id: I18694dcc5275a1eb10de4ad921b6baca189b42fa
/system/bt/stack/smp/smp_act.c
b44cc59d286ad255e872c60df02e032bd8d9d75b 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: AVRC, MCA, GATT, and SMP.

Change-Id: I6d1e61ff023b5fd19f144955cff16831cc18c6e6
/system/bt/stack/smp/smp_act.c
8fe58875ce67c6e1099e7ba2339dcd2b979491b0 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42
/system/bt/stack/smp/smp_act.c
5f72121ddc2f0249e896e19b186a05888bce2331 10-Feb-2014 Zhihai Xu <zhihaixu@google.com> support peripheral mode feature to connect iphone to android device.

enable BLE_PERIPHERAL_MODE_SUPPORT flag and fix the bug
the discoverability flag is not set in advertisement packet,
which cause the central device(iphone) can not find android device
during scan.
use displayOnly IO cap for dory, so dory can display the pin,
and the iphone(central device) will input the pin.
bug:12797572

Change-Id: Ie15ea9e340e3692df846399b9a85aa6d2a97eba7
/system/bt/stack/smp/smp_act.c
5cd8bff2dd0337cb52bf48f312e3d2d55a8882fb 01-Feb-2014 Mike J. Chen <mjchen@google.com> Major warnings cleanup

Mostly fixing unused parameter warnings.
A few other warnings also fixed like possible use of
unitialized variables (no real issue found, just compiler couldn't
follow the path), signed vs unsigned warning.

Also fixed some typos, indent issues, removal of dead code, etc.

Change-Id: I95eb887aefc4d559d7921f71a0af5f3bfb01ac01
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/stack/smp/smp_act.c
58440603564a1f43ef27b3bf738d9d6177b7b9ee 16-Nov-2013 Zhihai Xu <zhihaixu@google.com> BLE Secuity manager state machine generate wrong pairing success event.

we call smp_proc_release_delay to setup a timer.
We will send a pair failure message to uplayer after the time expired.
Right before the time expire, the l2cap connection is disconnected
from remote device, we receive L2C_DISC, which will call smp_delay_terminate,
smp_delay_terminate will send a pair success message to uplayer.
The fix is not to change the status if the remote device disconnect the link

bug:11716967
Change-Id: I8ca63599a170ec86913785aafea552301cec37df
/system/bt/stack/smp/smp_act.c
6975b4d711142b885af479721cada448952c6b41 06-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: UPF 45 bug fixes

This change fixes the following issues:
- Second GATT-over-BR/EDR channel cannot be established when there
already is an existing GATT-over-BR/EDR channel
- If encryption fails for an LE connection due to a missing key,
the security state is not being cleared and blocks all further
security processing
- When DM discovery of an LE Peripheral device fails with a
connection timeout, no further discovery requests can be made
- GATT service discovery can get into endless loop when duplicate descriptor
definitions are found on the remote device
- When GATT over BR/EDR fails, BTA does not give a connection
callback to the application initiating the connection
- BR/EDR connection to remote platform does not generate API callbacks
- Stack crash discovered during UPF after remote disconnects
- The host is sending HCI disconnect to invalid HCI handle when
SMP fails because of a connection timeout
- Possible race condition:
If a disconnect is immediately followed by a connection complete,
the connection complete cannot be processed in the BTA GATT state
machine
- Write Complete event is not triggered for Prepare Write requests

Change-Id: I539cdedd68007818ff4f0d0213cee1c913f72d0f

Conflicts:
bta/gatt/bta_gatts_act.c
/system/bt/stack/smp/smp_act.c
2d41fe1c5dbac701a074eec272545439168930a7 17-Apr-2013 Andre Eisenbach <andre@broadcom.com> LE: Disable L2CAP connection parameter update during pairing

Some peripherals change the connection parameters during the pairing
procedure. Ideally when service discovery is started, connection
parameters are reset to default values. In instances where the
connection update fails, service discovery takes a very long time and
may result in a GATT application not receiving a connection status
update.
Disabling connection paramter update during service discovery ensures
a quick service discovery and improves interoperability.

Bug: 8714594
Change-Id: I2177e57bf250b99e314a1b020cd0fadbd480214e
/system/bt/stack/smp/smp_act.c
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

Change-Id: I9825a5cef9be2559c34c2a529b211b7d471147cf
/system/bt/stack/smp/smp_act.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/stack/smp/smp_act.c