summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-09 08:49:00 +0000
committerDukePyrolator <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>2010-01-09 08:49:00 +0000
commit5e62e8f22e94c975159e1800732cb2740c18d50b (patch)
treef3551b11b8a21f36afa8f5d8b594536e4ccc7b9c /include
parenta4b015b39d0e232121e060466a979277f0f28ce2 (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/account.h6
-rw-r--r--include/extern.h15
-rw-r--r--include/modules.h9
3 files changed, 11 insertions, 19 deletions
diff --git a/include/account.h b/include/account.h
index 0516b5fe9..02e6508d4 100644
--- a/include/account.h
+++ b/include/account.h
@@ -75,8 +75,8 @@ class CoreExport NickRequest
NickRequest *next, *prev;
char *nick;
- char *passcode;
- char password[PASSMAX];
+ std::string passcode;
+ std::string password;
char *email;
time_t requested;
time_t lastmail; /* Unsaved */
@@ -123,7 +123,7 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag>
NickCore *next, *prev;
char *display; /* How the nick is displayed */
- char pass[PASSMAX]; /* Password of the nicks */
+ std::string pass; /* Password of the nicks */
char *email; /* E-mail associated to the nick */
char *greet; /* Greet associated to the nick */
uint32 icq; /* ICQ # associated to the nick */
diff --git a/include/extern.h b/include/extern.h
index ed9b86e40..81669993f 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -181,17 +181,10 @@ E void hostserv(User *u, char *buf);
E void HostServSyncVhosts(NickAlias *na);
/**** encrypt.c ****/
-E void initEncryption();
-E int enc_encrypt(const char *src, int len, char *dest, int size);
-E int enc_encrypt_in_place(char *buf, int size);
-E int enc_encrypt_check_len(int passlen, int bufsize);
-E int enc_decrypt(const char *src, char *dest, int size);
-E int enc_check_password(const char *plaintext, char *password);
-E void encmodule_encrypt(int (*func)(const char *src, int len, char *dest, int size));
-E void encmodule_encrypt_in_place(int (*func)(char *buf, int size));
-E void encmodule_encrypt_check_len(int (*func)(int passlen, int bufsize));
-E void encmodule_decrypt(int (*func)(const char *src, char *dest, int size));
-E void encmodule_check_password(int (*func)(const char *plaintext, const char *password));
+E int enc_encrypt(const std::string &src, std::string &dest);
+E int enc_encrypt_in_place(std::string &buf);
+E int enc_decrypt(std::string &src, std::string &dest);
+E int enc_check_password(std::string &plaintext, std::string &password);
/**** hostserv.c ****/
E void get_hostserv_stats(long *nrec, long *memuse);
diff --git a/include/modules.h b/include/modules.h
index 0656e2a4e..a15657608 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -579,11 +579,10 @@ class CoreExport Module
/** Called when anope needs to check passwords against encryption
* see src/encrypt.c for detailed informations
*/
- virtual EventReturn OnEncrypt(const char *src,int len,char *dest,int size) { return EVENT_CONTINUE; }
- virtual EventReturn OnEncryptInPlace(char *buf, int size) { return EVENT_CONTINUE; }
- virtual EventReturn OnEncryptCheckLen(int passlen, int bufsize) { return EVENT_CONTINUE; }
- virtual EventReturn OnDecrypt(const char *src, char *dest, int size) { return EVENT_CONTINUE; }
- virtual EventReturn OnCheckPassword(const char *plaintext, char *password) { return EVENT_CONTINUE; }
+ virtual EventReturn OnEncrypt(const std::string &src, std::string &dest) { return EVENT_CONTINUE; }
+ virtual EventReturn OnEncryptInPlace(std::string &buf) { return EVENT_CONTINUE; }
+ virtual EventReturn OnDecrypt(const std::string &hashm, const std::string &src, std::string &dest) { return EVENT_CONTINUE; }
+ virtual EventReturn OnCheckPassword(const std::string &hashm, std::string &plaintext, std::string &password) { return EVENT_CONTINUE; }
/** Called on fantasy command
* @param command The command