From e4a5cd056eb03745e295dd523d2dc1b05bd00f06 Mon Sep 17 00:00:00 2001 From: Louvenarde Date: Sun, 11 Feb 2024 15:42:51 +0100 Subject: [PATCH] Fix MAC-based machine entropy generation --- src/Components/Modules/Auth.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Components/Modules/Auth.cpp b/src/Components/Modules/Auth.cpp index 36b49af3..0c5dc938 100644 --- a/src/Components/Modules/Auth.cpp +++ b/src/Components/Modules/Auth.cpp @@ -566,23 +566,21 @@ namespace Components { switch (pIpAdapterInfo->Type) { - default: - pIpAdapterInfo = pIpAdapterInfo->Next; - continue; - - case IF_TYPE_IEEE80211: - case MIB_IF_TYPE_ETHERNET: - { - - std::string macAddress{}; - for (size_t i = 0; i < ARRAYSIZE(pIpAdapterInfo->Address); i++) + case IF_TYPE_IEEE80211: + case MIB_IF_TYPE_ETHERNET: { - entropy += std::to_string(pIpAdapterInfo->Address[i]); - } - break; - } + std::string macAddress{}; + for (size_t i = 0; i < ARRAYSIZE(pIpAdapterInfo->Address); i++) + { + entropy += std::to_string(pIpAdapterInfo->Address[i]); + } + + break; + } } + + pIpAdapterInfo = pIpAdapterInfo->Next; } }