From a69433ba406935e7957a72bd16801ba87fdec41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 21 Jul 2020 15:56:13 +0200 Subject: [PATCH] Add PoC system test for pk11_numbits() assertion --- .../pkcs11/2037-pk11_numbits-crash-test.pkt | 20 +++++++++++++++++++ bin/tests/system/pkcs11/tests.sh | 5 +++++ util/copyrights | 1 + 3 files changed, 26 insertions(+) create mode 100644 bin/tests/system/pkcs11/2037-pk11_numbits-crash-test.pkt diff --git a/bin/tests/system/pkcs11/2037-pk11_numbits-crash-test.pkt b/bin/tests/system/pkcs11/2037-pk11_numbits-crash-test.pkt new file mode 100644 index 0000000000..77d87f68ed --- /dev/null +++ b/bin/tests/system/pkcs11/2037-pk11_numbits-crash-test.pkt @@ -0,0 +1,20 @@ +00000000: 0137 edda 2800 0001 0000 0001 0000 0972 .7..(..........r +00000010: 7361 7368 6132 3536 0765 7861 6d70 6c65 sasha256.example +00000020: 0000 0600 01c0 0c00 3000 0100 0001 2c01 ........0.....,. +00000030: 0801 0003 0803 0100 0100 0000 0000 0000 ................ +00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +000000a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +000000b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +000000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +000000d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +000000e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +000000f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000100: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................ +00000130: 0000 0000 0000 0000 00 ......... diff --git a/bin/tests/system/pkcs11/tests.sh b/bin/tests/system/pkcs11/tests.sh index 70962ceae0..259577b6d6 100644 --- a/bin/tests/system/pkcs11/tests.sh +++ b/bin/tests/system/pkcs11/tests.sh @@ -137,5 +137,10 @@ echo_i "Checking if all supported algorithms were tested" [ "$n" -eq "$(wc -l < supported)" ] || ret=1 test_done +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_done + echo_i "exit status: $status" [ "$status" -eq 0 ] || exit 1 diff --git a/util/copyrights b/util/copyrights index 2a14cff3c6..42c5221150 100644 --- a/util/copyrights +++ b/util/copyrights @@ -641,6 +641,7 @@ ./bin/tests/system/pipelined/refb X 2014,2015,2018,2019,2020 ./bin/tests/system/pipelined/setup.sh SH 2014,2015,2016,2017,2018,2019,2020 ./bin/tests/system/pipelined/tests.sh SH 2014,2015,2016,2017,2018,2019,2020 +./bin/tests/system/pkcs11/2037-pk11_numbits-crash-test.pkt X 2020 ./bin/tests/system/pkcs11/clean.sh SH 2010,2012,2014,2016,2017,2018,2019,2020 ./bin/tests/system/pkcs11/setup.sh SH 2010,2012,2013,2014,2016,2017,2018,2019,2020 ./bin/tests/system/pkcs11/tests.sh SH 2010,2012,2014,2016,2017,2018,2019,2020