OSDN Git Service

InternalEnforceSecurityPolicy: Check if record is temporary
authorHansong Zhang <hsz@google.com>
Wed, 19 Aug 2020 23:41:21 +0000 (16:41 -0700)
committerHansong Zhang <hsz@google.com>
Fri, 21 Aug 2020 18:31:43 +0000 (11:31 -0700)
If we want AUTHENTICATED_ENCRYPTED_TRANSPORT, temporary link key is not
sufficient.  Pair again.

Test: cert/run --host
Tag: #gd-refactor
Bug: 141555841
Change-Id: I9a5b4b08fdd22d6c453443f6315b3f136913b516

gd/security/internal/security_manager_impl.cc

index 751a69b..b2d065e 100644 (file)
@@ -720,7 +720,7 @@ void SecurityManagerImpl::InternalEnforceSecurityPolicy(
   switch (policy) {
     case l2cap::classic::SecurityPolicy::BEST:
     case l2cap::classic::SecurityPolicy::AUTHENTICATED_ENCRYPTED_TRANSPORT:
-      if (!record->IsPaired()) {
+      if (!record->IsPaired() || record->IsTemporary()) {
         need_to_pair = true;
       } else if (record->IsAuthenticated()) {
         // if paired with MITM, only encryption is missing, so we just need to wait for encryption change callback