mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-26 18:21:04 +00:00
Use openssl's sha1 and sha256, optionally (#15472)
This commit is contained in:
parent
4f800dd2b4
commit
bcbee873e8
17 changed files with 141 additions and 43 deletions
|
@ -6,7 +6,7 @@
|
|||
#include <string>
|
||||
#include "auth.h"
|
||||
#include "base64.h"
|
||||
#include "sha1.h"
|
||||
#include "util/hashing.h"
|
||||
#include "srp.h"
|
||||
#include "util/string.h"
|
||||
#include "debug.h"
|
||||
|
@ -23,9 +23,7 @@ std::string translate_password(const std::string &name,
|
|||
return "";
|
||||
|
||||
std::string slt = name + password;
|
||||
SHA1 sha1;
|
||||
sha1.addBytes(slt);
|
||||
std::string digest = sha1.getDigest();
|
||||
std::string digest = hashing::sha1(slt);
|
||||
std::string pwd = base64_encode(digest);
|
||||
return pwd;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue