mirror of
https://github.com/anope/anope.git
synced 2026-07-02 00:06:38 +02:00
No real need for another constant
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2347 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+1
-2
@@ -47,8 +47,7 @@ enum EventReturn
|
||||
{
|
||||
EVENT_STOP,
|
||||
EVENT_CONTINUE,
|
||||
EVENT_ALLOW,
|
||||
EVENT_ERROR
|
||||
EVENT_ALLOW
|
||||
};
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -351,7 +351,7 @@ class EMD5 : public Module
|
||||
char tmp[33];
|
||||
|
||||
if (size < 16)
|
||||
return EVENT_ERROR;
|
||||
return EVENT_STOP;
|
||||
|
||||
MD5Init(&context);
|
||||
MD5Update(&context, (unsigned char *)src, len);
|
||||
@@ -398,8 +398,8 @@ class EMD5 : public Module
|
||||
{
|
||||
char buf[BUFSIZE];
|
||||
|
||||
if (OnEncrypt(plaintext, strlen(plaintext), buf, sizeof(buf)) == EVENT_ERROR)
|
||||
return EVENT_ERROR;
|
||||
if (OnEncrypt(plaintext, strlen(plaintext), buf, sizeof(buf)) == EVENT_STOP)
|
||||
return EVENT_STOP;
|
||||
if (memcmp(buf, password, 16) == 0)
|
||||
{
|
||||
return EVENT_ALLOW;
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class ENone : public Module
|
||||
dest[len] = '\0';
|
||||
return EVENT_STOP;
|
||||
}
|
||||
return EVENT_ERROR;
|
||||
return EVENT_STOP;
|
||||
}
|
||||
|
||||
EventReturn OnEncryptInPlace(char *buf, int size)
|
||||
|
||||
+3
-3
@@ -356,7 +356,7 @@ class EOld : public Module
|
||||
int i;
|
||||
|
||||
if (size < 16)
|
||||
return EVENT_ERROR;
|
||||
return EVENT_STOP;
|
||||
|
||||
memset(&context, 0, sizeof(context));
|
||||
memset(&digest, 0, sizeof(digest));
|
||||
@@ -399,8 +399,8 @@ class EOld : public Module
|
||||
{
|
||||
char buf[BUFSIZE];
|
||||
|
||||
if (OnEncrypt(plaintext, strlen(plaintext), buf, sizeof(buf)) == EVENT_ERROR)
|
||||
return EVENT_ERROR;
|
||||
if (OnEncrypt(plaintext, strlen(plaintext), buf, sizeof(buf)) == EVENT_STOP)
|
||||
return EVENT_STOP;
|
||||
if (memcmp(buf, password, 16) == 0)
|
||||
{
|
||||
return EVENT_ALLOW;
|
||||
|
||||
+5
-5
@@ -27,7 +27,7 @@ int enc_encrypt(const char *src, int len, char *dest, int size)
|
||||
FOREACH_RESULT(I_OnEncrypt, OnEncrypt(src, len, dest, size));
|
||||
if (MOD_RESULT == EVENT_ALLOW)
|
||||
return 1;
|
||||
if (MOD_RESULT == EVENT_ERROR)
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ int enc_encrypt_in_place(char *buf, int size)
|
||||
FOREACH_RESULT(I_OnEncryptInPlace, OnEncryptInPlace(buf, size));
|
||||
if (MOD_RESULT == EVENT_ALLOW)
|
||||
return 1;
|
||||
if (MOD_RESULT == EVENT_ERROR)
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
@@ -63,7 +63,7 @@ int enc_encrypt_check_len(int passlen, int bufsize)
|
||||
FOREACH_RESULT(I_OnEncryptCheckLen, OnEncryptCheckLen(passlen, bufsize));
|
||||
if (MOD_RESULT == EVENT_ALLOW)
|
||||
return 1;
|
||||
if (MOD_RESULT == EVENT_ERROR)
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ int enc_decrypt(const char *src, char *dest, int size)
|
||||
FOREACH_RESULT(I_OnDecrypt, OnDecrypt(src, dest, size));
|
||||
if (MOD_RESULT == EVENT_ALLOW)
|
||||
return 1;
|
||||
if (MOD_RESULT == EVENT_ERROR)
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ int enc_check_password(const char *plaintext, const char *password)
|
||||
FOREACH_RESULT(I_OnCheckPassword, OnCheckPassword(plaintext, password));
|
||||
if (MOD_RESULT == EVENT_ALLOW)
|
||||
return 1;
|
||||
if (MOD_RESULT == EVENT_ERROR)
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user