diff options
author | Aleksander Machniak <alec@alec.pl> | 2018-08-09 16:50:23 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2018-08-09 16:51:57 +0300 |
commit | 3087c25cb6eb413f99012a27f8d6275f36e19e51 (patch) | |
tree | 24bd787426f998875ef2d653d2ec5fdee52625ff /plugins | |
parent | d8a1f99db915de40d497d498bcb07b584a292de8 (diff) |
Enigma: Fix deleting keys with authentication subkeys (#6381)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/enigma/lib/enigma_driver_gnupg.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/enigma/lib/enigma_driver_gnupg.php b/plugins/enigma/lib/enigma_driver_gnupg.php index 09c2c8582..2bbf53347 100644 --- a/plugins/enigma/lib/enigma_driver_gnupg.php +++ b/plugins/enigma/lib/enigma_driver_gnupg.php @@ -374,13 +374,10 @@ class enigma_driver_gnupg extends enigma_driver } // need to delete private key first else if ($code == enigma_error::DELKEY) { - $key = $this->get_key($keyid); - for ($i = count($key->subkeys) - 1; $i >= 0; $i--) { - $type = ($key->subkeys[$i]->usage & enigma_key::CAN_ENCRYPT) ? 'priv' : 'pub'; - $result = $this->{'delete_' . $type . 'key'}($key->subkeys[$i]->id); - if ($result !== true) { - return $result; - } + $result = $this->delete_privkey($keyid); + + if ($result === true) { + $result = $this->delete_pubkey($keyid); } } } |