From 9a0b1efc24e84c7cf17a0e87c98fd1e22fe1c356 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Mon, 2 Nov 2009 05:22:35 +0000 Subject: added a way to load multiple encryption modules at the same and to switch between encryption methods git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2602 5417fbe8-f217-4b02-8779-1006273d7864 --- include/extern.h | 5 +++-- include/modules.h | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/extern.h b/include/extern.h index eda18ebc0..c73a27de0 100644 --- a/include/extern.h +++ b/include/extern.h @@ -405,13 +405,14 @@ E long unsigned int UserKey3; E int convert_ircservices_44(); /**** encrypt.c ****/ -E char *EncModule; +E char **EncModuleList; +E int EncModulesNumber; 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, const char *password); +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)); diff --git a/include/modules.h b/include/modules.h index 4cdbdaacc..021276dce 100644 --- a/include/modules.h +++ b/include/modules.h @@ -607,7 +607,7 @@ class CoreExport Module 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, const char *password) { return EVENT_CONTINUE; } + virtual EventReturn OnCheckPassword(const char *plaintext, char *password) { return EVENT_CONTINUE; } /** Called on fantasy command * @param command The command @@ -1151,7 +1151,6 @@ struct MessageHash_ { /* Module Managment Functions */ MDE Module *findModule(const char *name); /* Find a module */ -int encryption_module_init(); /* Load the encryption module */ int protocol_module_init(); /* Load the IRCD Protocol Module up*/ MDE void moduleDisplayHelp(const char *service, User *u); -- cgit