OSDN Git Service

smp: Log if remote lmp_version is invalid
authorChris Manton <cmanton@google.com>
Sat, 7 Nov 2020 06:06:24 +0000 (22:06 -0800)
committerChris Manton <cmanton@google.com>
Sat, 7 Nov 2020 06:39:16 +0000 (22:39 -0800)
Unread, missing or late remote version info will force
drop from secure into legacy security mode

Bug: 163134718
Tag: #refactor
Test: Paired 2 phones using LE/nRF

Change-Id: I1e52ac96354981b6abbfc1d46e4323becf25b388

stack/smp/smp_act.cc

index 91a4570..ca1a6cc 100644 (file)
@@ -166,8 +166,13 @@ void smp_send_app_cback(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) {
             p_cb->loc_auth_req |= SMP_SC_SUPPORT_BIT;
           }
 
-          BTM_ReadRemoteVersion(p_cb->pairing_bda, &remote_lmp_version, nullptr,
-                                nullptr);
+          if (!BTM_ReadRemoteVersion(p_cb->pairing_bda, &remote_lmp_version,
+                                     nullptr, nullptr)) {
+            LOG_WARN(
+                "SMP Unable to determine remote security authentication "
+                "remote_lmp_version:%hu",
+                remote_lmp_version);
+          }
 
           if (!p_cb->secure_connections_only_mode_required &&
               (!(p_cb->loc_auth_req & SMP_SC_SUPPORT_BIT) ||