diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-01-13 14:58:22 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-01-13 14:58:22 +0000 |
commit | 14c24af9f90d3afd1a379c1e40fa4ea342c6368c (patch) | |
tree | ba0a311a9574e5d9346172fd37776d78725dec0f /usr.sbin | |
parent | 9284e378884e9dc83ddfe8c34b1cce55047805fa (diff) |
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rpki-client/parser.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 <claudio@openbsd.org> * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -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; } |