svenwiltink/sparsecat

v0.4.0+ does not preserve encrypted volume integrity

Closed this issue · 2 comments

In the two most recent releases of Sparsecat, functionality for sparsifying encrypted volumes seems to be broken.

I have created a reproducible example, simply download the code shown here and execute these commands in the order shown:

qemu-img create --object secret,id=sec0,data=myRandomSecret -f qcow2 -o encrypt.format=luks,encrypt.key-secret=sec0 -o preallocation=metadata encrypted.qcow2 5G

go run main.go encrypted.qcow2 encrypted-sparse.qcow2

qemu-img info encrypted.qcow2
qemu-img info encrypted-sparse.qcow2

The sparse encrypted volume should return 'Volume is not in LUKS format' upon an invocation of qemu-img info.

Thanks for the report. I've been able to reproduce the issue and have pushed a fix in version v0.4.2-rc1. Can you verify that this works.

Fixed in v0.4.2