mirror of
https://github.com/anope/anope.git
synced 2026-07-03 18:23:14 +02:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
+16
-6
@@ -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);
|
||||
|
||||
|
||||
@@ -15,6 +15,5 @@
|
||||
#include "commands.h"
|
||||
#include "language.h"
|
||||
#include "timers.h"
|
||||
#include "encrypt.h"
|
||||
#include "datafiles.h"
|
||||
#include "slist.h"
|
||||
|
||||
Reference in New Issue
Block a user