From bfe287f4a4d6263f7eb0da0f603f084a79417c06 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Tue, 18 Jan 2022 09:36:59 +0100 Subject: [PATCH] Add test for assertion failure in pk11_numbits This test was originally in the pkcs11 system test. While this crash happened in the native pkcs11 of BIND 9, and that code has been removed in 9.17, there is no need for this test. Nevertheless, it doesn't hurt having the test case persist. --- .../2037-pk11_numbits-crash-test.pkt | 30 +++++++++++++++++++ bin/tests/system/engine_pkcs11/tests.sh | 8 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 bin/tests/system/engine_pkcs11/2037-pk11_numbits-crash-test.pkt diff --git a/bin/tests/system/engine_pkcs11/2037-pk11_numbits-crash-test.pkt b/bin/tests/system/engine_pkcs11/2037-pk11_numbits-crash-test.pkt new file mode 100644 index 0000000000..b9c5a32ade --- /dev/null +++ b/bin/tests/system/engine_pkcs11/2037-pk11_numbits-crash-test.pkt @@ -0,0 +1,30 @@ +# 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. +edda 2800 0001 0000 0001 0000 0972 7361 +7368 6132 3536 0765 7861 6d70 6c65 0000 +0600 01c0 0c00 3000 0100 0001 2c01 0801 +0003 0803 0100 0100 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 0000 0000 0000 0000 0000 +0000 0000 0000 00 diff --git a/bin/tests/system/engine_pkcs11/tests.sh b/bin/tests/system/engine_pkcs11/tests.sh index b97c60b69f..256ae2eef3 100644 --- a/bin/tests/system/engine_pkcs11/tests.sh +++ b/bin/tests/system/engine_pkcs11/tests.sh @@ -162,7 +162,13 @@ done # Go back to main test dir. cd .. -# TODO: Checking for assertion failure in pk11_numbits +n=$((n+1)) +ret=0 +echo_i "Checking for assertion failure in pk11_numbits()" +$PERL ../packet.pl -a "10.53.0.1" -p "$PORT" -t udp 2037-pk11_numbits-crash-test.pkt +dig_with_opts @10.53.0.1 version.bind. CH TXT > dig.out.pk11_numbits || ret=1 +test "$ret" -eq 0 || echo_i "failed" +status=$((status+ret)) echo_i "exit status: $status" [ $status -eq 0 ] || exit 1