From: Colin Vidal Date: Wed, 19 Nov 2025 11:33:52 +0000 (+0100) Subject: add strict bound check tests X-Git-Tag: v9.21.17~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=588de091451eb247dcac36138822b8650af28726;p=thirdparty%2Fbind9.git 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`. --- 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 00000000000..308a3c427f4 --- /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 00000000000..a77797d00a4 --- /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 00000000000..88657b3951a --- /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 00000000000..18e653c4603 --- /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 00000000000..709ebdd4b50 --- /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 00000000000..1a0f32a84a6 --- /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 00000000000..bbde2d76a02 --- /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 00000000000..efea47e5936 --- /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 00000000000..8cf72bdc644 --- /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 00000000000..8da68c68cc5 --- /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 00000000000..e230553fe08 --- /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 00000000000..58cc2fdc4f6 --- /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 00000000000..0bcb147d595 --- /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 00000000000..967abcdf700 --- /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; + }; +};