diff --git a/esphome/components/esphome/ota/ota_esphome_noise.cpp b/esphome/components/esphome/ota/ota_esphome_noise.cpp index 6da0808bad..fe0a322c4d 100644 --- a/esphome/components/esphome/ota/ota_esphome_noise.cpp +++ b/esphome/components/esphome/ota/ota_esphome_noise.cpp @@ -41,15 +41,10 @@ ESPHomeOTAComponent::NoiseSession::~NoiseSession() { * "NoiseOTAInit" | magic(5) | OK,version | client_features | FEATURE_FLAGS,server_flags */ bool ESPHomeOTAComponent::noise_start_session_(uint8_t server_feature_flags) { -#ifdef USE_OTA_ENCRYPTION_PROVISIONED - // The key can be cleared between the offer and the client taking it; a - // missing key must not turn into a handshake on the all-zeros key - if (!this->noise_context_().has_psk()) { - ESP_LOGW(TAG, "Key cleared"); - this->cleanup_connection_(); - return false; - } -#endif + // Not guarded against a provisioned key being cleared between the offer and + // here: the clear is deferred 100 ms and the ack write rarely blocks, and a + // session on the zero key that load_psk then fills in fails the real + // client's MAC. Yaml keys cannot change, so no check is needed there. // Default-init: the frame buffer is always written before it is read, so // skip zeroing its 132 bytes // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)