From 5e62e8f22e94c975159e1800732cb2740c18d50b Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Sat, 9 Jan 2010 08:49:00 +0000 Subject: changed all password fields to std::string and reworked the way how the enc modules handle the passwords git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2740 5417fbe8-f217-4b02-8779-1006273d7864 --- src/tools/db-convert.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/db-convert.c b/src/tools/db-convert.c index 4a82d0f82..926d263c2 100644 --- a/src/tools/db-convert.c +++ b/src/tools/db-convert.c @@ -353,7 +353,7 @@ int main(int argc, char *argv[]) NickCore *nc; char **access; Memo *memos; - int j; + int j, len; char cpass[5000]; // if it's ever this long, I will commit suicide for (nc = nclists[i]; nc; nc = nc->next) { @@ -370,7 +370,18 @@ int main(int argc, char *argv[]) } // Enc pass - b64_encode(nc->pass, hashm == "plain" ? strlen(nc->pass) : 32, (char *)cpass, 5000); + if (hashm == "plain") + len = strlen(nc->pass); + else if (hashm == "md5") + len = 16; + else if (hashm == "sha1") + len = 20; + else if (hashm == "old") + len = 16; + else + len = 32; + + b64_encode(nc->pass, len, (char *)cpass, 5000); fs << "NC " << nc->display << " " << hashm << ":" << cpass << " "; fs << " " << GetLanguageID(nc->language) << " " << nc->memos.memomax << " " << nc->channelcount << std::endl; -- cgit