OmniSciDB  f632821e96
anonymous_namespace{SysCatalog.cpp} Namespace Reference

Functions

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

Function Documentation

◆ hash_with_bcrypt()

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

Definition at line 65 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().

65  {
66  char salt[BCRYPT_HASHSIZE], hash[BCRYPT_HASHSIZE];
67  CHECK(bcrypt_gensalt(-1, salt) == 0);
68  CHECK(bcrypt_hashpw(pwd.c_str(), salt, hash) == 0);
69  return std::string(hash, BCRYPT_HASHSIZE);
70 }
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function: