Commit 490c17b3 authored by Milan Broz's avatar Milan Broz

Fix disk wipe (during keyslot removal) if used on 4k hw block device.

The "Gutmann" metod uses various offset, direct-io need
to even read device when working with buffer...

Fixes Issue 129.
parent f8aa0bc0
2012-05-09 Milan Broz <gmazyland@gmail.com>
* Fix keyslot removal (wipe keyslot) for device with 4k hw block (1.4.0).
2012-05-02 Milan Broz <gmazyland@gmail.com>
* Fix loop mapping on readonly file.
* Relax --shared test, allow mapping even for overlapping segments.
......
......@@ -133,7 +133,7 @@ int crypt_wipe(const char *device,
if (!buffer)
return -ENOMEM;
flags = O_WRONLY | O_DIRECT | O_SYNC;
flags = O_RDWR | O_DIRECT | O_SYNC;
/* use O_EXCL only for block devices */
if (exclusive && S_ISBLK(st.st_mode))
......
......@@ -58,6 +58,19 @@ format() # key_bits expected [forced]
echo "FAIL"
fail "Expected alignment differs: expected $2 != detected $ALIGN"
fi
# test some operation, just in case
echo -e "xxx\naaa" | $CRYPTSETUP luksAddKey $DEV -i1 --key-slot 1
if [ $? -ne 0 ] ; then
echo "FAIL"
fail "Keyslot add failed."
fi
$CRYPTSETUP -q luksKillSlot $DEV 1
if [ $? -ne 0 ] ; then
echo "FAIL"
fail "Keyslot removal failed."
fi
echo "PASSED"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment