diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-10-17 23:49:14 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-10-17 23:49:14 +0000 |
commit | d6f1fc5d0165d8cfc03f2f276addaf8bfb48f2b9 (patch) | |
tree | b1dea76f4cf504c3bef580688e11f863591e0664 /verifynotification.cpp | |
parent | close verifynotification on textchange() (diff) | |
download | gpg4usb-d6f1fc5d0165d8cfc03f2f276addaf8bfb48f2b9.tar.gz gpg4usb-d6f1fc5d0165d8cfc03f2f276addaf8bfb48f2b9.zip |
more visible error if GPG_ERR_BAD_SIGNATURE
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@561 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'verifynotification.cpp')
-rw-r--r-- | verifynotification.cpp | 82 |
1 files changed, 50 insertions, 32 deletions
diff --git a/verifynotification.cpp b/verifynotification.cpp index 9cb2fce..d6bac9e 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -110,29 +110,42 @@ bool VerifyNotification::refresh() while (sign) { switch (gpg_err_code(sign->status)) { - case GPG_ERR_NO_PUBKEY: - { - verifyStatus=VERIFY_ERROR_WARN; - verifyLabelText.append(tr("Key not present with id 0x")+QString(sign->fpr)); - this->keysNotInList->append(sign->fpr); - unknownKeyFound=true; - break; - } - case GPG_ERR_NO_ERROR: - { - GpgKey key = mKeyList->getKeyByFpr(sign->fpr); - verifyLabelText.append(key.name); - if (!key.email.isEmpty()) { - verifyLabelText.append("<"+key.email+">"); + case GPG_ERR_NO_PUBKEY: + { + verifyStatus=VERIFY_ERROR_WARN; + verifyLabelText.append(tr("Key not present with id 0x")+QString(sign->fpr)); + this->keysNotInList->append(sign->fpr); + unknownKeyFound=true; + break; + } + case GPG_ERR_NO_ERROR: + { + GpgKey key = mKeyList->getKeyByFpr(sign->fpr); + verifyLabelText.append(key.name); + if (!key.email.isEmpty()) { + verifyLabelText.append("<"+key.email+">"); + } + break; + } + case GPG_ERR_BAD_SIGNATURE: + { + textIsSigned = 3; + verifyStatus=VERIFY_ERROR_CRITICAL; + GpgKey key = mKeyList->getKeyById(sign->fpr); + verifyLabelText.append(key.name); + if (!key.email.isEmpty()) { + verifyLabelText.append("<"+key.email+">"); + } + break; + } + default: + { + //textIsSigned = 3; + verifyStatus=VERIFY_ERROR_WARN; + //GpgKey key = mKeyList->getKeyByFpr(sign->fpr); + verifyLabelText.append(tr("Error for key with fingerprint ")+mCtx->beautifyFingerprint(QString(sign->fpr))); + break; } - break; - } - default: - { - verifyStatus=VERIFY_ERROR_WARN; - verifyLabelText.append(tr("Error for key with fingerprint ")+mCtx->beautifyFingerprint(QString(sign->fpr))); - break; - } } verifyLabelText.append("\n"); sign = sign->next; @@ -140,16 +153,21 @@ bool VerifyNotification::refresh() switch (textIsSigned) { - case 2: - { - verifyLabelText.prepend(tr("Text was completely signed by: ")); - break; - } - case 1: - { - verifyLabelText.prepend(tr("Text was partially signed by: ")); - break; - } + case 3: + { + verifyLabelText.prepend(tr("Error validating signature by: ")); + break; + } + case 2: + { + verifyLabelText.prepend(tr("Text was completely signed by: ")); + break; + } + case 1: + { + verifyLabelText.prepend(tr("Text was partially signed by: ")); + break; + } } // If an unknown key is found, enable the importfromkeyserveraction |