#include <algorithm>
#include <string>
#include "auth.h"
#include "base64.h"
#include "sha1.h"
#include "srp.h"
#include "util/string.h"
#include "debug.h"
Functions | |
std::string | translate_password (const std::string &name, const std::string &password) |
Gets the base64 encoded legacy password db entry. | |
static void | gen_srp_v (const std::string &name, const std::string &password, char **salt, size_t *salt_len, char **bytes_v, size_t *len_v) |
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. | |
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. | |
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. | |
std::string | encode_srp_verifier (const std::string &verifier, const std::string &salt) |
Converts the passed SRP verifier into a DB-ready format. | |
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. | |
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.
References base64_decode(), base64_is_valid(), and str_split().
Referenced by Server::handleCommand_SrpBytesA(), and ModApiUtil::l_check_password_entry().
std::string encode_srp_verifier | ( | const std::string & | verifier, |
const std::string & | salt ) |
Converts the passed SRP verifier into a DB-ready format.
References base64_encode().
Referenced by get_encoded_srp_verifier(), and Server::handleCommand_FirstSrp().
|
inlinestatic |
References FATAL_ERROR_IF, lowercase(), srp_create_salted_verification_key(), SRP_NG_2048, SRP_OK, and SRP_SHA256.
Referenced by generate_srp_verifier(), and generate_srp_verifier_and_salt().
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.
References gen_srp_v().
Referenced by ModApiUtil::l_check_password_entry().
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.
References gen_srp_v().
Referenced by get_encoded_srp_verifier(), Server::handleCommand_SrpBytesA(), and Client::startAuth().
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.
References encode_srp_verifier(), and generate_srp_verifier_and_salt().
Referenced by Server::handleCommand_Init().
std::string translate_password | ( | const std::string & | name, |
const std::string & | password ) |
Gets the base64 encoded legacy password db entry.
References SHA1::addBytes(), base64_encode(), and SHA1::getDigest().
Referenced by ModApiUtil::l_check_password_entry(), ModApiUtil::l_get_password_hash(), and Client::startAuth().