ReFirmLabs / binwalk

Firmware Analysis Tool
MIT License
10.54k stars 1.51k forks source link

test_firmware_zip fails with 2.3.3 upgrade #566

Open mweinelt opened 2 years ago

mweinelt commented 2 years ago

We (NixOS) are just in the process of upgrading from 2.2.2 to 2.3.3 and the firmware.zip test is failing.

FAIL: Test: Open firmware.zip, scan for signatures
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/nix/store/7vl0qcb8gkxllmrzgsdvnw3yyca51rcb-python3.9-nose-1.3.7/lib/python3.9/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/source/testing/tests/test_firmware_zip.py", line 32, in test_firmware_zip
    eq_(len(scan_result[0].results), len(expected_results))
AssertionError: 4 != 2

These are the descriptions of the scan_result:

Zip archive data, at least v1.0 to extract, name: dir655_revB_FW_203NA/
Zip archive data, at least v2.0 to extract, compressed size: 6395868, uncompressed size: 6422554, name: dir655_revB_FW_203NA/DIR655B1_FW203NAB02.bin
Zip archive data, at least v2.0 to extract, compressed size: 14243, uncompressed size: 61440, name: dir655_revB_FW_203NA/dir655_revB_release_notes_203NA.doc
End of Zip archive, footer length: 22

and this is what was expected:

    expected_results = [
    [0, 'Zip archive data, at least v1.0 to extract, name: dir655_revB_FW_203NA/'],
    [6410581, 'End of Zip archive, footer length: 22'],
    ]

Looks related to this change: https://github.com/ReFirmLabs/binwalk/commit/dd4f2efd275c9dd1001130e82e0f985110cd2754

gyakovlev commented 2 years ago

we hit same on gentoo. reverting second hunk, that touches testing/tests/test_firmware_zip.py was enough to fix, we did not revert the traversal test.