X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fstorage.h;h=9371529d5e4791383ae877dd2a461a4b8a53b31a;hb=5924533c6d0f9777d38c01ed7e1510a55db2b876;hp=4654dddcf256890805f4463a915746f7e9a23752;hpb=76db8cdfbeffaaba359c8e80cf2146da9e9e7f8a;p=quassel.git diff --git a/src/core/storage.h b/src/core/storage.h index 4654dddc..9371529d 100644 --- a/src/core/storage.h +++ b/src/core/storage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -42,6 +42,11 @@ public: NotAvailable // remove the storage backend from the list of avaliable backends }; + enum HashVersion { + sha1, + latest=sha1 + }; + public slots: /* General */ @@ -408,10 +413,12 @@ signals: void userRemoved(UserId); protected: - //! when implementing a storage handler, use this method to crypt user passwords. - /** This guarantees compatibility with other storage handlers and allows easy migration - */ - QString cryptedPassword(const QString &password); + QString hashPassword(const QString &password); + bool checkHashedPassword(const UserId user, const QString &password, const QString &hashedPassword, const Storage::HashVersion version); + +private: + QString hashPasswordSha1(const QString &password); + bool checkHashedPasswordSha1(const QString &password, const QString &hashedPassword); };