OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{SysCatalog.cpp} Namespace Reference

Functions

std::string hash_with_bcrypt (const std::string &pwd)
 

Function Documentation

std::string anonymous_namespace{SysCatalog.cpp}::hash_with_bcrypt ( const std::string &  pwd)

Definition at line 61 of file SysCatalog.cpp.

References CHECK().

Referenced by Catalog_Namespace::SysCatalog::alterUser(), Catalog_Namespace::SysCatalog::createUser(), Catalog_Namespace::SysCatalog::initDB(), Catalog_Namespace::SysCatalog::updateBlankPasswordsToRandom(), and Catalog_Namespace::SysCatalog::updatePasswordsToHashes().

61  {
62  char salt[BCRYPT_HASHSIZE], hash[BCRYPT_HASHSIZE];
63  CHECK(bcrypt_gensalt(-1, salt) == 0);
64  CHECK(bcrypt_hashpw(pwd.c_str(), salt, hash) == 0);
65  return std::string(hash, BCRYPT_HASHSIZE);
66 }
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: