[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kgpg] core: prefer size of first non-expired encryption subkey
From: Rolf Eike Beer <kde () opensource ! sf-tec ! de>
Date: 2014-05-31 17:58:23
Message-ID: E1WqnXz-0007Sm-FV () scm ! kde ! org
[Download RAW message or body]
Git commit 0cf2812bcaf9d3f8f36768a1dd481b08b89d6e4c by Rolf Eike Beer.
Committed on 31/05/2014 at 17:57.
Pushed by dakon into branch 'master'.
prefer size of first non-expired encryption subkey
M +10 -2 core/kgpgkey.cpp
http://commits.kde.org/kgpg/0cf2812bcaf9d3f8f36768a1dd481b08b89d6e4c
diff --git a/core/kgpgkey.cpp b/core/kgpgkey.cpp
index fa940c9..13a0dd8 100644
--- a/core/kgpgkey.cpp
+++ b/core/kgpgkey.cpp
@@ -277,13 +277,21 @@ uint KgpgKey::size() const
uint KgpgKey::encryptionSize() const
{
+ const KgpgKeySub *enc = NULL;
// Get the first encryption subkey
for (int i = 0; i < d->gpgsublist->count(); ++i) {
- KgpgKeySub temp = d->gpgsublist->at(i);
+ const KgpgKeySub &temp = d->gpgsublist->at(i);
if (temp.type() & SKT_ENCRYPTION) {
- return temp.size();
+ // if the first encryption subkey is expired
+ // check if there is one that is not
+ if (temp.trust() > TRUST_EXPIRED)
+ return temp.size();
+ if (enc == NULL)
+ enc = &temp;
}
}
+ if (enc != NULL)
+ return enc->size();
return 0;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic