Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cask/audit: update signing checks for app, binary, and pkg #17031

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion Library/Homebrew/cask/audit.rb
Expand Up @@ -488,7 +488,17 @@

next unless path.exist?

result = system_command("spctl", args: ["--assess", "--type", "install", path], print_stderr: false)
result = case artifact

Check warning on line 491 in Library/Homebrew/cask/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cask/audit.rb#L491

Added line #L491 was not covered by tests
when Artifact::Pkg
system_command("spctl", args: ["--assess", "--type", "install", path], print_stderr: false)
when Artifact::App
system_command("spctl", args: ["--assess", "--type", "execute", path], print_stderr: false)
when Artifact::Binary
system_command("codesign", args: ["-vvvv", "-R=notarized", "--check-notarization", path],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think checking for notarisation should be a separate (strict) check. My understanding is it's not required for ARM/Gatekeeper/Quarantine.

The message below can also probably remove "notarize" from it, too.

print_stderr: false)
else
add_error "Unknown artifact type: #{artifact.class}", location: cask.url.location
end

next if result.success?

Expand Down