- /* Try to find the md5 service provider, bail if it can't be found */
- Provider = ServerInstance->FindModule(std::string("m_") + providername + ".so");
- if (!Provider)
- throw ModuleException(std::string("Can't find m_") + providername + ".so. Please load m_" + providername + ".so before m_oper_hash.so.");
+ /* Did we find any modules? */
+ if (ml)
+ {
+ /* Yes, enumerate them all to find out the hashing algorithm name */
+ for (modulelist::iterator m = ml->begin(); m != ml->end(); m++)
+ {
+ /* Make a request to it for its name, its implementing
+ * HashRequest so we know its safe to do this
+ */
+ std::string name = HashNameRequest(this, *m).Send();
+ /* Build a map of them */
+ hashers[name.c_str()] = *m;
+ names.push_back(name);
+ }
+ }
+ else
+ {
+ throw ModuleException("I can't find any modules loaded which implement the HashRequest interface! You probably forgot to load a hashing module such as m_md5.so or m_sha256.so.");
+ }