From 5e7921d88fb863f0d095e45243c7492dd5879561 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:35:37 +0000 Subject: [PATCH] docs: updates from Homebrew/brew --- docs/Homebrew/Attestation.html | 66 ++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/docs/Homebrew/Attestation.html b/docs/Homebrew/Attestation.html index 49fad1b4b..b21fc12ec 100644 --- a/docs/Homebrew/Attestation.html +++ b/docs/Homebrew/Attestation.html @@ -464,7 +464,21 @@
# File 'attestation.rb', line 74 @@ -501,8 +515,22 @@# for all attestations that match the input's digest. We want to additionally # filter these down to just the attestation whose subject matches the bottle's name. subject = bottle.filename.to_s if subject.blank? - attestation = attestations.find do |a| - a.dig("verificationResult", "statement", "subject", 0, "name") == subject + + attestation = if bottle.tag.to_sym == :all + # :all-tagged bottles are created by `brew bottle --merge`, and are not directly + # bound to their own filename (since they're created by deduplicating other filenames). + # To verify these, we parse each attestation subject and look for one with a matching + # formula (name, version), but not an exact tag match. + # This is sound insofar as the signature has already been verified. However, + # longer term, we should also directly attest to `:all`-tagged bottles. + attestations.find do |a| + actual_subject = a.dig("verificationResult", "statement", "subject", 0, "name") + actual_subject.start_with? "#{bottle.filename.name}--#{bottle.filename.version}" + end + else + attestations.find do |a| + a.dig("verificationResult", "statement", "subject", 0, "name") == subject + end end raise InvalidAttestationError, "no attestation matches subject" if attestation.blank? @@ -609,20 +637,6 @@
-126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 140 141 142 @@ -655,10 +669,24 @@+172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186169 170 171 -172
# File 'attestation.rb', line 126 +# File 'attestation.rb', line 140 def self.check_core_attestation(bottle) begin