diff --git a/src/cryptsetup.c b/src/cryptsetup.c index df13df37..2978fe7f 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -1324,7 +1324,7 @@ static int _luksFormat(struct crypt_device **r_cd, char **r_password, size_t *r_ if (opt_integrity && !opt_integrity_no_wipe) r = _wipe_data_device(cd); out: - if (r == 0 && r_cd && r_password && r_passwordLen) { + if (r >= 0 && r_cd && r_password && r_passwordLen) { *r_cd = cd; *r_password = password; *r_passwordLen = passwordLen; diff --git a/tests/luks2-reencryption-test b/tests/luks2-reencryption-test index 688c396f..e0529c90 100755 --- a/tests/luks2-reencryption-test +++ b/tests/luks2-reencryption-test @@ -816,7 +816,7 @@ check_hash $PWD1 $HASH6 # Device activation after encryption initialization wipe_dev $DEV -echo $PWD1 | $CRYPTSETUP reencrypt $DEV --encrypt --init-only -c aes-cbc-essiv:sha256 -s 128 --reduce-device-size 8M -q $FAST_PBKDF_ARGON $DEV_NAME >/dev/null || fail +echo $PWD1 | $CRYPTSETUP reencrypt $DEV --encrypt --init-only -c aes-cbc-essiv:sha256 -s 128 -S11 --reduce-device-size 8M -q $FAST_PBKDF_ARGON $DEV_NAME >/dev/null || fail $CRYPTSETUP status $DEV_NAME >/dev/null 2>&1 || fail check_hash_dev /dev/mapper/$DEV_NAME $HASH5 echo $PWD1 | $CRYPTSETUP reencrypt --resume-only $DEV -q || fail