X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=splitkeys.c;h=86a83632a3baf786fac8b9cf2373cae03de041c0;hb=0211c730256c9bbaf10a569c88f7df0ef882311e;hp=6cdf0a0abb1feb418400e5914cd0d014964833b6;hpb=4843efc642ddcfe524bb6ba37b01154e57489ff7;p=onak.git diff --git a/splitkeys.c b/splitkeys.c index 6cdf0a0..86a8363 100644 --- a/splitkeys.c +++ b/splitkeys.c @@ -4,8 +4,6 @@ * Jonathan McDowell * * Copyright 2003 Project Purple - * - * $Id: splitkeys.c,v 1.2 2003/10/03 23:03:02 noodles Exp $ */ #include @@ -19,6 +17,7 @@ #include "log.h" #include "mem.h" #include "onak-conf.h" +#include "openpgp.h" #include "parsekey.h" int main(int argc, char *argv[]) @@ -42,7 +41,7 @@ int main(int argc, char *argv[]) } } - readconfig(); + readconfig(NULL); initlogthing("splitkeys", config.logfile); do { @@ -54,10 +53,14 @@ int main(int argc, char *argv[]) tmp = list_end; list_end = list_end->next; if (list_end->next == NULL && - list_end->packet->tag == 6) { + list_end->packet->tag == + OPENPGP_PACKET_PUBLICKEY) { tmp->next = NULL; } } + if (tmp->next != NULL) { + list_end = NULL; + } snprintf(splitfile, 1023, "splitfile-%d.pgp", count); outfd = open(splitfile, O_WRONLY | O_CREAT, 0664);