mirror of
https://github.com/anope/anope.git
synced 2026-07-10 23:23:13 +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:
@@ -184,14 +184,12 @@ class ESHA1 : public Module
|
||||
SHA1_CTX context;
|
||||
char digest[21] = "";
|
||||
Anope::string buf = "sha1:";
|
||||
Anope::string cpass;
|
||||
|
||||
SHA1Init(&context);
|
||||
SHA1Update(&context, reinterpret_cast<const unsigned char *>(src.c_str()), src.length());
|
||||
SHA1Final(reinterpret_cast<unsigned char *>(digest), &context);
|
||||
|
||||
b64_encode(digest, cpass);
|
||||
buf += cpass;
|
||||
buf += Anope::Hex(digest, 20);
|
||||
Alog(LOG_DEBUG_2) << "(enc_sha1) hashed password from [" << src << "] to [" << buf << "]";
|
||||
dest = buf;
|
||||
return EVENT_ALLOW;
|
||||
|
||||
Reference in New Issue
Block a user