From e988ea1d1a286dd0f27af0657f9665d5cd8573aa Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Fri, 25 Jan 2008 23:50:35 +0200 Subject: Added more Multi-Block test files. Improved some descriptions in the test files' README. --- tests/files/README | 34 +++++++++++++++++++++++++------ tests/files/bad-multi-none-block_1.lzma | Bin 0 -> 66 bytes tests/files/bad-multi-none-block_2.lzma | Bin 0 -> 66 bytes tests/files/good-multi-none-block_1.lzma | Bin 0 -> 66 bytes 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 tests/files/bad-multi-none-block_1.lzma create mode 100644 tests/files/bad-multi-none-block_2.lzma create mode 100644 tests/files/good-multi-none-block_1.lzma (limited to 'tests') diff --git a/tests/files/README b/tests/files/README index ebf8d863..b1d0b686 100644 --- a/tests/files/README +++ b/tests/files/README @@ -101,6 +101,10 @@ Block. Footer Metadata Block contains only Size of Header Metadata Block and Total Size. + good-multi-none-block_1.lzma has Index in Header Metadata Block. The + Compressed Size and Uncompressed Size fields are present in the Data + Blocks. There is some Footer Padding between the Blocks. + 2.2. Bad Files @@ -191,12 +195,15 @@ bad-multi-none-header_2.lzma has Index in the Header Metadata Block, which describes only one Data Block, while the Stream actually has - two Data Blocks. A decoder should give an error when it detects the - second Data Block. + two Data Blocks. A sophisticated decoder should give an error when + it detects the second Data Block; all Multi-Block decoders must + detect the file as corrupt at some point. bad-multi-none-header_3.lzma contains too small Total Size in Header - Metadata Block. A decoder should abort decoding before the second - Data Block, preferably before the first Data Block has been finished. + Metadata Block. A sophisticated decoder should abort decoding before + the second Data Block, preferably before the first Data Block has + been finished; all Multi-Block decoders must detect the file as + corrupt at some point. bad-multi-none-header_4.lzma is like bad-multi-none-header_3.lzma but with too small Uncompressed Size. @@ -205,8 +212,23 @@ but the Total Size field is missing from the Footer Metadata Block. bad-multi-none-header_6.lzma has both Index and Total Size in Header - Metadata Block, but Total Size doesn't match the Index. A decoder - should abort before decoding any Data Blocks. + Metadata Block, but Total Size doesn't match the Index. A sophisticated + decoder should abort before decoding any Data Blocks; all Multi-Block + decoders must detect the file as corrupt at some point. + + bad-multi-none-block_1.lzma has wrong Uncompressed Size in the first + Data Block. A sophisticated decoder should detect this error before + producing any output, because it can see that the Uncompressed Size + doesn't match with the Index in Header Metadata Block; all Multi-Block + decoders must detect the file as corrupt at some point. + + bad-multi-none-block_2.lzma has too big Compressed Size in the first + Data Block. A sophisticated decoder may be able to detect the file as + corrupt before producing any output, because Comrpessed Size + size + of Block Header exceed the Total Size stored in Index in Header + Metadata Block. A sophisticated decoder should be able to detect the + error before the end of the first Data Block; all Multi-Block decoders + must detect the file as corrupt at some point. 2.3. Malicious Files diff --git a/tests/files/bad-multi-none-block_1.lzma b/tests/files/bad-multi-none-block_1.lzma new file mode 100644 index 00000000..17385aec Binary files /dev/null and b/tests/files/bad-multi-none-block_1.lzma differ diff --git a/tests/files/bad-multi-none-block_2.lzma b/tests/files/bad-multi-none-block_2.lzma new file mode 100644 index 00000000..b88836a5 Binary files /dev/null and b/tests/files/bad-multi-none-block_2.lzma differ diff --git a/tests/files/good-multi-none-block_1.lzma b/tests/files/good-multi-none-block_1.lzma new file mode 100644 index 00000000..b573e36a Binary files /dev/null and b/tests/files/good-multi-none-block_1.lzma differ -- cgit v1.2.3