From: tb Date: Sat, 3 Feb 2024 11:27:55 +0000 (+0000) Subject: proc_parser_mft: simplify logic slightly X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6aaa3c8d0ebce70f4538b581125f23de686e404a;p=openbsd proc_parser_mft: simplify logic slightly This aligns the mft2 case with mft1. There's still a bunch of cleanup needed in here, but the logic seems to converge to something mere mortals can follow. ok job --- diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 529c3a90bd2..e811161c842 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.126 2024/02/02 22:09:56 tb Exp $ */ +/* $OpenBSD: parser.c,v 1.127 2024/02/03 11:27:55 tb Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -416,9 +416,7 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile, warnx("%s: failed fetch, continuing with #%s " "from cache", file2, mft2->seqnum); - if (proc_parser_mft_check(file2, mft2)) { - *mp = mft2; - } else { + if (!proc_parser_mft_check(file2, mft2)) { mft_free(mft2); mft2 = NULL; @@ -434,6 +432,7 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile, free(crl1file); free(file1); + *mp = mft2; crl = crl2; file = file2; *crlfile = crl2file;