diff options
| author | 2020-10-31 20:03:19 +0000 | |
|---|---|---|
| committer | 2020-10-31 22:33:35 +0000 | |
| commit | 441bd151da733d32e194de6e4a1744ae273b83ee (patch) | |
| tree | 74eb1ee2aef413185bf3906a17f1b2c27373e03a /src/modules/m_pbkdf2.cpp | |
| parent | Fix reading the <sslprofile> config. (diff) | |
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.
Diffstat (limited to 'src/modules/m_pbkdf2.cpp')
| -rw-r--r-- | src/modules/m_pbkdf2.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
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); |
