Commit 5d690336 authored by Andrea Scarpino's avatar Andrea Scarpino

Show a visible fingerprint for the generated password

parent 1ac7576c
......@@ -34,9 +34,9 @@ Page {
target: manager
onGeneratedMasterKey: {
fprint.text = fingerprint;
busy.visible = busy.running = false;
name.enabled = password.enabled = version.enabled = true;
pageStack.pop();
}
}
......@@ -87,6 +87,11 @@ Page {
anchors.horizontalCenter: parent.horizontalCenter
}
Label {
id: fprint
anchors.horizontalCenter: parent.horizontalCenter
}
Button {
id: save
text: qsTr("Generate");
......@@ -96,6 +101,7 @@ Page {
onClicked: {
enabled = name.enabled = password.enabled = version.enabled = false;
busy.visible = busy.running = true;
fprint.text = "";
manager.generateMasterKey(name.text, password.text, version.currentIndex);
}
}
......@@ -103,6 +109,7 @@ Page {
Component.onCompleted: {
name.text = manager.getName();
fprint.text = manager.getFingerprint();
if (name.text.length > 0) {
password.forceActiveFocus();
......
* Wed Jul 20 2016 Andrea Scarpino <me@andreascarpino.it> 0.2.1-1
- Show a visible fingerprint for the generated password
* Tue Jun 07 2016 Andrea Scarpino <me@andreascarpino.it> 0.2.0-1
- Store sites and their preferences
- Show password in cover page
......
......@@ -13,7 +13,7 @@ Name: harbour-mpw
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: MasterPassword client
Version: 0.2.0
Version: 0.2.1
Release: 1
Group: Qt/Qt
License: MIT
......
Name: harbour-mpw
Summary: MasterPassword client
Version: 0.2.0
Version: 0.2.1
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
......
......@@ -32,6 +32,11 @@ extern "C"
#define MPWALGORITHM_H
#include <mpw-algorithm.h>
#endif
#ifndef MPWUTIL_H
#define MPWUTIL_H
#include <mpw-util.h>
#endif
}
AsyncMasterKey::AsyncMasterKey(const QString &name, const QString &password,
......@@ -56,5 +61,7 @@ void AsyncMasterKey::generate()
qCritical() << "Error during master key generation.";
}
Q_EMIT finished(key);
const char* fingerprint = mpw_identicon(m_name.toUtf8().data(), m_password.toUtf8().data());
Q_EMIT finished(key, QString::fromUtf8(fingerprint));
}
......@@ -38,7 +38,7 @@ public:
virtual ~AsyncMasterKey();
Q_SIGNALS:
void finished(QByteArray *key);
void finished(QByteArray *key, const QString &fingerprint);
public Q_SLOTS:
void generate();
......
......@@ -62,6 +62,11 @@ QString MPWManager::getName() const
return m_name;
}
QString MPWManager::getFingerprint() const
{
return m_fingerprint;
}
void MPWManager::setAlgorithmVersion(AlgorithmVersion version)
{
qDebug() << "Using algorithm version:" << version;
......@@ -92,12 +97,13 @@ void MPWManager::generateMasterKey(const QString &name, const QString &password,
thread->start();
}
void MPWManager::gotMasterKey(QByteArray *key)
void MPWManager::gotMasterKey(QByteArray *key, const QString &fingerprint)
{
qDebug() << "Storing master key";
m_key = key;
Q_EMIT generatedMasterKey();
m_fingerprint = fingerprint;
Q_EMIT generatedMasterKey(fingerprint);
}
QString MPWManager::getPassword(const QString &site, PasswordType type, const uint counter) const
......
......@@ -59,6 +59,7 @@ public:
Q_INVOKABLE AlgorithmVersion getAlgorithmVersion() const;
Q_INVOKABLE QString getName() const;
Q_INVOKABLE QString getFingerprint() const;
Q_INVOKABLE void setAlgorithmVersion(AlgorithmVersion version);
Q_INVOKABLE void setName(const QString &name);
......@@ -73,10 +74,10 @@ public:
static MPSiteType toMPSiteType(PasswordType type);
Q_SIGNALS:
void generatedMasterKey();
void generatedMasterKey(const QString &fingerprint);
protected Q_SLOTS:
void gotMasterKey(QByteArray *key);
void gotMasterKey(QByteArray *key, const QString &fingerprint);
private:
AlgorithmVersion algVersionFromInt(const uint &version);
......@@ -84,6 +85,7 @@ private:
DBManager *m_db;
SitesSqlModel* m_model;
QString m_name;
QString m_fingerprint;
AlgorithmVersion m_algVersion;
QByteArray *m_key;
QSettings *m_settings;
......
<?xml version="1.0" ?><!DOCTYPE TS><TS language="it" version="2.1">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="it">
<context>
<name>MainPage</name>
<message>
......@@ -100,37 +102,37 @@
<translation>Nome completo</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="68"/>
<location filename="../qml/pages/Settings.qml" line="64"/>
<source>Master password</source>
<translation>Master password</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="80"/>
<location filename="../qml/pages/Settings.qml" line="72"/>
<source>Algorithm version</source>
<translation>Versione algoritmo</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="85"/>
<location filename="../qml/pages/Settings.qml" line="77"/>
<source>V0</source>
<translation>V0</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="86"/>
<location filename="../qml/pages/Settings.qml" line="78"/>
<source>V1</source>
<translation>V1</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="87"/>
<location filename="../qml/pages/Settings.qml" line="79"/>
<source>V2</source>
<translation>V2</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="88"/>
<location filename="../qml/pages/Settings.qml" line="80"/>
<source>V3</source>
<translation>V3</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="100"/>
<location filename="../qml/pages/Settings.qml" line="97"/>
<source>Generate</source>
<translation>Genera</translation>
</message>
......@@ -148,4 +150,4 @@
<translation>Sto cancellando...</translation>
</message>
</context>
</TS>
\ No newline at end of file
</TS>
......@@ -102,37 +102,37 @@
<translation>Fullständigt namn</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="68"/>
<location filename="../qml/pages/Settings.qml" line="64"/>
<source>Master password</source>
<translation>Huvudlösenord</translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="80"/>
<location filename="../qml/pages/Settings.qml" line="72"/>
<source>Algorithm version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="85"/>
<location filename="../qml/pages/Settings.qml" line="77"/>
<source>V0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="86"/>
<location filename="../qml/pages/Settings.qml" line="78"/>
<source>V1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="87"/>
<location filename="../qml/pages/Settings.qml" line="79"/>
<source>V2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="88"/>
<location filename="../qml/pages/Settings.qml" line="80"/>
<source>V3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="100"/>
<location filename="../qml/pages/Settings.qml" line="97"/>
<source>Generate</source>
<translation type="unfinished"></translation>
</message>
......
......@@ -102,37 +102,37 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="68"/>
<location filename="../qml/pages/Settings.qml" line="64"/>
<source>Master password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="80"/>
<location filename="../qml/pages/Settings.qml" line="72"/>
<source>Algorithm version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="85"/>
<location filename="../qml/pages/Settings.qml" line="77"/>
<source>V0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="86"/>
<location filename="../qml/pages/Settings.qml" line="78"/>
<source>V1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="87"/>
<location filename="../qml/pages/Settings.qml" line="79"/>
<source>V2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="88"/>
<location filename="../qml/pages/Settings.qml" line="80"/>
<source>V3</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="100"/>
<location filename="../qml/pages/Settings.qml" line="97"/>
<source>Generate</source>
<translation type="unfinished"></translation>
</message>
......
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