diff options
| author | 2022-09-03 22:52:53 +0100 | |
|---|---|---|
| committer | 2022-09-03 23:17:05 +0100 | |
| commit | 9203f40f41e4a735d379d13867d277c696fb28c5 (patch) | |
| tree | 93a171344e801b44918229fdd6b8778293ab88aa /src/modules/m_pbkdf2.cpp | |
| parent | Fix some warnings noticed by the bugprone-* clang-tidy checkers. (diff) | |
Fix some warnings noticed by the readability-* clang-tidy checkers.
Diffstat (limited to 'src/modules/m_pbkdf2.cpp')
| -rw-r--r-- | src/modules/m_pbkdf2.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index 3811ccff8..259f326ad 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -66,11 +66,9 @@ public: return ConvToStr(this->iterations) + ":" + Base64::Encode(this->hash) + ":" + Base64::Encode(this->salt); } - bool IsValid() + bool IsValid() const { - if (!this->iterations || !this->length || this->salt.empty() || this->hash.empty()) - return false; - return true; + return this->iterations && this->length && !this->salt.empty() && !this->hash.empty(); } }; @@ -82,7 +80,7 @@ public: unsigned long iterations; size_t dkey_length; - std::string PBKDF2(const std::string& pass, const std::string& salt, unsigned long itr = 0, size_t dkl = 0) + std::string PBKDF2(const std::string& pass, const std::string& salt, unsigned long itr = 0, size_t dkl = 0) const { size_t blocks = std::ceil((double)dkl / provider->out_size); |
