2 * merge.h - Routines to merge OpenPGP public keys.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002-2004 Project Purple
11 #include "keystructs.h"
14 * compare_packets - Check to see if 2 OpenPGP packets are the same.
15 * @a: The first packet to compare.
16 * @b: The second packet to compare.
18 * Takes 2 packets and returns 0 if they are the same, -1 if a is
19 * less than b, or 1 if a is greater than b.
21 int compare_packets(struct openpgp_packet *a, struct openpgp_packet *b);
24 * merge_keys - Takes 2 public keys and merges them.
25 * @a: The old key. The merged key is returned in this structure.
26 * @b: The new key. The changed from old to new keys are returned in this
29 * This function takes 2 keys and merges them. It then returns the merged
30 * key in a and the difference between this new key and the original a
31 * in b (ie newb contains the minimum amount of detail necessary to
32 * convert olda to newa). The intention is that olda is provided from
33 * internal storage and oldb from the remote user. newa is then stored in
34 * internal storage and newb is sent to all our keysync peers.
36 int merge_keys(struct openpgp_publickey *a, struct openpgp_publickey *b);
39 * get_signed_packet - Gets a signed packet from a list.
40 * @packet_list: The list of packets to look in.
41 * @packet: The packet to look for.
43 * Walks through the signedpacket_list looking for the supplied packet and
44 * returns it if found. Otherwise returns NULL.
46 struct openpgp_signedpacket_list *find_signed_packet(
47 struct openpgp_signedpacket_list *packet_list,
48 struct openpgp_packet *packet);
51 * merge_packet_sigs - Takes 2 signed packets and merges their sigs.
52 * @old: The old signed packet.
53 * @new: The new signed packet.
55 * Takes 2 signed packet list structures and the sigs of the packets on
56 * the head of these structures. These packets must both be the same and
57 * the fully merged structure is returned in old and the minimal
58 * difference to get from old to new in new.
60 int merge_packet_sigs(struct openpgp_signedpacket_list *old,
61 struct openpgp_signedpacket_list *new);