From: job Date: Mon, 14 Feb 2022 14:46:16 +0000 (+0000) Subject: Name the maximum number of deltas permitted in a RRDP Notification file X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9363012ef285e4b06071662ffe2cc0a5d1ea5470;p=openbsd Name the maximum number of deltas permitted in a RRDP Notification file OK claudio@ tb@ --- diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h index 69d2872dd94..b17595d732f 100644 --- a/usr.sbin/rpki-client/extern.h +++ b/usr.sbin/rpki-client/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.120 2022/02/10 17:33:28 claudio Exp $ */ +/* $OpenBSD: extern.h,v 1.121 2022/02/14 14:46:16 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -652,4 +652,7 @@ int mkpath(const char *); /* Maximum allowd repositories per tal */ #define MAX_REPO_PER_TAL 1000 +/* Maximum number of delta files per RRDP notification file. */ +#define MAX_RRDP_DELTAS 300 + #endif /* ! EXTERN_H */ diff --git a/usr.sbin/rpki-client/rrdp_notification.c b/usr.sbin/rpki-client/rrdp_notification.c index c6cdb0bbf82..d2a3d26b030 100644 --- a/usr.sbin/rpki-client/rrdp_notification.c +++ b/usr.sbin/rpki-client/rrdp_notification.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp_notification.c,v 1.13 2022/02/03 18:19:32 claudio Exp $ */ +/* $OpenBSD: rrdp_notification.c,v 1.14 2022/02/14 14:46:16 job Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -390,7 +390,7 @@ notification_done(struct notification_xml *nxml, char *last_mod) } /* it makes no sense to process too many deltas */ - if (nxml->serial - nxml->repository->serial > 300) + if (nxml->serial - nxml->repository->serial > MAX_RRDP_DELTAS) goto snapshot; /* check that all needed deltas are available */