diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 677af6e38c..b9465c276f 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -581,7 +581,13 @@ module Cask next unless path.exist? result = system_command("codesign", args: ["--verify", path], print_stderr: false) - add_warning result.merged_output unless result.success? + + next if result.success? + + # Only fail if signature is wrong, not when no signature is present at all. + next result.stderr.include?("not signed at all") + + add_warning "Signature verification failed: #{result.merged_output}" end end end