mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Merge remote-tracking branch 'origin/develop' into release/2.2.0
This commit is contained in:
commit
6dfeea1980
@ -59,6 +59,8 @@ set(keepassx_SOURCES
|
|||||||
core/Tools.cpp
|
core/Tools.cpp
|
||||||
core/Translator.cpp
|
core/Translator.cpp
|
||||||
core/Uuid.cpp
|
core/Uuid.cpp
|
||||||
|
cli/PasswordInput.cpp
|
||||||
|
cli/PasswordInput.h
|
||||||
crypto/Crypto.cpp
|
crypto/Crypto.cpp
|
||||||
crypto/CryptoHash.cpp
|
crypto/CryptoHash.cpp
|
||||||
crypto/Random.cpp
|
crypto/Random.cpp
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
#include "format/KeePass2Reader.h"
|
#include "format/KeePass2Reader.h"
|
||||||
#include "keys/CompositeKey.h"
|
#include "keys/CompositeKey.h"
|
||||||
|
#include "cli/PasswordInput.h"
|
||||||
|
|
||||||
int Extract::execute(int argc, char** argv)
|
int Extract::execute(int argc, char** argv)
|
||||||
{
|
{
|
||||||
@ -50,8 +51,7 @@ int Extract::execute(int argc, char** argv)
|
|||||||
out << "Insert the database password\n> ";
|
out << "Insert the database password\n> ";
|
||||||
out.flush();
|
out.flush();
|
||||||
|
|
||||||
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
QString line = PasswordInput::getPassword();
|
||||||
QString line = inputTextStream.readLine();
|
|
||||||
CompositeKey key = CompositeKey::readFromLine(line);
|
CompositeKey key = CompositeKey::readFromLine(line);
|
||||||
|
|
||||||
QString databaseFilename = args.at(0);
|
QString databaseFilename = args.at(0);
|
||||||
|
72
src/cli/PasswordInput.cpp
Normal file
72
src/cli/PasswordInput.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 or (at your option)
|
||||||
|
* version 3 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PasswordInput.h"
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <windows.h>
|
||||||
|
#else
|
||||||
|
#include <termios.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
|
||||||
|
PasswordInput::PasswordInput()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void PasswordInput::setStdinEcho(bool enable = true)
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
|
DWORD mode;
|
||||||
|
GetConsoleMode(hIn, &mode);
|
||||||
|
|
||||||
|
if (enable) {
|
||||||
|
mode |= ENABLE_ECHO_INPUT;
|
||||||
|
} else {
|
||||||
|
mode &= ~ENABLE_ECHO_INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetConsoleMode(hIn, mode);
|
||||||
|
|
||||||
|
#else
|
||||||
|
struct termios t;
|
||||||
|
tcgetattr(STDIN_FILENO, &t);
|
||||||
|
|
||||||
|
if (enable) {
|
||||||
|
t.c_lflag |= ECHO;
|
||||||
|
} else {
|
||||||
|
t.c_lflag &= ~ECHO;
|
||||||
|
}
|
||||||
|
|
||||||
|
tcsetattr(STDIN_FILENO, TCSANOW, &t);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PasswordInput::getPassword()
|
||||||
|
{
|
||||||
|
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
||||||
|
|
||||||
|
setStdinEcho(false);
|
||||||
|
QString line = inputTextStream.readLine();
|
||||||
|
setStdinEcho(true);
|
||||||
|
|
||||||
|
return line;
|
||||||
|
}
|
31
src/cli/PasswordInput.h
Normal file
31
src/cli/PasswordInput.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 or (at your option)
|
||||||
|
* version 3 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef KEEPASSXC_PASSWORDINPUT_H
|
||||||
|
#define KEEPASSXC_PASSWORDINPUT_H
|
||||||
|
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
class PasswordInput
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PasswordInput();
|
||||||
|
static void setStdinEcho(bool enable);
|
||||||
|
static QString getPassword();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // KEEPASSXC_PASSWORDINPUT_H
|
@ -29,6 +29,7 @@
|
|||||||
#include "core/Entry.h"
|
#include "core/Entry.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "keys/CompositeKey.h"
|
#include "keys/CompositeKey.h"
|
||||||
|
#include "cli/PasswordInput.h"
|
||||||
|
|
||||||
int Show::execute(int argc, char** argv)
|
int Show::execute(int argc, char** argv)
|
||||||
{
|
{
|
||||||
@ -50,8 +51,7 @@ int Show::execute(int argc, char** argv)
|
|||||||
out << "Insert the database password\n> ";
|
out << "Insert the database password\n> ";
|
||||||
out.flush();
|
out.flush();
|
||||||
|
|
||||||
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
QString line = PasswordInput::getPassword();
|
||||||
QString line = inputTextStream.readLine();
|
|
||||||
CompositeKey key = CompositeKey::readFromLine(line);
|
CompositeKey key = CompositeKey::readFromLine(line);
|
||||||
|
|
||||||
Database* db = Database::openDatabaseFile(args.at(0), key);
|
Database* db = Database::openDatabaseFile(args.at(0), key);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
|
#include "cli/PasswordInput.h"
|
||||||
#include "core/Group.h"
|
#include "core/Group.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
#include "crypto/Random.h"
|
#include "crypto/Random.h"
|
||||||
@ -398,13 +399,12 @@ Database* Database::openDatabaseFile(QString fileName, CompositeKey key)
|
|||||||
|
|
||||||
Database* Database::unlockFromStdin(QString databaseFilename)
|
Database* Database::unlockFromStdin(QString databaseFilename)
|
||||||
{
|
{
|
||||||
static QTextStream inputTextStream(stdin, QIODevice::ReadOnly);
|
|
||||||
QTextStream outputTextStream(stdout);
|
QTextStream outputTextStream(stdout);
|
||||||
|
|
||||||
outputTextStream << QString("Insert password to unlock " + databaseFilename + "\n> ");
|
outputTextStream << QString("Insert password to unlock " + databaseFilename + "\n> ");
|
||||||
outputTextStream.flush();
|
outputTextStream.flush();
|
||||||
|
|
||||||
QString line = inputTextStream.readLine();
|
QString line = PasswordInput::getPassword();
|
||||||
CompositeKey key = CompositeKey::readFromLine(line);
|
CompositeKey key = CompositeKey::readFromLine(line);
|
||||||
return Database::openDatabaseFile(databaseFilename, key);
|
return Database::openDatabaseFile(databaseFilename, key);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ AboutDialog::AboutDialog(QWidget* parent)
|
|||||||
setWindowFlags(Qt::Sheet);
|
setWindowFlags(Qt::Sheet);
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
m_ui->nameLabel->setText(m_ui->nameLabel->text() + " " + KEEPASSX_VERSION);
|
m_ui->nameLabel->setText(m_ui->nameLabel->text().replace("${VERSION}", KEEPASSX_VERSION));
|
||||||
QFont nameLabelFont = m_ui->nameLabel->font();
|
QFont nameLabelFont = m_ui->nameLabel->font();
|
||||||
nameLabelFont.setPointSize(nameLabelFont.pointSize() + 4);
|
nameLabelFont.setPointSize(nameLabelFont.pointSize() + 4);
|
||||||
m_ui->nameLabel->setFont(nameLabelFont);
|
m_ui->nameLabel->setFont(nameLabelFont);
|
||||||
|
@ -6,10 +6,22 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>479</width>
|
<width>450</width>
|
||||||
<height>478</height>
|
<height>450</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>450</width>
|
||||||
|
<height>450</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>About KeePassXC</string>
|
<string>About KeePassXC</string>
|
||||||
</property>
|
</property>
|
||||||
@ -59,7 +71,13 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"> KeePassXC</string>
|
<string notr="true"><span style="font-size: 24pt"> KeePassXC v${VERSION}</span></string>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="indent">
|
||||||
|
<number>11</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -84,7 +102,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"><p>Website: <a href="https://keepassxc.org/">https://keepassxc.org/</a></p></string>
|
<string notr="true"><html><head/><body><p>Website: <a href="https://keepassxc.org/"><span style="text-decoration: underline; color:#0000ff;">https://keepassxc.org</span></a></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -94,7 +112,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><p>Report bugs at: <a href="https://github.com/keepassxreboot/keepassxc/issues">https://github.com/</a></p></string>
|
<string><html><head/><body><p>Report bugs at: <a href="https://github.com/keepassxreboot/keepassxc/issues"><span style="text-decoration: underline; color:#0000ff;">https://github.com</span></a></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -126,7 +144,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>KeePassXC is distributed under the terms of the GNU General Public License (GPL) version 2 or (at your option) version 3.</string>
|
<string><html><head/><body><p>KeePassXC is distributed under the terms of the GNU General Public License (GPL) version 2 or (at your option) version 3.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -158,14 +176,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><p>Main contributors:</p>
|
<string><html><head><style>li {font-size: 10pt}</style></head><body><p><span style=" font-size:10pt;">Project Maintainers:</span></p><ul><li>droidmonkey</li><li>phoerious</li><li>TheZ3ro</li><li>louib</li><li>Weslly</li><li>debfx (KeePassX)</li></ul></body></html></string>
|
||||||
<ul>
|
|
||||||
<li>debfx (KeePassX)</li>
|
|
||||||
<li>droidmonkey</li>
|
|
||||||
<li>louib</li>
|
|
||||||
<li>phoerious</li>
|
|
||||||
<li>thezero</li>
|
|
||||||
</ul></string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -184,6 +195,65 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_3">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Contributors</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="contributors">
|
||||||
|
<property name="html">
|
||||||
|
<string><html><body>
|
||||||
|
<p style="font-size:x-large; font-weight:600;">Code:</p>
|
||||||
|
<ul>
|
||||||
|
<li style="font-size:10pt">debfx (KeePassX)</li>
|
||||||
|
<li style="font-size:10pt">BlueIce (KeePassX)</li>
|
||||||
|
<li style="font-size:10pt">droidmonkey</li>
|
||||||
|
<li style="font-size:10pt">phoerious</li>
|
||||||
|
<li style="font-size:10pt">TheZ3ro</li>
|
||||||
|
<li style="font-size:10pt">louib</li>
|
||||||
|
<li style="font-size:10pt">weslly</li>
|
||||||
|
<li style="font-size:10pt">keithbennett (KeePassHTTP)</li>
|
||||||
|
<li style="font-size:10pt">Typz (KeePassHTTP)</li>
|
||||||
|
<li style="font-size:10pt">denk-mal (KeePassHTTP)</li>
|
||||||
|
<li style="font-size:10pt">kylemanna (YubiKey)</li>
|
||||||
|
<li style="font-size:10pt">seatedscribe (CSV Importer)</li>
|
||||||
|
<li style="font-size:10pt">pgalves (Inline Messages)</li>
|
||||||
|
</ul>
|
||||||
|
<p style="font-size:x-large; font-weight:600;">Translations:</p>
|
||||||
|
<ul>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Chinese:</span> Biggulu, ligyxy, BestSteve</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Czech:</span> pavelb, JosefVitu</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Dutch:</span> Vistaus, KnooL, apie</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Finnish:</span> MawKKe</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">French:</span> Scrat15, frgnca, gilbsgilbs, gtalbot, iannick, kyodev, logut</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">German:</span> Calyrx, DavidHamburg, antsas, codejunky, jensrutschmann, montilo, omnisome4, origin_de, pcrcoding, phoerious, rgloor, vlenzer</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Greek:</span> nplatis</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Italian:</span> TheZ3ro, FranzMari, Mte90, tosky</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Kazakh:</span> sotrud_nik</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Lithuanian:</span> Moo</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Polish:</span> konradmb, mrerexx</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Portuguese: </span>vitor895, weslly, American_Jesus, mihai.ile</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Russian:</span> vsvyatski, KekcuHa, wkill95</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Spanish:</span> EdwardNavarro, antifaz, piegope, pquin, vsvyatski</li>
|
||||||
|
<li style="font-size:10pt"><span style="font-weight:600;">Swedish:</span> henziger</li>
|
||||||
|
</ul>
|
||||||
|
</body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center"><a href="https://github.com/keepassxreboot/keepassxc/graphs/contributors"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">See Contributions on GitHub</span></a></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Debug Info</string>
|
<string>Debug Info</string>
|
||||||
@ -198,7 +268,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Include the following information whenever you report a bug:</string>
|
<string><html><head/><body><p>Include the following information whenever you report a bug:</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -94,7 +94,8 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
|||||||
m_searchingLabel = new QLabel();
|
m_searchingLabel = new QLabel();
|
||||||
m_searchingLabel->setText(tr("Searching..."));
|
m_searchingLabel->setText(tr("Searching..."));
|
||||||
m_searchingLabel->setAlignment(Qt::AlignCenter);
|
m_searchingLabel->setAlignment(Qt::AlignCenter);
|
||||||
m_searchingLabel->setStyleSheet("background-color: rgb(255, 253, 160);"
|
m_searchingLabel->setStyleSheet("color: rgb(0, 0, 0);"
|
||||||
|
"background-color: rgb(255, 253, 160);"
|
||||||
"border: 2px solid rgb(190, 190, 190);"
|
"border: 2px solid rgb(190, 190, 190);"
|
||||||
"border-radius: 5px;");
|
"border-radius: 5px;");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user