diff options
author | Andre Heinecke <[email protected]> | 2017-07-26 13:07:27 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2017-07-26 13:07:55 +0000 |
commit | c7be41a5f850addceb2a95444bad2a31cdcd1ce5 (patch) | |
tree | b94cf199d702a805e1cdec308dd72cf49053fe2c | |
parent | tests: Fix distcheck. (diff) | |
download | gpgme-c7be41a5f850addceb2a95444bad2a31cdcd1ce5.tar.gz gpgme-c7be41a5f850addceb2a95444bad2a31cdcd1ce5.zip |
cpp: Fix Key::isDeVs for subkeys
* lang/cpp/src/key.cpp (Key::isDeVs): Check all subkeys.
--
Previosly only the primary key was checked and not all subkeys.
-rw-r--r-- | lang/cpp/src/key.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index 31e59e19..66fdea96 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -236,7 +236,18 @@ bool Key::isQualified() const bool Key::isDeVs() const { - return key && key->subkeys && key->subkeys->is_de_vs; + if (!key) { + return false; + } + if (!key->subkeys || !key->subkeys->is_de_vs) { + return false; + } + for (gpgme_sub_key_t subkey = key->subkeys ; subkey ; subkey = subkey->next) { + if (!subkey->is_de_vs) { + return false; + } + } + return true; } const char *Key::issuerSerial() const |