From: claudio Date: Thu, 13 Jan 2022 14:58:21 +0000 (+0000) Subject: Move mft_check() after setting repoid and path on the mft. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9aac0c33435a079294e1014aac0ee66d6dbebabe;p=openbsd Move mft_check() after setting repoid and path on the mft. Also skip mft_check() if the mft is stale because at least in -n mode the files to check are probably not around. OK tb@ --- diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 0018e9ecbf8..73e757cdfd3 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.35 2022/01/13 13:46:03 claudio Exp $ */ +/* $OpenBSD: parser.c,v 1.36 2022/01/13 14:58:21 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -310,15 +310,17 @@ proc_parser_mft(char *file, const unsigned char *der, size_t len, sk_X509_free(chain); X509_free(x509); - if (!mft_check(file, mft)) { - mft_free(mft); - return NULL; - } - + mft->repoid = repoid; if (path != NULL) if ((mft->path = strdup(path)) == NULL) err(1, NULL); - mft->repoid = repoid; + + if (!mft->stale) + if (!mft_check(file, mft)) { + mft_free(mft); + return NULL; + } + return mft; }