X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=parsekey.h;h=7e2e2bdfd3f5f535681747190e22598a73f0dc46;hb=d76720d2254815018d4881babd73d4723d22033c;hp=2bfaf728ea131ca7cb8766ada350b2ff0c9043b8;hpb=e02c731dfbb288c736f2cd09a9b6df0507c59ddd;p=onak.git diff --git a/parsekey.h b/parsekey.h index 2bfaf72..7e2e2bd 100644 --- a/parsekey.h +++ b/parsekey.h @@ -4,6 +4,8 @@ * Jonathan McDowell * * Copyright 2002 Project Purple + * + * $Id: parsekey.h,v 1.6 2003/10/04 10:21:40 noodles Exp $ */ #ifndef __PARSEKEY_H__ @@ -11,18 +13,6 @@ #include "keystructs.h" -/** - * add_key - Takes a key and adds it to the keyserver. - * @key: The public key to add. - * - * This function takes a public key and adds it to the keyserver. - * It first of all sees if we already have the key locally. If we do then - * we retrieve it and merge the two keys. We then store the resulting key - * (or just the original we received if we don't already have it). We then - * send out the appropriate updates to our keyserver peers. - */ -int add_key(struct openpgp_publickey *key); - /** * parse_keys - Process a stream of packets for public keys + sigs. * @packets: The packet list to parse. @@ -30,6 +20,8 @@ int add_key(struct openpgp_publickey *key); * * 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); @@ -49,15 +41,20 @@ int debug_packet(struct openpgp_packet *packet); * @getchar_func: The function to get the next character from the stream. * @ctx: A pointer to the context structure for getchar_func. * @packets: The outputted list of packets. + * @maxnum: The maximum number of keys to read. 0 means unlimited. * * This function uses getchar_func to read characters from an OpenPGP * packet stream and reads the packets into a linked list of packets - * ready for parsing as a public key or whatever. + * ready for parsing as a public key or whatever. maxnum allows you to + * specify the maximum number of keys to read. Note that if this is used + * then only the public key component of the last key will be returned, + * none of the other packets of the key will be read. */ int read_openpgp_stream(int (*getchar_func)(void *ctx, size_t count, unsigned char *c), void *ctx, - struct openpgp_packet_list **packets); + struct openpgp_packet_list **packets, + int maxnum); /** * write_openpgp_stream - Reads a stream of OpenPGP packets.