mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
Support PIN-required auth servers
This commit is contained in:
parent
f247d53309
commit
62a49644a5
9 changed files with 271 additions and 13 deletions
28
include/auth/pin_auth.hpp
Normal file
28
include/auth/pin_auth.hpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace wowee {
|
||||
namespace auth {
|
||||
|
||||
struct PinProof {
|
||||
std::array<uint8_t, 16> clientSalt{};
|
||||
std::array<uint8_t, 20> hash{};
|
||||
};
|
||||
|
||||
// Implements the "PIN" security extension used in the WoW auth protocol (securityFlags & 0x01).
|
||||
// Algorithm based on documented client behavior:
|
||||
// - Remap digits using pinGridSeed (a permutation of 0..9)
|
||||
// - Convert user-entered PIN digits into randomized indices in that permutation
|
||||
// - Compute: pin_hash = SHA1(client_salt || SHA1(server_salt || randomized_pin_ascii))
|
||||
//
|
||||
// PIN must be 4-10 ASCII digits.
|
||||
PinProof computePinProof(const std::string& pinDigits,
|
||||
uint32_t pinGridSeed,
|
||||
const std::array<uint8_t, 16>& serverSalt);
|
||||
|
||||
} // namespace auth
|
||||
} // namespace wowee
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue