1
0
Fork 0
This commit is contained in:
jsteemann 2017-04-27 12:26:13 +02:00
parent cd377b0e0b
commit f94ef035cb
2 changed files with 9 additions and 4 deletions

View File

@ -345,7 +345,7 @@ HexHashResult AuthInfo::hexHashFromData(std::string const& hashMethod, char cons
} }
if (crypted == nullptr || if (crypted == nullptr ||
cryptedLength <= 0) { cryptedLength == 0) {
delete[] crypted; delete[] crypted;
return HexHashResult(TRI_ERROR_OUT_OF_MEMORY); return HexHashResult(TRI_ERROR_OUT_OF_MEMORY);
} }

View File

@ -54,8 +54,8 @@ enum class AuthSource {
class HexHashResult : public arangodb::Result { class HexHashResult : public arangodb::Result {
public: public:
HexHashResult(int errorNumber) : Result(errorNumber) {} explicit HexHashResult(int errorNumber) : Result(errorNumber) {}
HexHashResult(std::string const& hexHash) : Result(0), _hexHash(hexHash) {} explicit HexHashResult(std::string const& hexHash) : Result(0), _hexHash(hexHash) {}
std::string const& hexHash() { return _hexHash; } std::string const& hexHash() { return _hexHash; }
protected: protected:
@ -64,7 +64,12 @@ class HexHashResult : public arangodb::Result {
class AuthEntry { class AuthEntry {
public: public:
AuthEntry() : _active(false), _mustChange(false), _allDatabases(AuthLevel::NONE) {} AuthEntry()
: _active(false),
_mustChange(false),
_created(TRI_microtime()),
_source(AuthSource::COLLECTION),
_allDatabases(AuthLevel::NONE) {}
AuthEntry(std::string&& username, std::string&& passwordMethod, AuthEntry(std::string&& username, std::string&& passwordMethod,
std::string&& passwordSalt, std::string&& passwordHash, std::string&& passwordSalt, std::string&& passwordHash,