Skip to content

Commit

Permalink
lib/Horde/Crypt/Pgp.php: Shorten long PGP key IDs to 16 digits (inste…
Browse files Browse the repository at this point in the history
…ad of deprecated 8 digits).

 Newer keyserver implementations return a "400 Bad Request" error if
 8-digit-key-IDs are queried (e.g. keys.openpgp.org).
  • Loading branch information
sunweaver authored and yunosh committed Nov 17, 2022
1 parent 7702ffd commit 8ec037a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Horde/Crypt/Pgp.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ public function getKeyIDString($keyid)
if (strpos($keyid, '0x') === 0) {
$keyid = substr($keyid, 2);
}
if (strlen($keyid) > 8) {
$keyid = substr($keyid, -8);
if (strlen($keyid) > 16) {
$keyid = substr($keyid, -16);
}
return '0x' . $keyid;
}
Expand Down

0 comments on commit 8ec037a

Please sign in to comment.