diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2018-01-02 14:04:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-02 14:04:39 +0100 |
commit | e7bd0651335e1bf4f01512d1555fe0b960ff1787 (patch) | |
tree | d9aca890534e06dec589130ec0d5a9532701a660 /src/pass.h | |
parent | f3e89ac2bb1dbd9821a4034d9d8219feb5826148 (diff) | |
parent | 2bb71d4e6681f9791fe8d69d62ff980b32032d0b (diff) |
Merge pull request #342 from IJHack/insecure_password_generation
Insecure password generation proposed fix
Diffstat (limited to 'src/pass.h')
-rw-r--r-- | src/pass.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -9,7 +9,16 @@ #include <QList> #include <QProcess> #include <QQueue> +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +#include <QRandomGenerator> +#else +#include <fcntl.h> +#include <unistd.h> +#endif #include <QString> +#include <QTextCodec> +#include <cassert> +#include <map> /*! \class Pass @@ -43,7 +52,7 @@ public: virtual void Copy(const QString srcDir, const QString dest, const bool force = false) = 0; virtual void Init(QString path, const QList<UserInfo> &users) = 0; - virtual QString Generate_b(int length, const QString &charset); + virtual QString Generate_b(unsigned int length, const QString &charset); void GenerateGPGKeys(QString batch); QList<UserInfo> listKeys(QString keystring = "", bool secret = false); @@ -56,6 +65,8 @@ public: protected: void executeWrapper(PROCESS id, const QString &app, const QStringList &args, bool readStdout = true, bool readStderr = true); + QString generateRandomPassword(const QString &charset, unsigned int length); + quint32 boundedRandom(quint32 bound); virtual void executeWrapper(PROCESS id, const QString &app, const QStringList &args, QString input, |