summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-07 16:14:29 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-12-07 16:14:29 +0100
commite587910bcb2b260878b7c49d9cb5df5402864eed (patch)
tree41aeb2bf63b9692985261b91fa51ce231ec89fe0 /framework
parent702f5124db8808363ccae060c86389f8a76b34b4 (diff)
downloadkube-e587910bcb2b260878b7c49d9cb5df5402864eed.tar.gz
kube-e587910bcb2b260878b7c49d9cb5df5402864eed.zip
Revamped security border coloring and popup message
Diffstat (limited to 'framework')
-rw-r--r--framework/src/domain/mime/partmodel.cpp23
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