1
0
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:
Naram Qashat
2010-08-08 21:53:32 -04:00
parent de7643a14f
commit bbff5ae4d3
7 changed files with 304 additions and 20 deletions
+1 -3
View File
@@ -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;