Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backend] bs_signer: fix content length patching for iso files #9949

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/backend/bs_signer
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ sub signisofiles {
writeblk($fd, $e->[1], $sig . ("\0" x (2048 - length($sig))));
my $dirblk = readblk($fd, $e->[3]);
# patch in new content len
substr($dirblk, $e->[4] + 10, 4) = pack('V', length($sig));
substr($dirblk, $e->[4] + 10, 4) = pack('V', length($sig)); # little endian
substr($dirblk, $e->[4] + 14, 4) = pack('N', length($sig)); # big endian
writeblk($fd, $e->[3], $dirblk);
$signed++;
}
Expand All @@ -203,7 +204,8 @@ sub signisofiles {
writeblk($fd, $e->[1], $pubkey . ("\0" x (8192 - length($pubkey))));
my $dirblk = readblk($fd, $e->[3]);
# patch in new content len
substr($dirblk, $e->[4] + 10, 4) = pack('V', length($pubkey));
substr($dirblk, $e->[4] + 10, 4) = pack('V', length($pubkey)); # little endian
substr($dirblk, $e->[4] + 14, 4) = pack('N', length($pubkey)); # big endian
writeblk($fd, $e->[3], $dirblk);
$signed++;
}
Expand Down