otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.56k stars 1.04k forks source link

Unhex passwords when reading database #4669

Closed ranisalt closed 2 months ago

ranisalt commented 2 months ago

Pull Request Prelude

Changes Proposed

Hashing a password with transformToSHA1 returns bytes, but the database is storing the hex representation of it instead. When reading from the database,UNHEX the field so that the bytes are read in the server.

Please do not rewrite passwords in the database to bytes since future work might require encoded hashes that are to be stored as strings (i.e. PBKDF2, scrypt or Argon2)