mirror of
https://github.com/anope/anope.git
synced 2026-07-04 14:33:15 +02:00
Fixed db-convert and enc_old to work when converting databases using enc_old
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2776 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+3
-3
@@ -348,7 +348,7 @@ class EOld : public Module
|
||||
char digest[33], digest2[33];
|
||||
char cpass[1000];
|
||||
int i;
|
||||
std::string buf = "old:";
|
||||
std::string buf = "oldmd5:";
|
||||
|
||||
memset(&context, 0, sizeof(context));
|
||||
memset(&digest, 0, sizeof(digest));
|
||||
@@ -374,14 +374,14 @@ class EOld : public Module
|
||||
|
||||
EventReturn OnDecrypt(const std::string &hashm, const std::string &src, std::string &dest )
|
||||
{
|
||||
if (hashm != "old")
|
||||
if (hashm != "oldmd5")
|
||||
return EVENT_CONTINUE;
|
||||
return EVENT_STOP;
|
||||
}
|
||||
|
||||
EventReturn OnCheckPassword(const std::string &hashm, std::string &plaintext, std::string &password)
|
||||
{
|
||||
if (hashm != "old")
|
||||
if (hashm != "oldmd5")
|
||||
return EVENT_CONTINUE;
|
||||
std::string buf;
|
||||
this->OnEncrypt(plaintext, buf);
|
||||
|
||||
@@ -376,14 +376,14 @@ int main(int argc, char *argv[])
|
||||
len = 16;
|
||||
else if (hashm == "sha1")
|
||||
len = 20;
|
||||
else if (hashm == "old")
|
||||
else if (hashm == "oldmd5")
|
||||
len = 16;
|
||||
else
|
||||
len = 32;
|
||||
|
||||
b64_encode(nc->pass, len, (char *)cpass, 5000);
|
||||
|
||||
fs << "NC " << nc->display << " " << hashm << ":" << cpass << " ";
|
||||
fs << "NC " << nc->display << " " << hashm << ":" << cpass;
|
||||
fs << " " << GetLanguageID(nc->language) << " " << nc->memos.memomax << " " << nc->channelcount << std::endl;
|
||||
|
||||
std::cout << "Wrote account for " << nc->display << " passlen " << strlen(cpass) << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user