mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-15 04:40:05 +01:00
test generators: unify kill header check functions
This commit is contained in:
@@ -30,9 +30,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c --arg off $OFFS --arg len $LEN \
|
jq -c --arg off $OFFS --arg len $LEN \
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -43,9 +43,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c --arg js $JS 'if .config.json_size != ($js | tostring )
|
jq -c --arg js $JS 'if .config.json_size != ($js | tostring )
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c --arg js $JS 'if .config.json_size != ($js | tostring )
|
jq -c --arg js $JS 'if .config.json_size != ($js | tostring )
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c --arg off $OFFS 'if .config.keyslots_size != ( .segments."0".offset | tonumber - ($off | tonumber) + 4096 | tostring )
|
jq -c --arg off $OFFS 'if .config.keyslots_size != ( .segments."0".offset | tonumber - ($off | tonumber) + 4096 | tostring )
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if (.config.keyslots_size | tonumber % 4096) == 0
|
jq -c 'if (.config.keyslots_size | tonumber % 4096) == 0
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .config.keyslots_size != ([.keyslots[].area.size ] | map(tonumber) | add - 4096 | tostring)
|
jq -c 'if .config.keyslots_size != ([.keyslots[].area.size ] | map(tonumber) | add - 4096 | tostring)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -48,9 +48,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -48,9 +48,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
# .keyslots.7.area.offset = ( ((.config.keyslots_size | tonumber) + ($mda | tonumber) - (.keyslots.7.area.size | tonumber) + 1) | tostring ) |
|
# .keyslots.7.area.offset = ( ((.config.keyslots_size | tonumber) + ($mda | tonumber) - (.keyslots.7.area.size | tonumber) + 1) | tostring ) |
|
||||||
jq -c --arg mda $((2*TEST_MDA_SIZE_BYTES)) --arg jsize $JSON_SIZE \
|
jq -c --arg mda $((2*TEST_MDA_SIZE_BYTES)) --arg jsize $JSON_SIZE \
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE --arg off $DATA_OFFSET --arg mda $((2*TEST_MDA_SIZE_BYTES)) \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE --arg off $DATA_OFFSET --arg mda $((2*TEST_MDA_SIZE_BYTES)) \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -48,9 +48,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $TEST_MDA_SIZE
|
lib_hdr0_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
|
||||||
test "$str_res0" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
read_luks2_json1 $TGT_IMG $TMPDIR/json_res1 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -46,9 +46,8 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $TEST_MDA_SIZE
|
lib_hdr1_killed $TEST_MDA_SIZE || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0 $TEST_JSN_SIZE
|
||||||
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
jq -c --arg koff $KEYSLOTS_OFFSET --arg jsize $JSON_SIZE \
|
||||||
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
'if ([.keyslots[].area.offset] | map(tonumber) | min | tostring != $koff) or
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -46,9 +46,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if (.keyslots."6".area.offset != .keyslots."7".area.offset) or (.keyslots."6".area.size != .keyslots."7".area.size)
|
jq -c 'if (.keyslots."6".area.offset != .keyslots."7".area.offset) or (.keyslots."6".area.size != .keyslots."7".area.size)
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if (.keyslots."7".area.offset != (.keyslots."6".area.offset | tonumber + 1 | tostring)) or
|
jq -c 'if (.keyslots."7".area.offset != (.keyslots."6".area.offset | tonumber + 1 | tostring)) or
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .keyslots."7".area.offset != ([.keyslots."6".area.offset, .keyslots."6".area.size ] | map(tonumber) | add - 1 | tostring)
|
jq -c 'if .keyslots."7".area.offset != ([.keyslots."6".area.offset, .keyslots."6".area.size ] | map(tonumber) | add - 1 | tostring)
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
chks_res0=$(read_sha256_checksum $TGT_IMG)
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".encryption
|
jq -c 'if .segments."0".encryption
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".iv_tweak
|
jq -c 'if .segments."0".iv_tweak
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".sector_size
|
jq -c 'if .segments."0".sector_size
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".encryption | type != "object"
|
jq -c 'if .segments."0".encryption | type != "object"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".iv_tweak != "dynamic"
|
jq -c 'if .segments."0".iv_tweak != "dynamic"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".sector_size != 1023
|
jq -c 'if .segments."0".sector_size != 1023
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".sector_size != "4096"
|
jq -c 'if .segments."0".sector_size != "4096"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".sector_size != -1024
|
jq -c 'if .segments."0".sector_size != -1024
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".offset
|
jq -c 'if .segments."0".offset
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size
|
jq -c 'if .segments."0".size
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".type
|
jq -c 'if .segments."0".type
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."1" | type != "object"
|
jq -c 'if .segments."1" | type != "object"
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".type != "some_type"
|
jq -c 'if .segments."0".type != "some_type"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments | length < 2
|
jq -c 'if .segments | length < 2
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments | length < 64
|
jq -c 'if .segments | length < 64
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".flags != [ "hello", 1 ]
|
jq -c 'if .segments."0".flags != [ "hello", 1 ]
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".flags != "hello"
|
jq -c 'if .segments."0".flags != "hello"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".offset != "-42"
|
jq -c 'if .segments."0".offset != "-42"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size != 4096
|
jq -c 'if .segments."0".size != 4096
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size != "automatic"
|
jq -c 'if .segments."0".size != "automatic"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size != "511"
|
jq -c 'if .segments."0".size != "511"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".type != 42
|
jq -c 'if .segments."0".type != 42
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size != "18446744073709551104"
|
jq -c 'if .segments."0".size != "18446744073709551104"
|
||||||
|
|||||||
@@ -25,9 +25,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size != "18446744073709551616"
|
jq -c 'if .segments."0".size != "18446744073709551616"
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ function generate()
|
|||||||
|
|
||||||
function check()
|
function check()
|
||||||
{
|
{
|
||||||
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1
|
lib_hdr1_killed || exit 2
|
||||||
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
|
||||||
test "$str_res1" = "VACUUM" || exit 2
|
|
||||||
|
|
||||||
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
read_luks2_json0 $TGT_IMG $TMPDIR/json_res0
|
||||||
jq -c 'if .segments."0".size != "-512"
|
jq -c 'if .segments."0".size != "-512"
|
||||||
|
|||||||
@@ -246,3 +246,21 @@ function lib_mangle_json_hdr0_kill_hdr1()
|
|||||||
kill_bin_hdr $TMPDIR/hdr1
|
kill_bin_hdr $TMPDIR/hdr1
|
||||||
write_luks2_hdr1 $TMPDIR/hdr1 $TGT_IMG
|
write_luks2_hdr1 $TMPDIR/hdr1 $TGT_IMG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lib_hdr0_killed()
|
||||||
|
{
|
||||||
|
local mda_sz=${1:-}
|
||||||
|
|
||||||
|
read_luks2_bin_hdr0 $TGT_IMG $TMPDIR/hdr_res0 $mda_sz
|
||||||
|
local str_res0=$(head -c 6 $TMPDIR/hdr_res0)
|
||||||
|
test "$str_res0" = "VACUUM"
|
||||||
|
}
|
||||||
|
|
||||||
|
function lib_hdr1_killed()
|
||||||
|
{
|
||||||
|
local mda_sz=${1:-}
|
||||||
|
|
||||||
|
read_luks2_bin_hdr1 $TGT_IMG $TMPDIR/hdr_res1 $mda_sz
|
||||||
|
local str_res1=$(head -c 6 $TMPDIR/hdr_res1)
|
||||||
|
test "$str_res1" = "VACUUM"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user