X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=decodekey.c;h=aeb7c623c516a959a277bf0b7177792fb5e472b8;hb=ec3fd8971e87c82b2768b5b9dcbcd569edc3259b;hp=5b2092e024c0b6016e9a77b679fc1c8006f2f019;hpb=8337392d1507b70c6e3e6c6523b6eb8a843a7395;p=onak.git diff --git a/decodekey.c b/decodekey.c index 5b2092e..aeb7c62 100644 --- a/decodekey.c +++ b/decodekey.c @@ -61,11 +61,11 @@ int parse_subpackets(unsigned char *data, uint64_t *keyid, time_t *creation) } else if (packetlen == 255) { packetlen = data[offset++]; packetlen <<= 8; - packetlen = data[offset++]; + packetlen |= data[offset++]; packetlen <<= 8; - packetlen = data[offset++]; + packetlen |= data[offset++]; packetlen <<= 8; - packetlen = data[offset++]; + packetlen |= data[offset++]; } switch (data[offset] & 0x7F) { case OPENPGP_SIGSUB_CREATION: @@ -315,13 +315,13 @@ uint64_t *keysubkeys(struct openpgp_publickey *key) struct openpgp_signedpacket_list *cursubkey = NULL; uint64_t *subkeys = NULL; int count = 0; - + if (key != NULL && key->subkeys != NULL) { subkeys = malloc((spsize(key->subkeys) + 1) * sizeof (uint64_t)); cursubkey = key->subkeys; while (cursubkey != NULL) { - subkeys[count++] = get_packetid(cursubkey->packet); + get_packetid(cursubkey->packet, &subkeys[count++]); cursubkey = cursubkey -> next; } subkeys[count] = 0;