• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

system/bt


コミットメタ情報

リビジョンc5aa5feebf558df160772fefaf271a6f3251e261 (tree)
日時2019-06-06 23:31:51
作者Jakub Pawlowski <jpawlowski@goog...>
コミッターJakub Pawlowski

ログメッセージ

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

変更サマリ

差分

--- a/stack/btu/btu_hcif.c
+++ b/stack/btu/btu_hcif.c
@@ -607,6 +607,15 @@ bool read_key_send_from_key_refresh = false;
607607
608608 static void read_encryption_key_size_complete_after_key_refresh(
609609 uint8_t status, uint16_t handle, uint8_t key_size) {
610+ if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
611+ /* If remote device stop the encryption before we call "Read Encryption Key
612+ * Size", we might receive Insufficient Security, which means that link is
613+ * no longer encrypted. */
614+ HCI_TRACE_WARNING("%s encryption stopped on link: 0x%02x", __func__,
615+ handle);
616+ return;
617+ }
618+
610619 if (status != HCI_SUCCESS) {
611620 HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status);
612621 btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);
@@ -629,6 +638,15 @@ static void read_encryption_key_size_complete_after_key_refresh(
629638
630639 static void read_encryption_key_size_complete_after_encryption_change(
631640 uint8_t status, uint16_t handle, uint8_t key_size) {
641+ if (status == HCI_ERR_INSUFFCIENT_SECURITY) {
642+ /* If remote device stop the encryption before we call "Read Encryption Key
643+ * Size", we might receive Insufficient Security, which means that link is
644+ * no longer encrypted. */
645+ HCI_TRACE_WARNING("%s encryption stopped on link: 0x%02x", __func__,
646+ handle);
647+ return;
648+ }
649+
632650 if (status != HCI_SUCCESS) {
633651 HCI_TRACE_WARNING("%s: disconnecting, status: 0x%02x", __func__, status);
634652 btsnd_hcic_disconnect(handle, HCI_ERR_PEER_USER);