From 15687a7c9eb882edc151870a4f27ac1e8dfd61ce Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Mon, 29 Jun 2009 04:47:00 +0000 Subject: changed encryption modules to use the new module API git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2342 5417fbe8-f217-4b02-8779-1006273d7864 --- include/encrypt.h | 22 ---------------------- include/modules.h | 22 ++++++++++++++++------ include/pseudo.h | 1 - 3 files changed, 16 insertions(+), 29 deletions(-) delete mode 100644 include/encrypt.h (limited to 'include') diff --git a/include/encrypt.h b/include/encrypt.h deleted file mode 100644 index 3ed93b6de..000000000 --- a/include/encrypt.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Include file for high-level encryption routines. - * - * (C) 2003-2009 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for furhter details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * $Id$ - * - */ - -typedef struct encryption_ { - int (*encrypt)(const char *src, int len, char *dest, int size); - int (*encrypt_in_place)(char *buf, int size); - int (*encrypt_check_len)(int passlen, int bufsize); - int (*decrypt)(const char *src, char *dest, int size); - int (*check_password)(const char *plaintext, const char *password); -} Encryption; - diff --git a/include/modules.h b/include/modules.h index 7a1edf716..a75edac56 100644 --- a/include/modules.h +++ b/include/modules.h @@ -47,7 +47,8 @@ enum EventReturn { EVENT_STOP, EVENT_CONTINUE, - EVENT_ALLOW + EVENT_ALLOW, + EVENT_ERROR }; @@ -539,6 +540,15 @@ class CoreExport Module */ virtual void OnBackupDatabase() MARK_DEPRECATED { } + /** 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, const char *password) { return EVENT_CONTINUE; } + /** Called on fantasy command * @param command The command * @param u The user using the command @@ -805,17 +815,17 @@ enum Implementation I_OnUserKicked, I_OnBotFantasy, I_OnBotNoFantasyAccess, I_OnBotBan, /* Users */ - I_OnUserConnect, I_OnUserNickChange, I_OnUserLogoff, I_OnPreJoinChannel, I_OnJoinChannel, I_OnPrePartChannel, I_OnPartChannel, + I_OnUserConnect, I_OnUserNickChange, I_OnUserLogoff, I_OnPreJoinChannel, I_OnJoinChannel, + I_OnPrePartChannel, I_OnPartChannel, /* OperServ */ I_OnDefconLevel, /* Other */ - I_OnReload, I_OnPreServerConnect, I_OnServerConnect, I_OnPreCommand, I_OnPostCommand, I_OnSaveDatabase, I_OnBackupDatabase, I_OnPreDatabaseExpire, I_OnDatabaseExpire, I_OnPreRestart, I_OnRestart, I_OnPreShutdown, I_OnShutdown, I_OnSignal, I_OnServerQuit, I_OnTopicUpdated, - + I_OnEncrypt, I_OnEncryptInPlace, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword, I_END }; @@ -943,9 +953,9 @@ struct MessageHash_ { /*************************************************************************/ /* Module Managment Functions */ -MDE Module *findModule(const char *name); /* Find a module */ +MDE Module *findModule(const char *name); /* Find a module */ -int encryption_module_init(); /* Load the encryption 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); diff --git a/include/pseudo.h b/include/pseudo.h index f63a5b645..65e5e81e7 100644 --- a/include/pseudo.h +++ b/include/pseudo.h @@ -15,6 +15,5 @@ #include "commands.h" #include "language.h" #include "timers.h" -#include "encrypt.h" #include "datafiles.h" #include "slist.h" -- cgit