You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cryptsetup2 2.6.1 is a new release that supports reencryption of Q4.2 release
LUKS2 volumes. This is a critical feature for the Qubes OS 4.2 release.
cryptsetup 2.6.1 requires lvm2 2.03.23, which is also included in this PR.
lvm2 in turn requires libaio, which is also included in this PR.
util-linux 2.39 is also included in this PR and a dependency of lvm2.
patches for reproducible builds are included for all packages.
luks-functions is updated to support the new cryptsetup2 version calls
reencryption happen in direct-io, offline mode and without locking.
from tests, this is best for performance and reliability in single-user mode
TODO:
- async (AIO) calls are not used. direct-io is used instead. libaio could be hacked out
- this could be subject to future work
- time to deprecated legacy boards the do not enough space for the new space requirements
- x230-legacy, x230-legacy-flash, x230-hotp-legacy
- t430-legacy, t430-legacy-flash, t430-hotp-legacy already deprecated
Signed-off-by: Thierry Laurion <[email protected]>
warn "Testing opening "$LUKS" LUKS encrypted drive content with the current LUKS Disk Recovery Key passphrase..."
311
-
cryptsetup open $LUKStest --key-file /tmp/luks_current_Disk_Recovery_Key_passphrase
312
306
fi
313
-
#Validate past cryptsetup-reencrypt attempts
314
-
if [ $?-eq 0 ];then
307
+
308
+
#output test coming and do cryptsetup open call
309
+
echo -e "\nTesting opening "$LUKS" LUKS encrypted drive content with the current LUKS Disk Recovery Key passphrase..."
310
+
cryptsetup open $LUKStest --key-file /tmp/luks_current_Disk_Recovery_Key_passphrase
311
+
312
+
#Validate past cryptsetup reencrypt attempts
313
+
if [ $?-ne 0 ];then
315
314
whiptail --title 'Invalid Actual LUKS Disk Recovery Key passphrase?' --msgbox \
316
-
"If you previously changed it and do not remember it, you will have to\n reinstall the OS from a an external drive.\n\nTo do so, place the ISO file and its signature file on root of an\n external drive, and select Options-> Boot from USB \n\nHit Enter to retry."30 60
315
+
"If you previously changed it and do not remember it, you will have to\n reinstall the OS from a an external drive.\n\nTo do so, place the ISO file and its signature file on root of an\n external drive, and select Options-> Boot from USB \n\nHit Enter to retry."0 80
if [ -z"$luks_current_Disk_Recovery_Key_passphrase" ];then
347
350
#if no external provisioning provides current LUKS Disk Recovery Key passphrase
348
351
msg=$(echo -e "This will replace the encrypted container content and its LUKS Disk Recovery Key.\n\nThe passphrase associated with this key will be asked from the user under the following conditions:\n 1-Every boot if no Disk Unlock Key was added to the TPM\n 2-If the TPM fails (hardware failure)\n 3-If the firmware has been tampered with/modified by the user\n\nThis process requires you to type the current LUKS Disk Recovery Key passphrase and will delete the LUKS TPM Disk Unlock Key slot, if set up, by setting a default boot LUKS key slot (1) if present.\n\nAt the next prompt, you may be asked to select which file corresponds to the LUKS device container.\n\nHit Enter to continue."| fold -w 70 -s)
@@ -351,17 +354,20 @@ luks_reencrypt() {
351
354
echo -e "\nEnter the current LUKS Disk Recovery Key passphrase:"
whiptail --title 'Invalid Actual LUKS Disk Recovery Key passphrase?' --msgbox \
364
-
"If you previously changed it and do not remember it, you will have to\n reinstall the OS from a an external drive.\n\nTo do so, place the ISO file and its signature file on root of an\n external drive, and select Options-> Boot from USB \n\nHit Enter to retry."30 60
370
+
"If you previously changed it and do not remember it, you will have to\n reinstall the OS from a an external drive.\n\nTo do so, place the ISO file and its signature file on root of an\n external drive, and select Options-> Boot from USB \n\nHit Enter to retry."0 80
#unsetting luks_current_Disk_Recovery_Key_passphrase so we prompt for it again LUKS Disk Recovery Key passphrase prompt on next round
367
373
unset luks_current_Disk_Recovery_Key_passphrase
@@ -371,11 +377,15 @@ luks_reencrypt() {
371
377
mount -o remount,rw /boot
372
378
rm -f /boot/kexec_key_devices.txt
373
379
mount -o remount,ro /boot
380
+
unset LUKS
374
381
else
375
382
#Reencryption was successful. Cleanup should be called only when done
376
383
#Exporting successfully used passphrase possibly reused by oem-factory-reset
377
384
export luks_current_Disk_Recovery_Key_passphrase
378
-
break;
385
+
export LUKS
386
+
387
+
# we break loop since success
388
+
break;
379
389
fi
380
390
done
381
391
}
@@ -388,7 +398,7 @@ luks_change_passphrase()
388
398
#if actual or new LUKS Disk Recovery Key is not provisioned by oem-provisioning file
389
399
if [ -z"$luks_current_Disk_Recovery_Key_passphrase" ] || [ -z"$luks_new_Disk_Recovery_Key_passphrase" ];then
390
400
whiptail --title 'Changing LUKS Disk Recovery Key passphrase' --msgbox \
391
-
"Please enter the current LUKS Disk Recovery Key passphrase (slot 0).\nThen choose a strong passphrase of your own.\n\n**DICEWARE passphrase methodology is STRONGLY ADVISED.**\n\nHit Enter to continue"30 60
401
+
"Please enter the current LUKS Disk Recovery Key passphrase (slot 0).\nThen choose a strong passphrase of your own.\n\n**DICEWARE passphrase methodology is STRONGLY ADVISED.**\n\nHit Enter to continue"0 80
392
402
if [ -z"$luks_new_Disk_Recovery_Key_passphrase" ];then
393
403
echo -e "\nEnter your desired replacement for the actual LUKS Disk Recovery Key passphrase (At least 8 characters long):"
394
404
while [[ ${#luks_new_Disk_Recovery_Key_passphrase}-lt 8 ]];do
"The LUKS Disk Recovery Key passphrase was provided to you by the OEM over\n a secure communication channel.\n\nIf you previously changed it and do not remember it,\n you will have to reinstall the OS from a USB drive.\nTo do so, put OS ISO file and it's signature file on root of a USB drive,\n and select Boot from USB\n\nHit Enter to continue."30 60
431
+
"The LUKS Disk Recovery Key passphrase was provided to you by the OEM over\n a secure communication channel.\n\nIf you previously changed it and do not remember it,\n you will have to reinstall the OS from a USB drive.\nTo do so, put OS ISO file and it's signature file on root of a USB drive,\n and select Boot from USB\n\nHit Enter to continue."0 80
422
432
unset luks_current_Disk_Recovery_Key_passphrase
423
433
unset luks_new_Disk_Recovery_Key_passphrase
424
434
#remove "known good" selected LUKS container so that next pass asks again user to select LUKS container.
@@ -429,10 +439,20 @@ luks_change_passphrase()
429
439
mount -o remount,ro /boot
430
440
else
431
441
#Cryptsetup was successful.
442
+
echo"Success."
443
+
432
444
#Cleanup should be called seperately.
433
445
#Exporting successfully used passphrase possibly reused by oem-factory-reset
0 commit comments