Skip to content

Commit

Permalink
Adopt tests to 16 bit long key IDs.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Nov 17, 2022
1 parent 5326f41 commit caedef3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Horde/Crypt/Pgp/Backend/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public function getFingerprintsFromKey($pgpdata)
foreach ($lines as $line) {
$fields = explode(':', $line);
if ($fields[0] == 'pub') {
$keyid = '0x' . substr($fields[4], -8);
$keyid = '0x' . substr($fields[4], -16);
} elseif ($keyid && ($fields[0] == 'fpr')) {
$fingerprints[$keyid] = $fields[9];
$keyid = null;
Expand Down
10 changes: 5 additions & 5 deletions test/Horde/Crypt/Pgp/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testBug6601($pgp)
Comment: [None]
E-Mail: rselsky@bu.edu
Hash-Algorithm: pgp-sha1
Key ID: 0xF3C01D42
Key ID: 0x04A67B37F3C01D42
Key Fingerprint: 5912D91D4C79C6701FFF148604A67B37F3C01D42
',
Expand Down Expand Up @@ -363,7 +363,7 @@ public function testPgpPrettyKey($pgp)
Comment: My Comment
E-Mail: me@example.com
Hash-Algorithm: pgp-sha1
Key ID: 0xBADEABD7
Key ID: 0x7CA74426BADEABD7
Key Fingerprint: 966F4BA9569DE6F65E8253977CA74426BADEABD7
',
Expand All @@ -379,7 +379,7 @@ public function testPgpPrettyKey($pgp)
Comment: My Comment
E-Mail: me@example.com
Hash-Algorithm: pgp-sha1
Key ID: 0xBADEABD7
Key ID: 0x7CA74426BADEABD7
Key Fingerprint: 966F4BA9569DE6F65E8253977CA74426BADEABD7
',
Expand All @@ -403,13 +403,13 @@ public function pgpGetFingerprintsFromKeyProvider()
$fingerprints = array(
array(
array(
'0xBADEABD7' => '966F4BA9569DE6F65E8253977CA74426BADEABD7'
'0x7CA74426BADEABD7' => '966F4BA9569DE6F65E8253977CA74426BADEABD7'
),
$this->_getPublicKey()
),
array(
array(
'0xBADEABD7' => '966F4BA9569DE6F65E8253977CA74426BADEABD7'
'0x7CA74426BADEABD7' => '966F4BA9569DE6F65E8253977CA74426BADEABD7'
),
$this->_getPrivateKey()
)
Expand Down

0 comments on commit caedef3

Please sign in to comment.