Skip to content

Commit

Permalink
Bug 1534506 - download chain-of-trust.json instead of chainOfTrust.js…
Browse files Browse the repository at this point in the history
…on.asc r=tomprince

Differential Revision: https://phabricator.services.mozilla.com/D23081

--HG--
extra : moz-landing-system : lando
  • Loading branch information
escapewindow committed Mar 12, 2019
1 parent 50711a4 commit 92cf5ec
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions python/mozbuild/mozbuild/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ class ArtifactRecord(DownloadRecord):
def __init__(self, task_id, artifact_name):
for _ in redo.retrier(attempts=retry+1, sleeptime=60):
cot = cache._download_manager.session.get(
get_artifact_url(task_id, 'public/chainOfTrust.json.asc'))
get_artifact_url(task_id, 'public/chain-of-trust.json'))
if cot.status_code >= 500:
continue
cot.raise_for_status()
Expand All @@ -1398,22 +1398,7 @@ def __init__(self, task_id, artifact_name):
cot.raise_for_status()

digest = algorithm = None
data = {}
# The file is GPG-signed, but we don't care about validating that.
# The data looks like:
# -----BEGIN PGP SIGNED MESSAGE-----
# Hash: SHA256
#
# {
# ...
# }
# -----BEGIN PGP SIGNATURE-----
# <signature data>
# -----END PGP SIGNATURE-----
# The following code extracts the json from there.
data = json.loads(
cot.content.partition("-----BEGIN PGP SIGNATURE-----")[0]
.partition("Hash: SHA256")[2])
data = json.loads(cot.content)
for algorithm, digest in (data.get('artifacts', {})
.get(artifact_name, {}).items()):
pass
Expand Down

0 comments on commit 92cf5ec

Please sign in to comment.