summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-03-06 14:02:51 +0100
committerAndre Heinecke <[email protected]>2018-03-06 14:02:51 +0100
commit80105e1b837bbebec9ef79597c2f3b45a6c27059 (patch)
tree20373bc1f0320109fb1c15cc23f92038c2a65990
parentbcc8dfbacd2d2e1d8ac4aaf154faf5db81315e83 (diff)
Print key curves in subkeyswidget
For ECC the curve name is the proper way to show "strenght" otherwise a bp-256 key is not distinguishable from a nist-256 key.
-rw-r--r--src/dialogs/subkeyswidget.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dialogs/subkeyswidget.cpp b/src/dialogs/subkeyswidget.cpp
index 1c9bd23..f2dfb32 100644
--- a/src/dialogs/subkeyswidget.cpp
+++ b/src/dialogs/subkeyswidget.cpp
@@ -136,7 +136,15 @@ void SubKeysWidget::setKey(const GpgME::Key &key)
item->setData(2, Qt::DisplayRole, Kleo::Formatting::creationDateString(subkey));
item->setData(3, Qt::DisplayRole, Kleo::Formatting::expirationDateString(subkey));
item->setData(4, Qt::DisplayRole, Kleo::Formatting::validityShort(subkey));
- item->setData(5, Qt::DisplayRole, QString::number(subkey.length()));
+ switch (subkey.publicKeyAlgorithm()) {
+ case GpgME::Subkey::AlgoECDSA:
+ case GpgME::Subkey::AlgoEDDSA:
+ case GpgME::Subkey::AlgoECDH:
+ item->setData(5, Qt::DisplayRole, QString::fromStdString(subkey.algoName()));
+ break;
+ default:
+ item->setData(5, Qt::DisplayRole, QString::number(subkey.length()));
+ }
item->setData(6, Qt::DisplayRole, Kleo::Formatting::usageString(subkey));
d->ui.subkeysTree->addTopLevelItem(item);
}