From 588de091451eb247dcac36138822b8650af28726 Mon Sep 17 00:00:00 2001 From: Colin Vidal Date: Wed, 19 Nov 2025 12:33:52 +0100 Subject: [PATCH] add strict bound check tests Add checkconf system test covering the strict boundary checks for `edns-version`, `edns-udp-size`, `max-udp-size`, `no-cookie-udp-size` and `padding`. --- .../checkconf/bad-edns-udp-size-options.conf | 16 ++++++++++++++++ .../checkconf/bad-edns-udp-size-server.conf | 16 ++++++++++++++++ .../bad-edns-udp-size-view-server.conf | 18 ++++++++++++++++++ .../checkconf/bad-edns-udp-size-view.conf | 16 ++++++++++++++++ .../checkconf/bad-edns-version-server.conf | 16 ++++++++++++++++ .../bad-edns-version-view-server.conf | 18 ++++++++++++++++++ .../checkconf/bad-max-udp-size-options.conf | 16 ++++++++++++++++ .../checkconf/bad-max-udp-size-server.conf | 16 ++++++++++++++++ .../bad-max-udp-size-view-server.conf | 18 ++++++++++++++++++ .../checkconf/bad-max-udp-size-view.conf | 16 ++++++++++++++++ .../bad-nocookie-udp-size-options.conf | 16 ++++++++++++++++ .../checkconf/bad-nocookie-udp-size-view.conf | 16 ++++++++++++++++ .../system/checkconf/bad-padding-server.conf | 16 ++++++++++++++++ .../checkconf/bad-padding-view-server.conf | 18 ++++++++++++++++++ 14 files changed, 232 insertions(+) create mode 100644 bin/tests/system/checkconf/bad-edns-udp-size-options.conf create mode 100644 bin/tests/system/checkconf/bad-edns-udp-size-server.conf create mode 100644 bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf create mode 100644 bin/tests/system/checkconf/bad-edns-udp-size-view.conf create mode 100644 bin/tests/system/checkconf/bad-edns-version-server.conf create mode 100644 bin/tests/system/checkconf/bad-edns-version-view-server.conf create mode 100644 bin/tests/system/checkconf/bad-max-udp-size-options.conf create mode 100644 bin/tests/system/checkconf/bad-max-udp-size-server.conf create mode 100644 bin/tests/system/checkconf/bad-max-udp-size-view-server.conf create mode 100644 bin/tests/system/checkconf/bad-max-udp-size-view.conf create mode 100644 bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf create mode 100644 bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf create mode 100644 bin/tests/system/checkconf/bad-padding-server.conf create mode 100644 bin/tests/system/checkconf/bad-padding-view-server.conf diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-options.conf b/bin/tests/system/checkconf/bad-edns-udp-size-options.conf new file mode 100644 index 0000000000..308a3c427f --- /dev/null +++ b/bin/tests/system/checkconf/bad-edns-udp-size-options.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + edns-udp-size 4097; +}; diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-server.conf b/bin/tests/system/checkconf/bad-edns-udp-size-server.conf new file mode 100644 index 0000000000..a77797d00a --- /dev/null +++ b/bin/tests/system/checkconf/bad-edns-udp-size-server.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +server 1.2.3.4 { + edns-udp-size 511; +}; diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf b/bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf new file mode 100644 index 0000000000..88657b3951 --- /dev/null +++ b/bin/tests/system/checkconf/bad-edns-udp-size-view-server.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + server 10.11.12.13 { + edns-udp-size 13; + }; +}; diff --git a/bin/tests/system/checkconf/bad-edns-udp-size-view.conf b/bin/tests/system/checkconf/bad-edns-udp-size-view.conf new file mode 100644 index 0000000000..18e653c460 --- /dev/null +++ b/bin/tests/system/checkconf/bad-edns-udp-size-view.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + edns-udp-size 4097; +}; diff --git a/bin/tests/system/checkconf/bad-edns-version-server.conf b/bin/tests/system/checkconf/bad-edns-version-server.conf new file mode 100644 index 0000000000..709ebdd4b5 --- /dev/null +++ b/bin/tests/system/checkconf/bad-edns-version-server.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +server 1.2.3.4 { + edns-version 256; +}; diff --git a/bin/tests/system/checkconf/bad-edns-version-view-server.conf b/bin/tests/system/checkconf/bad-edns-version-view-server.conf new file mode 100644 index 0000000000..1a0f32a84a --- /dev/null +++ b/bin/tests/system/checkconf/bad-edns-version-view-server.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + server 10.11.12.13 { + edns-version 257; + }; +}; diff --git a/bin/tests/system/checkconf/bad-max-udp-size-options.conf b/bin/tests/system/checkconf/bad-max-udp-size-options.conf new file mode 100644 index 0000000000..bbde2d76a0 --- /dev/null +++ b/bin/tests/system/checkconf/bad-max-udp-size-options.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + max-udp-size 4097; +}; diff --git a/bin/tests/system/checkconf/bad-max-udp-size-server.conf b/bin/tests/system/checkconf/bad-max-udp-size-server.conf new file mode 100644 index 0000000000..efea47e593 --- /dev/null +++ b/bin/tests/system/checkconf/bad-max-udp-size-server.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +server 1.2.3.4 { + max-udp-size 511; +}; diff --git a/bin/tests/system/checkconf/bad-max-udp-size-view-server.conf b/bin/tests/system/checkconf/bad-max-udp-size-view-server.conf new file mode 100644 index 0000000000..8cf72bdc64 --- /dev/null +++ b/bin/tests/system/checkconf/bad-max-udp-size-view-server.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + server 10.11.12.13 { + max-udp-size 13; + }; +}; diff --git a/bin/tests/system/checkconf/bad-max-udp-size-view.conf b/bin/tests/system/checkconf/bad-max-udp-size-view.conf new file mode 100644 index 0000000000..8da68c68cc --- /dev/null +++ b/bin/tests/system/checkconf/bad-max-udp-size-view.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + max-udp-size 4097; +}; diff --git a/bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf b/bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf new file mode 100644 index 0000000000..e230553fe0 --- /dev/null +++ b/bin/tests/system/checkconf/bad-nocookie-udp-size-options.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +options { + nocookie-udp-size 127; +}; diff --git a/bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf b/bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf new file mode 100644 index 0000000000..58cc2fdc4f --- /dev/null +++ b/bin/tests/system/checkconf/bad-nocookie-udp-size-view.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + nocookie-udp-size 127; +}; diff --git a/bin/tests/system/checkconf/bad-padding-server.conf b/bin/tests/system/checkconf/bad-padding-server.conf new file mode 100644 index 0000000000..0bcb147d59 --- /dev/null +++ b/bin/tests/system/checkconf/bad-padding-server.conf @@ -0,0 +1,16 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +server 1.2.3.4 { + padding 513; +}; diff --git a/bin/tests/system/checkconf/bad-padding-view-server.conf b/bin/tests/system/checkconf/bad-padding-view-server.conf new file mode 100644 index 0000000000..967abcdf70 --- /dev/null +++ b/bin/tests/system/checkconf/bad-padding-view-server.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +view foo { + server 10.11.12.13 { + padding 2345; + }; +};