diff options
author | Job Snijders <job@cvs.openbsd.org> | 2023-12-11 15:50:24 +0000 |
---|---|---|
committer | Job Snijders <job@cvs.openbsd.org> | 2023-12-11 15:50:24 +0000 |
commit | 6936375124e602e2f619b9d989663adac575a33b (patch) | |
tree | 5af5e1b53ae7dd36fee04a1c8604649eff147ea5 /usr.sbin/rpki-client/parser.c | |
parent | c3cbfb6ebe12680eb0bb3883d9832ec356b61f8d (diff) |
Log a warning when a manifest replay is detected
OK tb@ claudio@
Diffstat (limited to 'usr.sbin/rpki-client/parser.c')
-rw-r--r-- | usr.sbin/rpki-client/parser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index 61a66db01c4..04259848e13 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.101 2023/12/09 00:44:18 job Exp $ */ +/* $OpenBSD: parser.c,v 1.102 2023/12/11 15:50:23 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -361,7 +361,7 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile, struct crl *crl, *crl1, *crl2; char *file, *file1, *file2, *crl1file, *crl2file; const char *err1, *err2; - int warned = 0; + int r, warned = 0; *mp = NULL; *crlmtime = 0; @@ -376,7 +376,12 @@ proc_parser_mft(struct entity *entp, struct mft **mp, char **crlfile, if (err2 != NULL) err1 = err2; - if (mft_compare(mft1, mft2) == 1) { + r = mft_compare(mft1, mft2); + if (r == -1 && mft1 != NULL && mft2 != NULL) + warnx("%s: manifest replay detected (expected >= #%s, got #%s)", + file1, mft2->seqnum, mft1->seqnum); + + if (r == 1) { *mp = proc_parser_mft_post(file1, mft1, entp->path, err1, &warned); if (*mp == NULL) { |