mirror of
https://github.com/anope/anope.git
synced 2026-07-07 04:03:12 +02:00
Add a db-upgrade to convert base64-encoded encrypted passwords to hexadecimal strings of the raw data, add in Anope::Hex for C-style strings and added Anope::Unhex, modified the encryption modules to use Hex and Unhex.
This commit is contained in:
@@ -334,7 +334,6 @@ class EOld : public Module
|
||||
{
|
||||
MD5_CTX context;
|
||||
char digest[33] = "", digest2[17] = "";
|
||||
Anope::string cpass;
|
||||
int i;
|
||||
Anope::string buf = "oldmd5:";
|
||||
|
||||
@@ -346,8 +345,7 @@ class EOld : public Module
|
||||
for (i = 0; i < 32; i += 2)
|
||||
digest2[i / 2] = XTOI(digest[i]) << 4 | XTOI(digest[i + 1]);
|
||||
|
||||
b64_encode(digest2, cpass);
|
||||
buf += cpass;
|
||||
buf += Anope::Hex(digest2, 16);
|
||||
Alog(LOG_DEBUG_2) << "(enc_old) hashed password from [" << src << "] to [" << buf << "]";
|
||||
dest = buf;
|
||||
return EVENT_ALLOW;
|
||||
|
||||
Reference in New Issue
Block a user