diff --git a/lib/openpgp.php b/lib/openpgp.php index 7abab01..319d369 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -420,7 +420,7 @@ class OpenPGP_SignaturePacket extends OpenPGP_Packet { } } - function body() { + function body($trailer=false) { $body = chr(4).chr($this->signature_type).chr($this->key_algorithm).chr($this->hash_algorithm); $hashed_subpackets = ''; @@ -429,6 +429,9 @@ class OpenPGP_SignaturePacket extends OpenPGP_Packet { } $body .= pack('n', strlen($hashed_subpackets)).$hashed_subpackets; + // The trailer is just the top of the body plus some crap + if($trailer) return $body.chr(4).chr(0xff).pack('N', strlen($body)); + $unhashed_subpackets = ''; foreach((array)$this->unhashed_subpackets as $p) { $unhashed_subpackets .= $p->to_bytes();