X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore%2Fstorage.h;h=9371529d5e4791383ae877dd2a461a4b8a53b31a;hb=5924533c6d0f9777d38c01ed7e1510a55db2b876;hp=9984d3177bcc51d0c48ec0fc3a0fa9de3970a283;hpb=53211b31038dac1726bb768dce4ae4dda1090cd3;p=quassel.git diff --git a/src/core/storage.h b/src/core/storage.h index 9984d317..9371529d 100644 --- a/src/core/storage.h +++ b/src/core/storage.h @@ -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); };