summaryrefslogtreecommitdiff
path: root/modules/encryption
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
committerAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
commit26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch)
treeb9916f14fe35ce5c4de95c4194ca4ea0cb30812f /modules/encryption
parent0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff)
New event system
Diffstat (limited to 'modules/encryption')
-rw-r--r--modules/encryption/enc_bcrypt.cpp8
-rw-r--r--modules/encryption/enc_md5.cpp8
-rw-r--r--modules/encryption/enc_none.cpp6
-rw-r--r--modules/encryption/enc_old.cpp8
-rw-r--r--modules/encryption/enc_sha1.cpp8
-rw-r--r--modules/encryption/enc_sha256.cpp8
6 files changed, 36 insertions, 10 deletions
diff --git a/modules/encryption/enc_bcrypt.cpp b/modules/encryption/enc_bcrypt.cpp
index 8ed5695ac..020bafe6e 100644
--- a/modules/encryption/enc_bcrypt.cpp
+++ b/modules/encryption/enc_bcrypt.cpp
@@ -841,6 +841,8 @@ char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
#include "modules/encryption.h"
class EBCRYPT : public Module
+ , public EventHook<Event::Encrypt>
+ , public EventHook<Event::CheckAuthentication>
{
unsigned int rounds;
@@ -873,8 +875,10 @@ class EBCRYPT : public Module
}
public:
- EBCRYPT(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR | EXTRA),
- rounds(10)
+ EBCRYPT(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR | EXTRA)
+ , EventHook<Event::Encrypt>("OnEncrypt")
+ , EventHook<Event::CheckAuthentication>("OnCheckAuthentication")
+ , rounds(10)
{
// Test a pre-calculated hash
bool test = Compare("Test!", "$2a$10$x9AQFAQScY0v9KF2suqkEOepsHFrG.CXHbIXI.1F28SfSUb56A/7K");
diff --git a/modules/encryption/enc_md5.cpp b/modules/encryption/enc_md5.cpp
index b49390d56..838c5712f 100644
--- a/modules/encryption/enc_md5.cpp
+++ b/modules/encryption/enc_md5.cpp
@@ -338,12 +338,16 @@ class MD5Provider : public Encryption::Provider
};
class EMD5 : public Module
+ , public EventHook<Event::Encrypt>
+ , public EventHook<Event::CheckAuthentication>
{
MD5Provider md5provider;
public:
- EMD5(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR),
- md5provider(this)
+ EMD5(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR)
+ , EventHook<Event::Encrypt>("OnEncrypt")
+ , EventHook<Event::CheckAuthentication>("OnCheckAuthentication")
+ , md5provider(this)
{
}
diff --git a/modules/encryption/enc_none.cpp b/modules/encryption/enc_none.cpp
index ae698914c..1346177f7 100644
--- a/modules/encryption/enc_none.cpp
+++ b/modules/encryption/enc_none.cpp
@@ -10,9 +10,15 @@
#include "module.h"
class ENone : public Module
+ , public EventHook<Event::Encrypt>
+ , public EventHook<Event::Decrypt>
+ , public EventHook<Event::CheckAuthentication>
{
public:
ENone(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR)
+ , EventHook<Event::Encrypt>("OnEncrypt")
+ , EventHook<Event::Decrypt>("OnDecrypt")
+ , EventHook<Event::CheckAuthentication>("OnCheckAuthentication")
{
}
diff --git a/modules/encryption/enc_old.cpp b/modules/encryption/enc_old.cpp
index 89c228b1d..b885eb777 100644
--- a/modules/encryption/enc_old.cpp
+++ b/modules/encryption/enc_old.cpp
@@ -35,14 +35,18 @@ class OldMD5Provider : public Encryption::Provider
};
class EOld : public Module
+ , public EventHook<Event::Encrypt>
+ , public EventHook<Event::CheckAuthentication>
{
OldMD5Provider oldmd5provider;
inline static char XTOI(char c) { return c > 9 ? c - 'A' + 10 : c - '0'; }
public:
- EOld(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR),
- oldmd5provider(this)
+ EOld(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR)
+ , EventHook<Event::Encrypt>("OnEncrypt")
+ , EventHook<Event::CheckAuthentication>("OnCheckAuthentication")
+ , oldmd5provider(this)
{
ModuleManager::LoadModule("enc_md5", User::Find(creator));
diff --git a/modules/encryption/enc_sha1.cpp b/modules/encryption/enc_sha1.cpp
index 79d657493..f65b5d5ea 100644
--- a/modules/encryption/enc_sha1.cpp
+++ b/modules/encryption/enc_sha1.cpp
@@ -193,12 +193,16 @@ class SHA1Provider : public Encryption::Provider
};
class ESHA1 : public Module
+ , public EventHook<Event::Encrypt>
+ , public EventHook<Event::CheckAuthentication>
{
SHA1Provider sha1provider;
public:
- ESHA1(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR),
- sha1provider(this)
+ ESHA1(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR)
+ , EventHook<Event::Encrypt>("OnEncrypt")
+ , EventHook<Event::CheckAuthentication>("OnCheckAuthentication")
+ , sha1provider(this)
{
}
diff --git a/modules/encryption/enc_sha256.cpp b/modules/encryption/enc_sha256.cpp
index 8be792346..9cd682c57 100644
--- a/modules/encryption/enc_sha256.cpp
+++ b/modules/encryption/enc_sha256.cpp
@@ -237,6 +237,8 @@ class SHA256Provider : public Encryption::Provider
};
class ESHA256 : public Module
+ , public EventHook<Event::Encrypt>
+ , public EventHook<Event::CheckAuthentication>
{
SHA256Provider sha256provider;
@@ -273,8 +275,10 @@ class ESHA256 : public Module
}
public:
- ESHA256(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR),
- sha256provider(this)
+ ESHA256(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION | VENDOR)
+ , EventHook<Event::Encrypt>("OnEncrypt")
+ , EventHook<Event::CheckAuthentication>("OnCheckAuthentication")
+ , sha256provider(this)
{