• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisãoa950098d66721ad689daef1c6ed2ee615a9d7feb (tree)
Hora2019-06-11 10:52:39
AutorJakub Pawlowski <jpawlowski@goog...>
CommiterNikoli Cartagena

Mensagem de Log

DO NOT MERGE Fix for Bluetooth connection being dropped after HCI Read Encryption Key Size

If remote device stop the encryption before we call "Read Encryption Key Size",
we might receive Insufficient Security, which means that link is no longer
encrypted.

In such cases we should stay connected, rather than disconnecting the
link.

Test: Connect to device that stop encryption right after encryption is
complete, i.e. to change roles.
Bug: 124301137
Bug: 132626699

Change-Id: Iab0fd9f357d18a6b048b971d0393fbb47fd4d793
Merged-In: Iab0fd9f357d18a6b048b971d0393fbb47fd4d793
(cherry picked from commit c978f86b506f31567b5991c91cdbe4c142ca8edd)

Mudança Sumário

Diff

--- a/stack/btu/btu_hcif.cc
+++ b/stack/btu/btu_hcif.cc
@@ -733,6 +733,14 @@ static void read_encryption_key_size_complete_after_encryption_change(
733733 << std::to_string(key_size);
734734 }
735735
736+ if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
737+ /* If remote device stop the encryption before we call "Read Encryption Key
738+ * Size", we might receive Insufficient Security, which means that link is
739+ * no longer encrypted. */
740+ LOG(INFO) << __func__ << ": encryption stopped on link: " << loghex(handle);
741+ return;
742+ }
743+
736744 if (status != HCI_SUCCESS) {
737745 LOG(INFO) << __func__ << ": disconnecting, status: " << loghex(status);
738746 btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);
@@ -1694,6 +1702,14 @@ static void read_encryption_key_size_complete_after_key_refresh(
16941702 << std::to_string(key_size);
16951703 }
16961704
1705+ if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
1706+ /* If remote device stop the encryption before we call "Read Encryption Key
1707+ * Size", we might receive Insufficient Security, which means that link is
1708+ * no longer encrypted. */
1709+ LOG(INFO) << __func__ << ": encryption stopped on link: " << loghex(handle);
1710+ return;
1711+ }
1712+
16971713 if (status != HCI_SUCCESS) {
16981714 LOG(INFO) << __func__ << ": disconnecting, status: " << loghex(status);
16991715 btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);