incrementaltp: respect physics overrides
[waspsaliva.git] / src / util / auth.h
blobba827f3225aaf5a10edf47de0a2870bf778d8a55
1 /*
2 Minetest
3 Copyright (C) 2015, 2016 est31 <MTest31@outlook.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
22 /// Gets the base64 encoded legacy password db entry.
23 std::string translate_password(const std::string &name,
24 const std::string &password);
26 /// Creates a verification key with given salt and password.
27 std::string generate_srp_verifier(const std::string &name,
28 const std::string &password, const std::string &salt);
30 /// Creates a verification key and salt with given password.
31 void generate_srp_verifier_and_salt(const std::string &name,
32 const std::string &password, std::string *verifier,
33 std::string *salt);
35 /// Gets an SRP verifier, generating a salt,
36 /// and encodes it as DB-ready string.
37 std::string get_encoded_srp_verifier(const std::string &name,
38 const std::string &password);
40 /// Converts the passed SRP verifier into a DB-ready format.
41 std::string encode_srp_verifier(const std::string &verifier,
42 const std::string &salt);
44 /// Reads the DB-formatted SRP verifier and gets the verifier
45 /// and salt components.
46 bool decode_srp_verifier_and_salt(const std::string &encoded,
47 std::string *verifier, std::string *salt);