From af3643c919e51dbf882d7cb29380478239a10a1d Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 28 Apr 2011 08:10:10 -0500 Subject: [PATCH] crc24 was not encoded --- examples/sign.php | 3 +++ lib/openpgp.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/sign.php b/examples/sign.php index b22c81c..c6395cc 100644 --- a/examples/sign.php +++ b/examples/sign.php @@ -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]; diff --git a/lib/openpgp.php b/lib/openpgp.php index a526135..b3a2fd6 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -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; }