Enigma: Fix deleting keys with authentication subkeys (#6381)

pull/6388/head^2
Aleksander Machniak 6 years ago
parent 477931eceb
commit 412c5ab75b

@ -92,6 +92,7 @@ CHANGELOG Roundcube Webmail
- Fix various issues when downloading files with names containing non-ascii chars, use RFC 2231 (#5772)
- Fix PHP warnings on dummy QUOTA responses in Courier-IMAP 4.17.1 (#6374)
- Fix so fallback from BINARY to BODY FETCH is used also on [PARSE] errors in dovecot 2.3 (#6383)
- Enigma: Fix deleting keys with authentication subkeys (#6381)
RELEASE 1.3.7
-------------

@ -388,13 +388,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) {
break;
}
$result = $this->delete_privkey($keyid);
if ($result === true) {
$result = $this->delete_pubkey($keyid);
}
}
}

Loading…
Cancel
Save