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 d8a1f99 commit 3087c25
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 @@ -3,6 +3,7 @@ CHANGELOG Roundcube Webmail

- 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 @@ -374,13 +374,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) {
return $result;
}
$result = $this->delete_privkey($keyid);

if ($result === true) {
$result = $this->delete_pubkey($keyid);
}
}
}
Expand Down

0 comments on commit 3087c25

Please sign in to comment.