Skip to content

Commit

Permalink
Enigma: Fix deleting keys with authentication subkeys (#6381)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Aug 9, 2018
1 parent 477931e commit 412c5ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
11 changes: 4 additions & 7 deletions plugins/enigma/lib/enigma_driver_gnupg.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,10 @@ public function delete_key($keyid)
}
// 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);
}
}
}
Expand Down

0 comments on commit 412c5ab

Please sign in to comment.