diff options
author | Paulo Matias <matias@ufscar.br> | 2016-09-27 14:50:23 -0300 |
---|---|---|
committer | Paulo Matias <matias@ufscar.br> | 2016-09-27 15:03:04 -0300 |
commit | ce26bc05fff006695c7378ba6dfa721de0ac8fb7 (patch) | |
tree | a7fd7be39ace9655c151a9e27b2b799d3f8b5038 /usersdialog.cpp | |
parent | f7635c045d3e30dfce76dfc6d5ec8d6e02264edd (diff) |
Lookup validity field to check if keys are valid
Currently, the code checks the Ownertrust field [1] to look if a key
should be considered as valid. However, the Ownertrust field should not
be deemed to represent the level of confidence that a key is valid.
Rather, it represents how much the user trusts in the owner of the key
to understand correctly how key signing works and to strictly check
fingerprints before signing keys. Ownertrust is used as input by the
trust models to compute the validity of keys, which is printed by GnuPG
in the Validity field.
This commit changes the code to check the Validity field instead of the
Ownertrust field.
Keys which are at least marginally valid are also included in the user
list dialog, however keys which are not fully valid are printed with
dark orange background.
[1] http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
Diffstat (limited to 'usersdialog.cpp')
-rw-r--r-- | usersdialog.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usersdialog.cpp b/usersdialog.cpp index 6cfb85f5..1259a435 100644 --- a/usersdialog.cpp +++ b/usersdialog.cpp @@ -65,7 +65,7 @@ void UsersDialog::populateList(const QString &filter) { it != userList->end(); ++it) { UserInfo &user(*it); if (filter.isEmpty() || nameFilter.exactMatch(user.name)) { - if (user.validity == '-' && !ui->checkBox->isChecked()) + if (!user.isValid() && !ui->checkBox->isChecked()) continue; if (user.expiry.toTime_t() > 0 && user.expiry.daysTo(QDateTime::currentDateTime()) > 0 && @@ -89,12 +89,15 @@ void UsersDialog::populateList(const QString &filter) { font.setFamily(font.defaultFamily()); font.setBold(true); item->setFont(font); - } else if (user.validity == '-') { + } else if (!user.isValid()) { item->setBackground(QColor(164, 0, 0)); item->setForeground(Qt::white); } else if (user.expiry.toTime_t() > 0 && user.expiry.daysTo(QDateTime::currentDateTime()) > 0) { item->setForeground(QColor(164, 0, 0)); + } else if (!user.fullyValid()) { + item->setBackground(QColor(164, 80, 0)); + item->setForeground(Qt::white); } ui->listWidget->addItem(item); |