diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_ripemd160.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/m_ripemd160.cpp b/src/modules/m_ripemd160.cpp index 0768f523c..78b164315 100644 --- a/src/modules/m_ripemd160.cpp +++ b/src/modules/m_ripemd160.cpp @@ -434,12 +434,12 @@ class ModuleRIPEMD160 : public Module return (byte *)hashcode; } - unsigned int* key; + unsigned int* currkey; char* chars; public: - ModuleRIPEMD160(InspIRCd* Me) : Module(Me), key(NULL), chars("0123456789abcdef") + ModuleRIPEMD160(InspIRCd* Me) : Module(Me), currkey(NULL), chars("0123456789abcdef") { ServerInstance->Modules->PublishInterface("HashRequest", this); Implementation eventlist[] = { I_OnRequest }; @@ -457,7 +457,7 @@ class ModuleRIPEMD160 : public Module HashRequest* SHA = (HashRequest*)request; if (strcmp("KEY", request->GetId()) == 0) { - this->key = (unsigned int*)SHA->GetKeyData(); + this->currkey = (unsigned int*)SHA->GetKeyData(); } else if (strcmp("HEX", request->GetId()) == 0) { @@ -465,9 +465,8 @@ class ModuleRIPEMD160 : public Module } else if (strcmp("SUM", request->GetId()) == 0) { - int j = 0; static char* data; - data = (char*)RMD((byte *)SHA->GetHashData().data(),SHA->GetHashData().length(), key); + data = (char*)RMD((byte *)SHA->GetHashData().data(),SHA->GetHashData().length(), currkey); for (int i = 0, j = 0; i < RMDsize / 8; i++) { data[j++] = chars[data[i] / 16]; @@ -483,7 +482,7 @@ class ModuleRIPEMD160 : public Module else if (strcmp("RESET", request->GetId()) == 0) { this->chars = "0123456789abcdef"; - this->key = NULL; + this->currkey = NULL; } return NULL; } @@ -493,4 +492,7 @@ class ModuleRIPEMD160 : public Module return Version(1, 2, 0, 1, VF_VENDOR|VF_SERVICEPROVIDER, API_VERSION); } -};
\ No newline at end of file +}; + +MODULE_INIT(ModuleRIPEMD160) + |