Author: noodles
Date: 2002/11/22 18:54:37
Changed parse_keys to return a count of the number of keys parsed.
*
* This function takes an list of OpenPGP packets and attempts to parse it
* into a list of public keys with signatures and subkeys.
+ *
+ * Returns a count of how many keys we parsed.
*/
int parse_keys(struct openpgp_packet_list *packets,
struct openpgp_publickey **keys)
{
struct openpgp_publickey *curkey = NULL;
+ int count;
+
+ count = 0;
/*
* If keys already has some keys in it then set curkey to the last one
}
memset(curkey, 0, sizeof(*curkey));
curkey->publickey = packet_dup(packets->packet);
+ count++;
break;
case 13:
case 17:
packets = packets->next;
}
- return 0;
+ return count;
}
/**
*
* This function takes an list of OpenPGP packets and attempts to parse it
* into a list of public keys with signatures and subkeys.
+ *
+ * Returns a count of how many keys we parsed.
*/
int parse_keys(struct openpgp_packet_list *packets,
struct openpgp_publickey **keys);