From 85f2219affa4ec2422c90353dc832baaffffa9c2 Mon Sep 17 00:00:00 2001 From: Teodora Sechkova Date: Wed, 16 Jun 2021 16:25:08 +0300 Subject: [PATCH] Document fast-forward attack recovery Document why deleting the timestamp and snapshot files is not needed to recover from a fast-forward attack. Signed-off-by: Teodora Sechkova --- tuf/ngclient/_internal/metadata_bundle.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tuf/ngclient/_internal/metadata_bundle.py b/tuf/ngclient/_internal/metadata_bundle.py index 8eaf739098..ec7322ad05 100644 --- a/tuf/ngclient/_internal/metadata_bundle.py +++ b/tuf/ngclient/_internal/metadata_bundle.py @@ -240,6 +240,11 @@ def root_update_finished(self): if self.root.signed.is_expired(self.reference_time): raise exceptions.ExpiredMetadataError("New root.json is expired") + # No need to recover from fast-forward attack here since + # timestamp and snapshot are not loaded at this point and + # when loaded later will be verified with the new rotated + # keys. + self._root_update_finished = True logger.debug("Verified final root.json")