Fix veritysetup exit code for bad root hash with FEC enabled.

If FEC was enabled, the error for bad root hash was replaced
by error correction (datga were ok, only root hash was wrong).

Do not run recovery test if root hash is incorrect.
This commit is contained in:
Milan Broz
2021-02-13 18:51:14 +01:00
parent 12cc7ea745
commit 0dfeb304cc
2 changed files with 27 additions and 1 deletions

View File

@@ -373,7 +373,7 @@ out:
log_err(cd, _("Verification of data area failed."));
else {
log_dbg(cd, "Verification of data area succeeded.");
r = memcmp(root_hash, calculated_digest, digest_size) ? -EPERM : 0;
r = memcmp(root_hash, calculated_digest, digest_size) ? -EINVAL : 0;
if (r)
log_err(cd, _("Verification of root hash failed."));
else