diff options
Diffstat (limited to 'src/mmo/md5more.cpp')
-rw-r--r-- | src/mmo/md5more.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mmo/md5more.cpp b/src/mmo/md5more.cpp index 3fce5c7..4e5d2da 100644 --- a/src/mmo/md5more.cpp +++ b/src/mmo/md5more.cpp @@ -20,14 +20,24 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <algorithm> + #include "../compat/rawmem.hpp" #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" +#include "../io/read.hpp" + +#include "../net/ip.hpp" + +#include "../mmo/mmo.hpp" #include "../poison.hpp" + +namespace tmwa +{ #define X block.data // TODO - refactor MD5 into a stream, and merge the implementations @@ -103,7 +113,7 @@ AccountCrypt MD5_saltcrypt(AccountPass key, SaltString salt) VString<31> obuf; // This truncates the string, but we have to keep it like that for compatibility - SNPRINTF(obuf, 32, "!%s$%s", salt, tbuf3); + SNPRINTF(obuf, 32, "!%s$%s"_fmt, salt, tbuf3); return stringish<AccountCrypt>(obuf); } @@ -134,7 +144,7 @@ IP4Address MD5_ip(IP4Address ip) // MD5sum a secret + the IP address VString<31> ipbuf; - SNPRINTF(ipbuf, 32, "%s %s", ip, secret); + SNPRINTF(ipbuf, 32, "%s %s"_fmt, ip, secret); md5_binary obuf; MD5_to_bin(MD5_from_string(ipbuf), obuf); @@ -146,3 +156,4 @@ IP4Address MD5_ip(IP4Address ip) static_cast<uint8_t>(obuf[6] ^ obuf[7] ^ obuf[14] ^ obuf[15]), }); } +} // namespace tmwa |