diff options
Diffstat (limited to 'framework/src/domain/mime/partmodel.cpp')
-rw-r--r-- | framework/src/domain/mime/partmodel.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/framework/src/domain/mime/partmodel.cpp b/framework/src/domain/mime/partmodel.cpp index c4e002b7..0b95ecbd 100644 --- a/framework/src/domain/mime/partmodel.cpp +++ b/framework/src/domain/mime/partmodel.cpp | |||
@@ -242,21 +242,22 @@ QVariant PartModel::data(const QModelIndex &index, int role) const | |||
242 | case SecurityLevelRole: { | 242 | case SecurityLevelRole: { |
243 | auto signature = messagePart->signatureState(); | 243 | auto signature = messagePart->signatureState(); |
244 | auto encryption = messagePart->encryptionState(); | 244 | auto encryption = messagePart->encryptionState(); |
245 | bool signatureIsOk = signature == MimeTreeParser::KMMsgPartiallySigned || | 245 | bool messageIsSigned = signature == MimeTreeParser::KMMsgPartiallySigned || |
246 | signature == MimeTreeParser::KMMsgFullySigned; | 246 | signature == MimeTreeParser::KMMsgFullySigned; |
247 | bool encryptionIsOk = encryption == MimeTreeParser::KMMsgPartiallyEncrypted || | 247 | bool messageIsEncrypted = encryption == MimeTreeParser::KMMsgPartiallyEncrypted || |
248 | encryption == MimeTreeParser::KMMsgFullyEncrypted; | 248 | encryption == MimeTreeParser::KMMsgFullyEncrypted; |
249 | bool isSigned = signature != MimeTreeParser::KMMsgNotSigned; | 249 | |
250 | bool isEncrypted = encryption != MimeTreeParser::KMMsgNotEncrypted; | 250 | if (messageIsSigned) { |
251 | //Something is wonky | 251 | auto sigInfo = std::unique_ptr<SignatureInfo>{signatureInfo(messagePart)}; |
252 | if ((isSigned && !signatureIsOk) || (isEncrypted && !encryptionIsOk)) { | 252 | if (!sigInfo->signatureIsGood || sigInfo->keyRevoked) { |
253 | if (signature == MimeTreeParser::KMMsgSignatureProblematic || encryption == MimeTreeParser::KMMsgEncryptionProblematic) { | ||
254 | return "bad"; | 253 | return "bad"; |
255 | } | 254 | } |
256 | return "notsogood"; | 255 | if (sigInfo->keyMissing || sigInfo->keyExpired) { |
256 | return "notsogood"; | ||
257 | } | ||
257 | } | 258 | } |
258 | //All good | 259 | //All good |
259 | if (signatureIsOk || encryptionIsOk) { | 260 | if (messageIsSigned || messageIsEncrypted) { |
260 | return "good"; | 261 | return "good"; |
261 | } | 262 | } |
262 | //No info | 263 | //No info |