* more details.
*
* You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "decodekey.h"
-#include "keydb.h"
#include "keyid.h"
#include "keystructs.h"
#include "ll.h"
-#include "log.h"
#include "mem.h"
#include "merge.h"
+#include "onak.h"
/**
* compare_packets - Check to see if 2 OpenPGP packets are the same.
struct openpgp_packet_list *curpacket = NULL;
struct openpgp_packet_list *nextpacket = NULL;
- log_assert(compare_packets(old->packet, new->packet) == 0);
+ assert(compare_packets(old->packet, new->packet) == 0);
curpacket = new->sigs;
while (curpacket != NULL) {
if (lastpacket != NULL) {
lastpacket->next = curpacket->next;
} else {
- log_assert(curpacket == new->sigs);
+ assert(curpacket == new->sigs);
new->sigs = curpacket->next;
}
curpacket->next = NULL;
struct openpgp_packet_list *curpacket = NULL;
struct openpgp_packet_list *lastpacket = NULL;
struct openpgp_packet_list *nextpacket = NULL;
+ uint64_t keya, keyb;
if (a == NULL || b == NULL) {
/*
* Do nothing.
*/
- rc = 1;
- } else if (get_keyid(a) != get_keyid(b)) {
+ return 1;
+ }
+
+ if (get_keyid(a, &keya) != ONAK_E_OK) {
+ return 1;
+ } else if (get_keyid(b, &keyb) != ONAK_E_OK) {
+ return 1;
+ } else if (keya != keyb) {
/*
* Key IDs are different.
*/
if (lastpacket != NULL) {
lastpacket->next = curpacket->next;
} else {
- log_assert(curpacket == b->sigs);
+ assert(curpacket == b->sigs);
b->sigs = curpacket->next;
}
curpacket->next = NULL;