do not immediately verify latest root when rotating

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>
This commit is contained in:
Trishank K Kuppusamy 2019-06-04 14:53:51 -04:00
parent 65e5ee118b
commit 92ae4eb8a6
No known key found for this signature in database
GPG key ID: 5C090ED7318B6C1E

View file

@ -1125,9 +1125,11 @@ def _update_root_metadata(self, current_root_metadata):
None.
"""
# Retrieve the latest, remote root.json.
latest_root_metadata_file = self._get_metadata_file(
'root', 'root.json', DEFAULT_ROOT_UPPERLENGTH, None)
# Retrieve the latest, remote root.json *WITHOUT* verifying it just yet.
# We will verify it soon if all goes well.
latest_root_metadata_file = self._get_file(
'root.json', lambda f: f, 'meta', DEFAULT_ROOT_UPPERLENGTH,
download_safely=False)
latest_root_metadata = securesystemslib.util.load_json_string(
latest_root_metadata_file.read().decode('utf-8'))