+/**
+ * compare_signatures - Check to see if 2 OpenPGP signatures are the same.
+ * @a: The first signature to compare.
+ * @b: The second signature to compare.
+ *
+ * Takes 2 signature packets and returns true if they are the same and
+ * false otherwise.
+ */
+bool compare_signatures(struct openpgp_packet *a, struct openpgp_packet *b)
+{
+ uint64_t a_keyid, b_keyid;
+ time_t a_creation, b_creation;
+
+ if (a->data[0] != b->data[0]) {
+ /* Different signature versions, so not the same */
+ return false;
+ } else if (a->data[0] == 4 && a->data[1] != b->data[1]) {
+ /* Type 4 signature, but different types */
+ return false;
+ } else {
+ sig_info(a, &a_keyid, &a_creation);
+ sig_info(b, &b_keyid, &b_creation);
+ return (a_creation == b_creation) && (a_keyid == b_keyid);
+ }
+}
+