From 7ac0f1c9a2aea7982257b338c1fdf1cc417731f0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 23 Sep 2025 09:49:03 -0500 Subject: [PATCH] dry --- esphome/components/esphome/ota/ota_esphome.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/esphome/ota/ota_esphome.cpp b/esphome/components/esphome/ota/ota_esphome.cpp index 039950bee1..eaffbb0705 100644 --- a/esphome/components/esphome/ota/ota_esphome.cpp +++ b/esphome/components/esphome/ota/ota_esphome.cpp @@ -554,16 +554,14 @@ bool ESPHomeOTAComponent::perform_hash_auth_(HashBase *hasher, const std::string hasher->init(); // Generate nonce seed bytes - uint32_t r1 = random_uint32(); - uint32_to_bytes(r1, nonce_bytes); + uint32_to_bytes(random_uint32(), nonce_bytes); if (nonce_len == 4) { // MD5: 4 bytes from one random uint32 hasher->add(nonce_bytes, 4); } else { // SHA256: 8 bytes from two random uint32s - uint32_t r2 = random_uint32(); - uint32_to_bytes(r2, nonce_bytes + 4); + uint32_to_bytes(random_uint32(), nonce_bytes + 4); hasher->add(nonce_bytes, 8); } hasher->calculate();