Generate SignaturePacket trailer
This commit is contained in:
parent
1e2db5b249
commit
ec4b5c5f72
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user