Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
auth.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2015, 2016 est31 <MTest31@outlook.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
23std::string translate_password(const std::string &name,
24 const std::string &password);
25
27std::string generate_srp_verifier(const std::string &name,
28 const std::string &password, const std::string &salt);
29
31void generate_srp_verifier_and_salt(const std::string &name,
32 const std::string &password, std::string *verifier,
33 std::string *salt);
34
37std::string get_encoded_srp_verifier(const std::string &name,
38 const std::string &password);
39
41std::string encode_srp_verifier(const std::string &verifier,
42 const std::string &salt);
43
46bool decode_srp_verifier_and_salt(const std::string &encoded,
47 std::string *verifier, std::string *salt);
void generate_srp_verifier_and_salt(const std::string &name, const std::string &password, std::string *verifier, std::string *salt)
Creates a verification key and salt with given password.
Definition: auth.cpp:82
bool decode_srp_verifier_and_salt(const std::string &encoded, std::string *verifier, std::string *salt)
Reads the DB-formatted SRP verifier and gets the verifier and salt components.
Definition: auth.cpp:121
std::string get_encoded_srp_verifier(const std::string &name, const std::string &password)
Gets an SRP verifier, generating a salt, and encodes it as DB-ready string.
Definition: auth.cpp:99
std::string generate_srp_verifier(const std::string &name, const std::string &password, const std::string &salt)
Creates a verification key with given salt and password.
Definition: auth.cpp:65
std::string translate_password(const std::string &name, const std::string &password)
Gets the base64 encoded legacy password db entry.
Definition: auth.cpp:34
std::string encode_srp_verifier(const std::string &verifier, const std::string &salt)
Converts the passed SRP verifier into a DB-ready format.
Definition: auth.cpp:109