From c35e7c38e87eb64a06dde93bece83dac856d27a4 Mon Sep 17 00:00:00 2001 From: Jeremias Cordoba Date: Thu, 2 Jun 2022 16:42:15 -0700 Subject: [PATCH] Skip check matching director to image-repo targets for secondaries Managed secondaries perform validation on provided metadata. The final check matches director to image-repo targets. This check does not have support for delegated targets which causes failures. Since we make use of delegated targets, skip this check for now. See upstream conversation here: https://github.com/uptane/aktualizr/issues/80 Related-to: TOR-2305 Signed-off-by: Jeremias Cordoba --- src/virtual_secondary/managedsecondary.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/virtual_secondary/managedsecondary.cc b/src/virtual_secondary/managedsecondary.cc index 95cda07d..8af559ea 100644 --- a/src/virtual_secondary/managedsecondary.cc +++ b/src/virtual_secondary/managedsecondary.cc @@ -107,11 +107,15 @@ data::InstallationResult ManagedSecondary::putMetadata(const Uptane::Target &tar } // 10. Verify that Targets metadata from the Director and Image repositories match. + // FIXME: [TORIZON] Skip this check since it does not support delegations which we use. + // See here: https://github.com/uptane/aktualizr/issues/80 + /* if (!director_repo_->matchTargetsWithImageTargets(image_repo_->getTargets())) { detected_attack = "Targets metadata from the Director and Image repositories do not match"; LOG_ERROR << detected_attack; return data::InstallationResult(data::ResultCode::Numeric::kVerificationFailed, detected_attack); } + */ return data::InstallationResult(data::ResultCode::Numeric::kOk, ""); } @@ -183,11 +187,15 @@ data::InstallationResult ManagedSecondary::putMetadataOffUpd(const Uptane::Targe } // 9. Verify that Targets metadata from the Director and Image repositories match. + // FIXME: [TORIZON] Skip this check since it does not support delegations which we use. + // See here: https://github.com/uptane/aktualizr/issues/80 + /* if (!director_repo_->matchTargetsWithImageTargets(image_repo_->getTargets())) { detected_attack = "Targets metadata from the Director and Image repositories do not match"; LOG_ERROR << detected_attack; return data::InstallationResult(data::ResultCode::Numeric::kVerificationFailed, detected_attack); } + */ return data::InstallationResult(data::ResultCode::Numeric::kOk, ""); }