From fd0da4486d0ce8102e3c249573aee52ceb74b170 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Feb 2026 00:41:02 -0800 Subject: [PATCH] Fix PIN grid remap bitmask (support digits 8/9) --- src/auth/pin_auth.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auth/pin_auth.cpp b/src/auth/pin_auth.cpp index 289616ae..00293b6c 100644 --- a/src/auth/pin_auth.cpp +++ b/src/auth/pin_auth.cpp @@ -23,7 +23,8 @@ static std::array remapPinGrid(uint32_t seed) { // https://gtker.com/wow_messages/docs/auth/pin.html uint32_t v = seed; std::array remapped{}; - uint8_t used = 0; + // 10 digits => need at least 10 bits of state. + uint16_t used = 0; for (int i = 0; i < 10; ++i) { uint32_t divisor = 10 - i; uint32_t remainder = v % divisor; @@ -35,7 +36,7 @@ static std::array remapPinGrid(uint32_t seed) { continue; } if (index == remainder) { - used = static_cast(used | (1u << j)); + used = static_cast(used | (1u << j)); remapped[i] = static_cast(j); break; } @@ -105,4 +106,3 @@ PinProof computePinProof(const std::string& pinDigits, } // namespace auth } // namespace wowee -