From 441bd151da733d32e194de6e4a1744ae273b83ee Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 31 Oct 2020 20:03:19 +0000 Subject: Add stdalgo::iterator_range and switch config tag reading to use it. This allows us to use range-based for loops which were not possible with the previous config tag system. --- src/modules/m_pbkdf2.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/modules/m_pbkdf2.cpp') diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index 706c61e89..9aaf68c96 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -186,15 +186,13 @@ class ModulePBKDF2 : public Module // Then the specific values ProviderConfigMap newconfigs; - ConfigTagList tags = ServerInstance->Config->ConfTags("pbkdf2prov"); - for (ConfigIter i = tags.first; i != tags.second; ++i) + for (auto& [_, ptag] : ServerInstance->Config->ConfTags("pbkdf2prov")) { - tag = i->second; - std::string hash_name = "hash/" + tag->getString("hash"); + std::string hash_name = "hash/" + ptag->getString("hash"); ProviderConfig& config = newconfigs[hash_name]; - config.iterations = tag->getUInt("iterations", newglobal.iterations, 1); - config.dkey_length = tag->getUInt("length", newglobal.dkey_length, 1, 1024); + config.iterations = ptag->getUInt("iterations", newglobal.iterations, 1); + config.dkey_length = ptag->getUInt("length", newglobal.dkey_length, 1, 1024); } // Config is valid, apply it @@ -208,7 +206,7 @@ class ModulePBKDF2 : public Module : Module(VF_VENDOR, "Allows other modules to generate PBKDF2 hashes.") { } - + ~ModulePBKDF2() { stdalgo::delete_all(providers); -- cgit v1.3.1-10-gc9f91