diff --git a/src/darwin/Framework/CHIPTests/MTRBleTests.m b/src/darwin/Framework/CHIPTests/MTRBleTests.m index 4aacf95856317e..8ec6698ced0bf5 100644 --- a/src/darwin/Framework/CHIPTests/MTRBleTests.m +++ b/src/darwin/Framework/CHIPTests/MTRBleTests.m @@ -137,9 +137,9 @@ - (void)testBleCommissionAfterStopBrowseUAF XCTAssertTrue([sController stopBrowseForCommissionables]); // Attempt to use the MTRCommissionableBrowserResult after we stopped browsing - // TODO: This currently results in a UAF because BLE_CONNECTION_OBJECT is a void* + // This used to result in a UAF because BLE_CONNECTION_OBJECT is a void* // carrying a CBPeripheral without retaining it. When browsing is stopped, - // BleConnectionDelegateImpl release all cached CBPeripherals. + // BleConnectionDelegateImpl releases all cached CBPeripherals. MTRSetupPayload * payload = [[MTRSetupPayload alloc] initWithSetupPasscode:@54321 discriminator:@0x444]; [sController setupCommissioningSessionWithDiscoveredDevice:device payload:payload @@ -157,7 +157,7 @@ - (void)testShutdownBlePowerOffRaceUAF XCTAssertTrue([sController setupCommissioningSessionWithPayload:payload newNodeID:@999 error:&error], "setupCommissioningSessionWithPayload failed: %@", error); - // Create a race between shutdown and a CBManager callback that provokes a UAF + // Create a race between shutdown and a CBManager callback that used to provoke a UAF. // Note that on the order of 100 iterations can be necessary to reproduce the crash. __block atomic_int tasks = 2; dispatch_semaphore_t done = dispatch_semaphore_create(0); diff --git a/src/platform/Darwin/BlePeripheral.h b/src/platform/Darwin/BlePeripheral.h deleted file mode 100644 index 99d081d3147e92..00000000000000 --- a/src/platform/Darwin/BlePeripheral.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * - * Copyright (c) 2025 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#if !__has_feature(objc_arc) -#error This file must be compiled in ObjC++ mode with ARC. -#endif - -#include - -#import - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -// Holds a CBPeripheral and the associated CBCentralManager -struct BlePeripheral -{ - CBPeripheral * const peripheral; - CBCentralManager * const centralManager; - - BlePeripheral(CBPeripheral * aPeripheral, CBCentralManager * aCentralManager) : - peripheral(aPeripheral), centralManager(aCentralManager) - {} -}; - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip