Skip to content
Browse files

Generate SignaturePacket trailer

  • Loading branch information...
1 parent 9493707 commit 104ad250ca009e3b2866f901c220ea5c506cda26 @singpolyma singpolyma committed with
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/openpgp.php
View
5 lib/openpgp.php
@@ -420,7 +420,7 @@ function read() {
}
}
- 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 @@ function body() {
}
$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();

0 comments on commit 104ad25

Please sign in to comment.
Something went wrong with that request. Please try again.