crc24 was not encoded

This commit is contained in:
Stephen Paul Weber 2011-04-28 08:10:10 -05:00
parent 6b8445737e
commit af3643c919
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,9 @@
require dirname(__FILE__).'/../lib/openpgp.php';
require dirname(__FILE__).'/../lib/openpgp_crypt_rsa.php';
echo OpenPGP::enarmor("test");
exit;
/* Parse secret key from STDIN, the key must not be password protected */
$wkey = OpenPGP_Message::parse(file_get_contents('php://stdin'));
$wkey = $wkey[0];

View File

@ -29,7 +29,7 @@ class OpenPGP {
$text .= $key . ': ' . (string)$value . "\n";
}
$text .= "\n" . base64_encode($data);
$text .= "\n".'=' . substr(pack('N', self::crc24($data)), 1) . "\n";
$text .= "\n".'=' . base64_encode(substr(pack('N', self::crc24($data)), 1)) . "\n";
$text .= self::footer($marker) . "\n";
return $text;
}