eBPF-based security platform
bpm: drop expected_payload_sha256 from tree operations
Daniel Borkmann1c287a306d1f
diff --git a/Documentation/reference/failure-categories.rst b/Documentation/reference/failure-categories.rstindex 63a82815..80dfbf95 100644--- a/Documentation/reference/failure-categories.rst+++ b/Documentation/reference/failure-categories.rst@@ -558,8 +558,6 @@ rc=<rc> (<strerror>)`` and exits 1:config cannot be read. The cursor stays on the operation.* - ``operation_digest_parse``- The operation digest is malformed.- * - ``expected_payload_digest``- - The artifact's payload differs from the expected payload.* - ``pending_write``- ``pending.json`` cannot be written.* - ``artifact_fetch_or_verify``diff --git a/Documentation/reference/formats/bpm-formats.rst b/Documentation/reference/formats/bpm-formats.rstindex 876855cf..927ca764 100644--- a/Documentation/reference/formats/bpm-formats.rst+++ b/Documentation/reference/formats/bpm-formats.rst@@ -414,10 +414,6 @@ Operation- Digest of the ``.upatch`` layer.* - ``artifact.payload_sha256``- ``sha256:`` and the artifact's header ``payload_sha256``.- * - ``expected_payload_sha256``- - Optional. When present, must equal ``artifact.payload_sha256``.- ``bpm tree append`` does not write it, and ``operation_digest`` does- not cover it.* - ``operation_digest``- ``sha256:`` and the SHA-256 of the canonical operation, see`Operation digest`_.diff --git a/builtin-bpm.c b/builtin-bpm.cindex 0e8cb944..71499d4c 100644--- a/builtin-bpm.c+++ b/builtin-bpm.c@@ -2138,9 +2138,6 @@ static int tree_validate_operation(const struct tree_operation *op)return -EINVAL;if (strcmp(op->operation_digest, expected_digest))return -EKEYREJECTED;- if (op->expected_payload_sha256[0] &&- tree_digest_hex(op->expected_payload_sha256, digest))- return -EINVAL;return 0;}@@ -2338,13 +2335,6 @@ static int cmd_bpm_tree_sync(int argc, const char **argv)ret = -EINVAL;goto out;}- if (op->expected_payload_sha256[0] &&- strcmp(op->expected_payload_sha256, op->artifact.payload_sha256)) {- tree_sync_report_error("expected_payload_digest", op,- -EKEYREJECTED);- ret = -EKEYREJECTED;- goto out;- }ret = tree_write_pending(op);if (ret) {tree_sync_report_error("pending_write", op, ret);diff --git a/util/bpm_tree.c b/util/bpm_tree.cindex 4811023a..f3862dac 100644--- a/util/bpm_tree.c+++ b/util/bpm_tree.c@@ -365,10 +365,6 @@ static int tp_operation(struct tree_parser *p, struct tree_operation *o)} else if (!strcmp(key, "artifact")) {if (tp_artifact(p, &o->artifact))return -EINVAL;- } else if (!strcmp(key, "expected_payload_sha256")) {- if (tp_string(p, o->expected_payload_sha256,- sizeof(o->expected_payload_sha256)))- return -EINVAL;} else if (!strcmp(key, "operation_digest")) {if (tp_string(p, o->operation_digest,sizeof(o->operation_digest)))diff --git a/util/bpm_tree.h b/util/bpm_tree.hindex c9e3abf6..54eb1598 100644--- a/util/bpm_tree.h+++ b/util/bpm_tree.h@@ -55,7 +55,6 @@ struct tree_operation {char id[TREE_STRING_MAX];struct tree_selector selector;struct tree_artifact artifact;- char expected_payload_sha256[128];char operation_digest[128];};