File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,21 @@ case $? in
1515 ;;
1616# failure; the directory is not a mountpoint, or device is not a block device on --devno
171732)
18+ LUKS_DUMP=$( cryptsetup luksDump --dump-json-metadata /var/lib/cosmian_vm/header)
19+ STATUS=$?
20+
21+ if [ $STATUS -ne 0 ]; then
22+ echo " LUKS header does not exist"
23+ exit 2
24+ fi
25+
26+ NULL_CIPHERS=$( echo " $LUKS_DUMP " | jq ' [.keyslots.[].area.encryption] | select(any(contains("null")))' )
27+
28+ if [ -n " $NULL_CIPHERS " ]; then
29+ echo " cipher_null is not allowed in LUKS header"
30+ exit 3
31+ fi
32+
1833 # unlock the partition
1934 /lib/systemd/systemd-cryptsetup attach cosmian_vm_container /var/lib/cosmian_vm/container - tpm2-device=auto,headless=true,header=/var/lib/cosmian_vm/header || exit 1
2035 # mount the partition
You can’t perform that action at this time.
0 commit comments