diff options
| author | megamage <none@none> | 2009-09-02 16:22:32 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-09-02 16:22:32 -0500 |
| commit | 790c5348a33ad28422e9356e598bf7084b0159b6 (patch) | |
| tree | 78b79b129c84c9f184f00ce9c152965bc43a65a8 /src/game/AccountMgr.cpp | |
| parent | 0c0a7b6b0ee55aa1c58a82b2afdc48614f3342bc (diff) | |
[8445] Fixed redundant calculation of v and s on every login Author: arrai
The SRP-6 specifications clearly say, that v and s are only to be
calculated on registering a user and changing his password; calculating
them on every login is plain waste.
--HG--
branch : trunk
Diffstat (limited to 'src/game/AccountMgr.cpp')
| -rw-r--r-- | src/game/AccountMgr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/game/AccountMgr.cpp b/src/game/AccountMgr.cpp index 74bc4cd2dcc..981a5ad07ec 100644 --- a/src/game/AccountMgr.cpp +++ b/src/game/AccountMgr.cpp @@ -145,7 +145,8 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accid, std::string new_passwd) normalizeString(new_passwd); loginDatabase.escape_string(new_passwd); - if(!loginDatabase.PExecute("UPDATE account SET sha_pass_hash=SHA1(CONCAT(username,':','%s')) WHERE id='%d'", new_passwd.c_str(), accid)) + // also reset s and v to force update at next realmd login + if(!loginDatabase.PExecute("UPDATE account SET v='0', s='0', sha_pass_hash=SHA1("_CONCAT3_("username","':'","'%s'")") WHERE id='%d'", new_passwd.c_str(), accid)) return AOR_DB_INTERNAL_ERROR; // unexpected error return AOR_OK; |
