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.
This commit is contained in:
Andre Heinecke 2017-07-26 15:07:27 +02:00
parent 7fde780cc1
commit c7be41a5f8
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -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