Commit 12503767 authored by Allan McRae's avatar Allan McRae Committed by Andrew Gregory
Browse files

libalpm/signing.c: Fix calculation of packet size in parse_subpacket



Given RFC 4880 provides the code to do this calculation, I am not sure
how I managed to stuff that up!  This bug was only exposed when a
signature made with "include-key-block" was added to the Arch repos,
which provided a subpacket with the required size to hit this issue.

Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
(cherry picked from commit 5f6ef895)
parent 03cfe9e2
......@@ -1098,7 +1098,7 @@ static int parse_subpacket(alpm_handle_t *handle, const char *identifier,
if(length_check(len, spos, 2, handle, identifier) != 0){
return -1;
}
slen = (sig[spos] << 8) | sig[spos + 1];
slen = ((sig[spos] - 192) << 8) + sig[spos + 1] + 192;
spos = spos + 2;
} else {
if(length_check(len, spos, 5, handle, identifier) != 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment