From: job Date: Fri, 2 Feb 2024 18:11:12 +0000 (+0000) Subject: refactor: don't call proc_parser_mft_post for the first mft X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c6a6e570992d9b5ac270b5a7e08f2d95d7c9da0a;p=openbsd refactor: don't call proc_parser_mft_post for the first mft should be exact same behaviour as before OK tb@ --- diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index c095ff5b305..b7971540b6c 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.120 2024/02/02 16:41:41 tb Exp $ */ +/* $OpenBSD: parser.c,v 1.121 2024/02/02 18:11:12 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -427,12 +427,18 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile, } if (mft1 != NULL) { - *mp = proc_parser_mft_post(file1, mft1, err1, &warned); - if (*mp == NULL) { - mft1 = NULL; - if (mft2 != NULL) - warnx("%s: failed fetch, continuing with #%s" - " from cache", file2, mft2->seqnum); + if (!mft1->stale) { + if (!proc_parser_mft_check(file1, mft1)) { + mft_free(mft1); + mft1 = NULL; + if (mft2 != NULL) + warnx("%s: failed fetch, continuing " + "with #%s from cache", file2, + mft2->seqnum); + } + } else { + /* XXX - preserve behavior; this is probably wrong. */ + *mp = mft1; } }