mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix init for util_wipe call.
It should init crypt, as it uses RNG. Also it should fail early if no device is initialized.
This commit is contained in:
@@ -282,6 +282,10 @@ int crypt_wipe(struct crypt_device *cd,
|
||||
if (!cd)
|
||||
return -EINVAL;
|
||||
|
||||
r = init_crypto(cd);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!dev_path)
|
||||
device = crypt_data_device(cd);
|
||||
else {
|
||||
@@ -292,6 +296,8 @@ int crypt_wipe(struct crypt_device *cd,
|
||||
if (flags & CRYPT_WIPE_NO_DIRECT_IO)
|
||||
device_disable_direct_io(device);
|
||||
}
|
||||
if (!device)
|
||||
return -EINVAL;
|
||||
|
||||
if (!wipe_block_size)
|
||||
wipe_block_size = 1024*1024;
|
||||
|
||||
Reference in New Issue
Block a user