summaryrefslogtreecommitdiff
path: root/system/stack/smp
AgeCommit message (Collapse)Author
2025-03-16Merge changes I786b1559,If55ae134,I9b9fc531,Ib826cf23,Ice6aa59f into main Jakub Pawłowski
* changes: Remove flag key_missing_classic_device Remove flag smp_state_machine_stuck_after_disconnection_fix Remove flag sec_disconnect_on_le_key_missing Remove flag encryption_change_v2 Remove flag l2cap_le_do_not_adjust_min_interval
2025-03-14Remove flag smp_state_machine_stuck_after_disconnection_fix Jakub Pawlowski
Bug: 376306092 Test: mma -j32 Change-Id: If55ae134c2bc03ec86cbc0989b5d9faded670d56
2025-03-13stack: Inline methods from stack_metrics_logging.h Henri Chataing
Bug: 401588157 Test: m com.android.bt Flag: EXEMPT, no logical change Change-Id: I1cf4a5e3664f4afc3eb2cfebbf23642c568403a4
2025-01-29Merge "Disconnect when central lost keys" into main am: 6e62832932 am: ↵ Jakub Pawłowski
382899a416 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3464778 Change-Id: I797c64a3704b51e465546f4b3bc6fb72be20f5a1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-28Disconnect when central lost keys Jakub Pawlowski
Another improvement for KEY_MISSING handling Bug: 392895615 Bug: 385202810 Test: reconnect to central that removed bond Flag: com::android::bluetooth::flags::key_missing_ble_peripheral Change-Id: I3c8b7989f6494ae2aa20c2bc87ffced799fb7cd8
2025-01-24Merge "Reject SMP pairing SMP_BUSY error while host is in pairing with ↵ Himanshu Rawat
another device" into main am: ffb94de004 am: 06c8f43bab Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3388830 Change-Id: I6dd9cb16999298dd7e38840c0781c01c67b3f28d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-24Merge "Reject SMP pairing SMP_BUSY error while host is in pairing with ↵ Himanshu Rawat
another device" into main
2025-01-16Remove flag btsec_le_oob_pairing Brian Delwiche
Test: m libbluetooth Bug: 374376990 Bug: 315241296 Flag: com.android.bluetooth.flags.btsec_le_oob_pairing Ignore-AOSP-First: security Tag: #security Change-Id: I3e4b0ca2f191b0bd1e27bd933b84ed4e900ba971
2025-01-08Reject SMP pairing SMP_BUSY error while host is in pairing with another device Pragati
Steps to reproduce: |- 1. Turn on BT 2. Iniatited LE SMP pairing with remote 1 3. Initiate pairing from remote2 to DUT Expected result: DUT should reject the SMP pairing req from remote2 with SMP_BUSY error - Observed result: NA. its new feature from bluetooth specification 6.0 Fix: Reject SMP pairing SMP_BUSY error while host is in pairing with another device Test: atest automated-test bug: 381996349 Flag: EXEMPT bugfix Change-Id: I3f07864a9258bc8457e4d5e3f37e4ca717f42aa0
2024-12-18Merge "Fix 0 key size for LE link" into main am: 8106c85bf0 am: 8b53b93c14 Gopi Sakshihally Bhuthaiah (xWF)
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3416204 Change-Id: I75292e6e3d99b6cef0fc7d4d8dd9c4b20158347e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-18Fix 0 key size for LE link Jakub Pawlowski
If it's first encryption between devices, during pairing, we don't have the keys stored. They are remembered in the SMP control block to be stored after encryption is successfull. Bug: 383249088 Test: see b/383249088 it talks about test implementation Test: mma -j32; Flag: exempt, trivial fix Change-Id: I9596393315630b9ba2d4252326c59126ec12c66a
2024-12-16Merge "system: Convert base::StringPrintf to std::format" into main am: ↵ Henri Chataing
8c74fcfb8b am: b99dcfa40f Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3407745 Change-Id: I3204b9b49e3e1fb088d73d3af325876f62b9d2bd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-12-12system: Convert base::StringPrintf to std::format Henri Chataing
Bug: 331817295 Test: m com.android.btservices Flag: EXEMPT, mechanical refactor Change-Id: Ib6933af3c28a1d429ea0cb6e3eae05b53fc9f2b4
2024-11-28Merge "Add `identity_address_type` to `leAddressAssociateCallback`" into ↵ Treehugger Robot
main am: 54edfd681f am: 8a90921ed0 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3350345 Change-Id: Ie565ed32d5a7e389d184f7e8d2e4cc44dc4e9831 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-28Add `identity_address_type` to `leAddressAssociateCallback` Ömer Faruk Yılmaz
Bug: 377171798 Bug: 373899888 Test: m com.android.btservices Change-Id: I104bc3db91a97e83f6190a34dafed2881e5d5736
2024-11-21Merge "system: Migrate from {fmt} to std::format" into main am: 3723874896 ↵ Henri Chataing
am: 648e440e0d Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3345590 Change-Id: I803c2c60053beaf4439a7090b0daa8dd0c7cfba4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-20system: Migrate from {fmt} to std::format Henri Chataing
Bug: 305066880 Test: m com.android.btservices Flag: EXEMPT, log change Change-Id: If1dbab99250a4f62626206fc9f73d27e71ebab56
2024-11-16Merge changes Ib4cc9a32,I92c38b84 into main am: 9d8f2d794d am: 46c372537a Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3348166 Change-Id: I7af00798d7bb88fd52162019ed9205fafb118b42 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-11-15BluetoothMetrics: Log the bluetooth event for SMP pairing fail Palash Ahuja
Test: m statsd_testdrive && statsd_testdrive -terse 916 Bug: 375437118 Flag: EXEMPT, metrics logging Change-Id: Ib4cc9a320fb25dff08c7c838a48931c8a6f525a7
2024-11-14Fix authentication bypass bug in SMP Brian Delwiche
It is possible for a malicious peer to bypass SMP authentication by claiming to have OOB data and proceeding with pairing, exploiting the fact that the Android stack sets the OOB randomizer to zero if no local OOB data is available. Drop the connection if a peer claims it has OOB data but no local OOB data has been stored. Bug: 251514171 Bug: 374376990 Test: m com.android.btservices Flag: com.android.bluetooth.flags.btsec_le_oob_pairing Ignore-AOSP-First: security Tag: #security Change-Id: I284b9581648b1f6e15eee371a39517c634d289fd
2024-11-08cpplint: fix and enable whitespace/blank_line William Escande
Bug: 364967694 Test: m . Flag: Exempt refactor Change-Id: Ic26c9b0305b76f66a461a4449845a8ca10726c36
2024-11-08cpplint: fix and enable whitespace/newline William Escande
Done with a combination of: sed -i 'N;s|\(^ *// .*\)\n\( *else.*\)|\2\n\1|;P;D' $i sed -i 'N;s|\(^ */\* .*\)\n\( *else.*\)|\2\n\1|;P;D' $i sed -i 'N;s|\(^ */\*\* .*\)\n\( *else.*\)|\2\n\1|;P;D' $i sed -i 'N;s|\(^ *\* .*\)\n\( *else.*\)|\2\n\1|;P;D' $i + repo upload formatter Bug: 364967694 Test: m . Flag: Exempt refactor Change-Id: Ie1af09932f2508da5ed94c625b8c4052ab2c1e78
2024-11-04Fix state machine stuck after disconnection Jakub Pawlowski
1. Connect on LE transport to dual mode device 2. Initiate pairing, control block will contain RPA as remote address 2. Obtain Identity Address, perform CTKD, generate Classic keys 3. Connect on Classic transport, start encryption 4. Encryption success, try reading the key size 5. Suddenly, connection times out, disconnection event is received Current behavior: Disconnection is not matched with the pairing device address. We stay stuck in pairing state. With fix: We check if RPA from control block belongs to same device that disconnected, and if so pass this event to state machine that would clean up the control block. Bug: 376306092 Bug: 369095269 Test: none Flag: com.android.bluetooth.flags. smp_state_machine_stuck_after_disconnection_fix Change-Id: I53bc0a4a8ac124dc20b4e9a1a30bb579653ef5a1
2024-10-30system/stack/smp: Fix -Wmissing-prototype errors Henri Chataing
Bug: 369381361 Test: m com.android.btservices Flag: EXEMPT, no logical change Change-Id: I5d849b9f46bc5e113833821703b2a328396b35d2
2024-10-17Remove os/log.h Henri Chataing
The logging macros within have long been removed, this is just cleanup work to inline the included headers where necessary Bug: 331817295 Test: m com.android.btservices Flag: EXEMPT, no logical change Change-Id: I2147ce4bdcea977b92318b2cb96e7020a8958161
2024-09-25Enforce -Wmissing-prototypes Henri Chataing
This lint check will raise an error if a function is implemented without a corresponding prototype declaration included in scope. The main use case will be to ensure mock functions do not become out of sync causing the original function to be linked instead. Because of the large amount of errors, this change suppresses errors in all locations, to be cleaned up gradually. Bug: 369381361 Test: m com.android.btservices Flag: EXEMPT, lint fixes Change-Id: I888b5e284e237d8a6e2864bdde55c0a7fc0c348d
2024-09-1824q2 flag clean: fix_le_pairing_passkey_entry_bypass William Escande
Bug: 321300737 Fix: 321300737 Test: m Bluetooth Flag: com.android.bluetooth.flags.fix_le_pairing_passkey_entry_bypass Change-Id: I6303ecbc65ec6a6980f1fcd7c0ec1279ac9f2953
2024-09-11[25/25] stack::l2cap encapsulate l2c_api.h Chris Manton
Bug: 343808590 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I73cdcd8ce5f46db78958782fd2568e2a3f126583
2024-09-10Save peer CSRK after ltk generation Bhakthavatsala Raghavendra
Security level at stack side is determined after the LTK generation, saving peer csrk info prior to this would result in saving security level as ZERO for peer CSRK info in to config file. This can cause clearing the MITM_AUTH flag when CSRK info is loaded in the next BT session as security level is saved as ZERO for CSRK. Saving the peer CSRK after ltk generation would help in saving the right security level Test: mmm packages/modules/Bluetooth Test: Tested with Android wear where socket connections were failing due to no MITM_AUTH after bt reset. Flag: com.android.bluetooth.flags.save_peer_csrk_after_ltk_gen Bug: 362322766 Bug: 365567905 Change-Id: I7b9061db13cdcdbe3535c913dfd29f5a30449803
2024-09-10[24/25] stack::smp Use stack::l2cap::get_interface() Chris Manton
Bug: 343808590 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ia040019afcea018048d052e3944a2e741b214061
2024-08-31Remove const qualifier for the output argument Himanshu Rawat
Payload with SMP_IO_CAP_REQ_EVT event has output arguments but tSMP_EVT_DATA is declared a const in tSMP_CALLBACK. Test: mmm packages/modules/Bluetooth Flag: EXEMPT refactor Bug: 286334644 Change-Id: If72ecdbc1abdcb9957fcedcd268046bbb51fff71
2024-08-13[4/24] Canonical form tBTM_STATUS::BTM_CMD_STARTED Chris Manton
Prepare for class enum-ify tBTM_STATUS Bug: 358402071 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ifae45f7ff698e07e03086d9ee6fb0e5f9dafe887
2024-08-09[3/24] Canonical form tBTM_STATUS::BTM_BUSY Chris Manton
Prepare for class enum-ify tBTM_STATUS Bug: 358402071 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I0d5054b64b7306bf76f521066648155a3053e213
2024-08-09[1/24] Canonical form towards class enumification tBTM_STATUS Chris Manton
Prepare for class enum-ify tBTM_STATUS Bug: 358402071 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ia2b5b36c696476db8d4fefd59b83714e8d4b1d8b
2024-08-05Remove duplicate pairing response when device is in peripheral mode Bhakthavatsala Raghavendra
Test: mmm packages/modules/Bluetooth Flag: com.android.bluetooth.flags.remove_dup_pairing_response_in_oob_pairing Bug: 265320397 Bug: 351948689 Change-Id: I53f9d57c9b330bf304f6b344ead3928327440708
2024-07-07Format: apply clang rules William Escande
Restore SpacesBeforeTrailingComments to 2 to match current style Then run clang-format -i **/**.{c,h,cc,cpp,hpp} Then fix a bunch of typo (reported by gerrit) Then fix unnecessary multiline string Then fix whitespace for disabled clang format (reported by cpplint) This is no-op Bug: 311772251 Test: mmm packages/modules/Bluetooth Flag: Exempt Format only Change-Id: If135447803a40a2a07d4630ba2195e08ef8d250c
2024-06-24Removing flag fix_pairing_failure_reason_from_remote Himanshu Rawat
Test: mmm packages/modules/Bluetooth Flag: com.android.bluetooth.flags.fix_pairing_failure_reason_from_remote Bug: 320745565 Change-Id: Ib291c9a663275d9017444af6d6d306b97c670598
2024-06-19Streamline enum stack::l2cap::tL2CAP_DW_RESULT Chris Manton
Bug: 344992630 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I58c45c5c40e155e0e4c5b6bb3bc50333ca798037
2024-06-19[14/19] get_btm_client_interface().peer.BTM_ReadRemoteVersion Chris Manton
Bug: 343772702 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I5a715234b17c2ce5f98b197a92854100dab6cb8b
2024-06-17Class-enumify stack::l2cap::tL2CAP_DW_RESULT Chris Manton
Bug: 344991872 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: I925537804979745d42b47d081130817097322ba6
2024-06-17Merge "Use proper types stack::l2cap::tL2CAP_DW_RESULT" into main Treehugger Robot
2024-06-17Use proper types stack::l2cap::tL2CAP_DW_RESULT Chris Manton
Bug: 344989901 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ic904eeea4b4a45c1fa8f1c2a99c14177847ea204
2024-06-01Merge "system::stack: Comment out unused parameters" into main am: dbcd26d9a9 Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3110320 Change-Id: Ia82ba93d10ab18f614631a547ed1f147753a104e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31system::stack: Comment out unused parameters Chris Manton
Bug: 344002694 Test: m . Flag: EXEMPT, Mechanical Refactor Change-Id: Ieec3409f2d7e35b64cf1fbbcdf20158b81736ae3
2024-05-23stack::l2cap [9/19] L2CA_RegisterFixedChannel am: 75bc73a58c Chris Manton
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3081997 Change-Id: I6cf227560fb0ae9cf3799cfcba60190f13c25c12 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-23stack::l2cap [9/19] L2CA_RegisterFixedChannel Chris Manton
Bug: 339732512 Test: m . Flag: EXEMPT, Logging Change Change-Id: Icff9977e1d3282273f4d9a821a96df036ab6f46c
2024-05-22Merge "Merge Android 24Q2 Release (ab/11526283) to aosp-main-future" into ↵ Xin Li
aosp-main-future
2024-05-21stack::l2cap [15/19] L2CA_SetIdleTimeoutByBdAddr Chris Manton
Bug: 339732512 Test: m . Flag: EXEMPT, Logging Change Change-Id: I95e5d9844e81e3f787278043650579bceff1beeb
2024-05-21stack::l2cap [10/19] L2CA_RemoveFixedChnl Chris Manton
Bug: 339732512 Test: m . Flag: EXEMPT, Logging Change Change-Id: I8a2a188c1128cdc8b150009a0ec49248d608d372
2024-05-20Merge Android 24Q2 Release (ab/11526283) to aosp-main-future Xin Li
Bug: 337098550 Merged-In: Ic6401ddfd1ea18d6f846bb8719ca798d2ef9bbf4 Change-Id: I1d6ac3427fe557c300fcbaeb8c79912139341205