Loading tools/rootcanal/model/controller/link_layer_controller.cc +8 −1 Original line number Original line Diff line number Diff line Loading @@ -4329,9 +4329,11 @@ void LinkLayerController::IncomingLeEncryptConnectionResponse( model::packets::LeEncryptConnectionResponseView::Create(incoming); model::packets::LeEncryptConnectionResponseView::Create(incoming); ASSERT(response.IsValid()); ASSERT(response.IsValid()); bool success = true; // Zero LTK is a rejection // Zero LTK is a rejection if (response.GetLtk() == std::array<uint8_t, 16>{0}) { if (response.GetLtk() == std::array<uint8_t, 16>{0}) { status = ErrorCode::AUTHENTICATION_FAILURE; status = ErrorCode::AUTHENTICATION_FAILURE; success = false; } } if (connections_.IsEncrypted(handle)) { if (connections_.IsEncrypted(handle)) { Loading @@ -4339,12 +4341,17 @@ void LinkLayerController::IncomingLeEncryptConnectionResponse( send_event_(bluetooth::hci::EncryptionKeyRefreshCompleteBuilder::Create( send_event_(bluetooth::hci::EncryptionKeyRefreshCompleteBuilder::Create( status, handle)); status, handle)); } } } else { } else if (success) { connections_.Encrypt(handle); connections_.Encrypt(handle); if (IsEventUnmasked(EventCode::ENCRYPTION_CHANGE)) { if (IsEventUnmasked(EventCode::ENCRYPTION_CHANGE)) { send_event_(bluetooth::hci::EncryptionChangeBuilder::Create( send_event_(bluetooth::hci::EncryptionChangeBuilder::Create( status, handle, bluetooth::hci::EncryptionEnabled::ON)); status, handle, bluetooth::hci::EncryptionEnabled::ON)); } } } else { if (IsEventUnmasked(EventCode::ENCRYPTION_CHANGE)) { send_event_(bluetooth::hci::EncryptionChangeBuilder::Create( status, handle, bluetooth::hci::EncryptionEnabled::OFF)); } } } } } Loading Loading
tools/rootcanal/model/controller/link_layer_controller.cc +8 −1 Original line number Original line Diff line number Diff line Loading @@ -4329,9 +4329,11 @@ void LinkLayerController::IncomingLeEncryptConnectionResponse( model::packets::LeEncryptConnectionResponseView::Create(incoming); model::packets::LeEncryptConnectionResponseView::Create(incoming); ASSERT(response.IsValid()); ASSERT(response.IsValid()); bool success = true; // Zero LTK is a rejection // Zero LTK is a rejection if (response.GetLtk() == std::array<uint8_t, 16>{0}) { if (response.GetLtk() == std::array<uint8_t, 16>{0}) { status = ErrorCode::AUTHENTICATION_FAILURE; status = ErrorCode::AUTHENTICATION_FAILURE; success = false; } } if (connections_.IsEncrypted(handle)) { if (connections_.IsEncrypted(handle)) { Loading @@ -4339,12 +4341,17 @@ void LinkLayerController::IncomingLeEncryptConnectionResponse( send_event_(bluetooth::hci::EncryptionKeyRefreshCompleteBuilder::Create( send_event_(bluetooth::hci::EncryptionKeyRefreshCompleteBuilder::Create( status, handle)); status, handle)); } } } else { } else if (success) { connections_.Encrypt(handle); connections_.Encrypt(handle); if (IsEventUnmasked(EventCode::ENCRYPTION_CHANGE)) { if (IsEventUnmasked(EventCode::ENCRYPTION_CHANGE)) { send_event_(bluetooth::hci::EncryptionChangeBuilder::Create( send_event_(bluetooth::hci::EncryptionChangeBuilder::Create( status, handle, bluetooth::hci::EncryptionEnabled::ON)); status, handle, bluetooth::hci::EncryptionEnabled::ON)); } } } else { if (IsEventUnmasked(EventCode::ENCRYPTION_CHANGE)) { send_event_(bluetooth::hci::EncryptionChangeBuilder::Create( status, handle, bluetooth::hci::EncryptionEnabled::OFF)); } } } } } Loading