Skip to content

Commit

Permalink
Fix luks2hashcat for empty containers
Browse files Browse the repository at this point in the history
Return error when LUKS container is not initialized.
  • Loading branch information
ventaquil committed Sep 13, 2022
1 parent 8973f2b commit 5b0ef28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/luks2hashcat.py
Expand Up @@ -253,6 +253,8 @@ def extract_version1(file):
payload = file.read(PAYLOAD_SIZE)
if len(payload) < PAYLOAD_SIZE:
raise ValueError("file contains less data than needed")
if sum(payload) == 0:
raise ValueError("file not initialized - payload contains zeros only")

# convert into header
header = HeaderVersion1(
Expand Down

0 comments on commit 5b0ef28

Please sign in to comment.