diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-09-06 16:04:10 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-05 13:29:21 +0100 |
commit | e0e3bae82cfb6c70ba810997104054ab6ca77e99 (patch) | |
tree | 33c02a81521514ffe392e27dcccd13a49b0fcb69 /src/common/Cryptography/Authentication/SRP6.cpp | |
parent | 3bf33628fc4833e8682f96c679982200fcbd1674 (diff) |
Core/Authserver: Removal of sha_pass_hash, compatibility fields, and everything that uses them (PR #25156)
(cherry picked from commit bcdbdd6f23ce65cc0e381e61d2840140dce79311)
Diffstat (limited to 'src/common/Cryptography/Authentication/SRP6.cpp')
-rw-r--r-- | src/common/Cryptography/Authentication/SRP6.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/common/Cryptography/Authentication/SRP6.cpp b/src/common/Cryptography/Authentication/SRP6.cpp index 4d96a28960d..a2266f35f71 100644 --- a/src/common/Cryptography/Authentication/SRP6.cpp +++ b/src/common/Cryptography/Authentication/SRP6.cpp @@ -42,24 +42,15 @@ using SRP6 = Trinity::Crypto::SRP6; return res; } -/*static*/ std::pair<SRP6::Salt, SRP6::Verifier> SRP6::MakeRegistrationDataFromHash_DEPRECATED_DONOTUSE(SHA1::Digest const& hash) -{ - std::pair<SRP6::Salt, SRP6::Verifier> res; - Crypto::GetRandomBytes(res.first); - res.second = CalculateVerifierFromHash(hash, res.first); - return res; -} - /*static*/ SRP6::Verifier SRP6::CalculateVerifier(std::string const& username, std::string const& password, SRP6::Salt const& salt) { // v = g ^ H(s || H(u || ':' || p)) mod N - return CalculateVerifierFromHash(SHA1::GetDigestOf(username, ":", password), salt); -} - -// merge this into CalculateVerifier once the sha_pass hack finally gets nuked from orbit -/*static*/ SRP6::Verifier SRP6::CalculateVerifierFromHash(SHA1::Digest const& hash, SRP6::Salt const& salt) -{ - return _g.ModExp(SHA1::GetDigestOf(salt, hash), _N).ToByteArray<32>(); + return _g.ModExp( + SHA1::GetDigestOf( + salt, + SHA1::GetDigestOf(username, ":", password) + ) + ,_N).ToByteArray<32>(); } /*static*/ SessionKey SRP6::SHA1Interleave(SRP6::EphemeralKey const& S) |