Commit 512f95cb authored by Philip Rinn's avatar Philip Rinn

New upstream version 1.2.1

parent 68f5012e
......@@ -2,7 +2,23 @@
## [Unreleased](https://github.com/IJHack/QtPass/tree/HEAD)
[Full Changelog](https://github.com/IJHack/QtPass/compare/v1.1.6...HEAD)
[Full Changelog](https://github.com/IJHack/QtPass/compare/v1.2.0...HEAD)
**Closed issues:**
- Question: is it possible to mass import passes? [\#339](https://github.com/IJHack/QtPass/issues/339)
- Version 1.2.0 leaks passwords [\#334](https://github.com/IJHack/QtPass/issues/334)
- signed release files [\#332](https://github.com/IJHack/QtPass/issues/332)
- 2017 [\#330](https://github.com/IJHack/QtPass/issues/330)
- When importing settings from 1.1.5 or older clipboard settings revert to No Clipboard [\#232](https://github.com/IJHack/QtPass/issues/232)
**Merged pull requests:**
- Insecure password generation [\#342](https://github.com/IJHack/QtPass/pull/342) ([annejan](https://github.com/annejan))
- Add Catalan translation [\#336](https://github.com/IJHack/QtPass/pull/336) ([rbuj](https://github.com/rbuj))
## [v1.2.0](https://github.com/IJHack/QtPass/tree/v1.2.0) (2017-11-08)
[Full Changelog](https://github.com/IJHack/QtPass/compare/v1.1.6...v1.2.0)
**Implemented enhancements:**
......
......@@ -38,7 +38,7 @@ PROJECT_NAME = QtPass
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.2.0
PROJECT_NUMBER = 1.2.1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
......
......@@ -792,12 +792,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
This diff is collapsed.
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished">Znaky nebyly vybrány</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished">Nelze generovat heslo, v nastavení nebyla vybrána skladba znaků pro heslo!</translation>
</message>
......
......@@ -816,12 +816,12 @@ Neues Passwort-Datei:
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Keine Zeichen ausgewählt</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Passwortgenerierung nicht möglich: Keine Zeichen zur Generierung ausgewählt! </translation>
</message>
......
......@@ -815,12 +815,12 @@ Neues Passwort-Datei:
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Keine Zeichen ausgewählt</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Passwortgenerierung nicht möglich: Keine Zeichen zur Generierung ausgewählt! </translation>
</message>
......
......@@ -792,12 +792,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>No characters chosen</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Can&apos;t generate password, there are no characters to choose from set in the configuration!</translation>
</message>
......
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>No characters chosen</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Can&apos;t generate password, there are no characters to choose from set in the configuration!</translation>
</message>
......
......@@ -805,12 +805,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Pas de caractères choisis</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Impossible de générer un mot de passe, il n&apos;y a pas de caractères utilisables définis dans la configuration !</translation>
</message>
......
......@@ -837,12 +837,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Aucun caractère sélectionné</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Impossible de générer un mot de passe : aucun caractère défini dans la configuration !</translation>
</message>
......
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Pas de caractères choisis</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Impossible de générer un mot de passe, il n&apos;y a pas de caractères utilisables définis dans la configuration !</translation>
</message>
......
......@@ -903,12 +903,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -792,12 +792,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -792,12 +792,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -811,12 +811,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Nessun carattere selezionato</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Impossibile generare una password, non ci sono caratteri dai quali scegliere. Cotrolla nella finestra di configurazione!</translation>
</message>
......
......@@ -792,12 +792,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Geen karakters gekozen</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Kan wachtwoord niet genereren, er zijn geen karakters gekozen in de configuratie!</translation>
</message>
......
......@@ -830,12 +830,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Geen karakters gekozen</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Kan wachtwoord niet genereren, er zijn geen karakters gekozen in de configuratie!</translation>
</message>
......
......@@ -792,12 +792,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -801,12 +801,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Nenhum caracter escolhido</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Não foi possível gerar password. Não existe nenhum caracter para escolher do grupo especificado na configuração!</translation>
</message>
......
......@@ -829,12 +829,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>Ни одного символа не выбрано</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>Не могу сгенерировать пароль: набор допустимых символов задан пустым в Настройках!</translation>
</message>
......
......@@ -806,12 +806,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation type="unfinished">Inga valda tecken</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation type="unfinished">Kan inte skapa lösenord. Konfigurationen saknar tecken att välja från!</translation>
</message>
......
......@@ -829,12 +829,12 @@ p, li { white-space: pre-wrap; }
<context>
<name>Pass</name>
<message>
<location filename="../src/pass.cpp" line="100"/>
<location filename="../src/pass.cpp" line="94"/>
<source>No characters chosen</source>
<translation>未选择任何字符</translation>
</message>
<message>
<location filename="../src/pass.cpp" line="101"/>
<location filename="../src/pass.cpp" line="95"/>
<source>Can&apos;t generate password, there are no characters to choose from set in the configuration!</source>
<translation>未选择任何字符,无法生成密码!</translation>
</message>
......
......@@ -4,6 +4,7 @@ Name=QtPass
Version=1.0
GenericName=Password Manager
#GenericName[ar_MA]=
GenericName[ca]=Gestor de contrasenyes
#GenericName[de_DE]=
#GenericName[es_ES]=
#GenericName[fr_BE]=
......@@ -18,6 +19,7 @@ GenericName[nl_NL]=Wachtwoord Beheer
#GenericName[zh_CN]=
Comment=GUI for the standard unix password store
#Comment[ar_MA]=
Comment[ca]=Interfície gràfica per al magatzem de contrasenyes UNIX estàndard
#Comment[de_DE]=
#Comment[es_ES]=
#Comment[fr_BE]=
......
......@@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "QtPass"
#define MyAppVersion "1.2.0"
#define MyAppVersion "1.2.1"
#define MyAppPublisher "IJhack"
#define MyAppURL "https://qtpass.org/"
#define MyAppExeName "qtpass.exe"
......
VERSION = 1.2.0
VERSION = 1.2.1
CONFIG(coverage) {
QMAKE_LFLAGS += --coverage
......
......@@ -59,6 +59,7 @@ CONFIG(coverage) {
}
TRANSLATIONS += localization/localization_nl_NL.ts \
localization/localization_ca.ts \
localization/localization_de_DE.ts \
localization/localization_es_ES.ts \
localization/localization_gl_ES.ts \
......
......@@ -7,7 +7,7 @@
# This should probably be part of a release process.
Name: qtpass
Version: 1.2.0
Version: 1.2.1
Release: 2%{?dist}
Summary: QtPass is a multi-platform GUI for pass, the standard unix password manager.
License: GPLv3
......
......@@ -5,6 +5,7 @@
<file>artwork/icon.png</file>
<file>artwork/icon.svg</file>
<file>localization/localization_ar_MA.qm</file>
<file>localization/localization_ca.qm</file>
<file>localization/localization_de_DE.qm</file>
<file>localization/localization_es_ES.qm</file>
<file>localization/localization_gl_ES.qm</file>
......
......@@ -2,8 +2,6 @@
#include "debughelper.h"
#include "qtpasssettings.h"
#include "util.h"
#include <QTextCodec>
#include <map>
using namespace std;
using namespace Enums;
......@@ -62,7 +60,7 @@ void Pass::init() {
* @param charset to use for generation
* @return the password
*/
QString Pass::Generate_b(int length, const QString &charset) {
QString Pass::Generate_b(unsigned int length, const QString &charset) {
QString passwd;
if (QtPassSettings::isUsePwgen()) {
// --secure goes first as it overrides --no-* otherwise
......@@ -90,11 +88,7 @@ QString Pass::Generate_b(int length, const QString &charset) {
}
} else {
if (charset.length() > 0) {
for (int i = 0; i < length; ++i) {
int index = Util::rand() % charset.length();
QChar nextChar = charset.at(index);
passwd.append(nextChar);
}
passwd = generateRandomPassword(charset, length);
} else {
emit critical(
tr("No characters chosen"),
......@@ -169,8 +163,6 @@ QList<UserInfo> Pass::listKeys(QString keystring, bool secret) {
*/
void Pass::finished(int id, int exitCode, const QString &out,
const QString &err) {
// TODO(bezet): remove !
dbg() << id << exitCode << out << err;
PROCESS pid = static_cast<PROCESS>(id);
if (exitCode != 0) {
......@@ -225,8 +217,8 @@ void Pass::updateEnv() {
} else {
// dbg()<< "Update
// PASSWORD_STORE_DIR with " + passStore;
env.replaceInStrings(
store.first(), "PASSWORD_STORE_DIR=" + QtPassSettings::getPassStore());
env.replaceInStrings(store.first(), "PASSWORD_STORE_DIR=" +
QtPassSettings::getPassStore());
}
exec.setEnvironment(env);
}
......@@ -282,3 +274,42 @@ QString Pass::getRecipientString(QString for_file, QString separator,
recipients_str += separator + '"' + recipient + '"';
return recipients_str;
}
/* Copyright (C) 2017 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
*/
quint32 Pass::boundedRandom(quint32 bound) {
if (bound < 2) {
return 0;
}
quint32 randval;
const quint32 max_mod_bound = (1 + ~bound) % bound;
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
static int fd = -1;
if (fd == -1) {
assert((fd = open("/dev/urandom", O_RDONLY)) >= 0);
}
#endif
do {
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
assert(read(fd, &randval, sizeof(randval)) == sizeof(randval));
#else
randval = QRandomGenerator::system()->generate();
#endif
} while (randval < max_mod_bound);
return randval % bound;
}
QString Pass::generateRandomPassword(const QString &charset,
unsigned int length) {
QString out;
for (unsigned int i = 0; i < length; ++i) {
out.append(charset.at(static_cast<int>(
boundedRandom(static_cast<quint32>(charset.length())))));
}
return out;
}
......@@ -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,
......
......@@ -45,7 +45,7 @@ void PasswordDialog::on_checkBoxShow_stateChanged(int arg1) {
void PasswordDialog::on_createPasswordButton_clicked() {
ui->widget->setEnabled(false);
QString newPass = QtPassSettings::getPass()->Generate_b(
ui->spinBox_pwdLength->value(),
static_cast<unsigned int>(ui->spinBox_pwdLength->value()),
m_passConfig.Characters[(passwordConfiguration::characterSet)
ui->passwordTemplateSwitch->currentIndex()]);
if (newPass.length() > 0)
......
......@@ -6,7 +6,6 @@
#include <QString>
#ifdef Q_OS_WIN
#include <windows.h>
#include <bcrypt.h>
#else
#include <sys/time.h>
#endif
......@@ -177,15 +176,3 @@ void Util::copyDir(const QString src, const QString dest) {
dest + QDir::separator() + file);
}
}
int Util::rand() {
#ifdef Q_OS_WIN
quint32 ret = 0;
if (FAILED(BCryptGenRandom(NULL, (PUCHAR)&ret, sizeof(ret),
BCRYPT_USE_SYSTEM_PREFERRED_RNG)))
return qrand();
return ret % RAND_MAX;
#else
return qrand();
#endif
}
......@@ -22,7 +22,6 @@ public:
const QFileSystemModel &model,
const StoreModel &storeModel);
static void copyDir(const QString src, const QString dest);
static int rand();
private:
static void initialiseEnvironment();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment