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@
-/* $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 <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
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;
}