diff options
-rw-r--r-- | gpgcontext.cpp | 4 | ||||
-rw-r--r-- | gpgcontext.h | 1 | ||||
-rw-r--r-- | verifynotification.cpp | 11 |
3 files changed, 9 insertions, 7 deletions
diff --git a/gpgcontext.cpp b/gpgcontext.cpp index d2109e2..4ec3e5a 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -75,6 +75,7 @@ GpgKeyList GpgContext::listKeys() key.expired = false; key.fpr = kkey.fingerprint(); key.id = kkey.id(); + key.fullid = kkey.fullId(); key.name = kkey.name(); key.revoked = false; keys.append(key); @@ -176,11 +177,12 @@ GpgKey GpgContext::getKeyByFpr(QString fpr) { /** * note: privkey status is not returned + * TODO: Long Ids also should be supported */ GpgKey GpgContext::getKeyById(QString id) { foreach (GpgKey key, mKeyList) { - if(key.id == id) { + if(key.id == id || key.fullid == id) { return key; } } diff --git a/gpgcontext.h b/gpgcontext.h index 5fc6b9e..86b988a 100644 --- a/gpgcontext.h +++ b/gpgcontext.h @@ -45,6 +45,7 @@ public: privkey = false; } QString id; + QString fullid; QString name; QString email; QString fpr; diff --git a/verifynotification.cpp b/verifynotification.cpp index 5e10640..b195972 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -240,6 +240,7 @@ void VerifyNotification::slotVerifyDone(int result) qDebug() << "sig: " << vsig[9]; GpgKey key = mCtx->getKeyByFpr(vsig[9]); + verifyLabelText.append(key.name); if (!key.email.isEmpty()) { verifyLabelText.append("<"+key.email+">"); @@ -251,7 +252,7 @@ void VerifyNotification::slotVerifyDone(int result) // verifyStatus=VERIFY_ERROR_CRITICAL; // verifyLabelText.append("no sig found"); - //textIsSigned = 3; + textIsSigned = 3; //verifyStatus=VERIFY_ERROR_CRITICAL; verifyLabelText.append("No signature found "); @@ -263,19 +264,17 @@ void VerifyNotification::slotVerifyDone(int result) }*/ } else if (msg.startsWith(QLatin1String("BADSIG"))) { - int sigpos = msg.indexOf( ' ', 7); + int sigpos = msg.indexOf( ' ', 8); // name not used...? - QString name = msg.mid(sigpos + 1).replace(QLatin1Char('<'), QLatin1String("<")); + //QString name = msg.mid(sigpos + 1).replace(QLatin1Char('<'), QLatin1String("<")); QString id = msg.mid(7, sigpos - 7); - qDebug() << "id:" << id << "|name:" << name; - textIsSigned = 3; verifyStatus=VERIFY_ERROR_CRITICAL; GpgKey key = mCtx->getKeyById(id); verifyLabelText.append(key.name); if (!key.email.isEmpty()) { - verifyLabelText.append("<"+key.email+">"); + verifyLabelText.append("<"+key.email+">"); } break; |