Skip to content

Commit e55cd21

Browse files
authored
Merge pull request #20300 from Homebrew/codesign-audit-update
cask/audit: refine codesign audits
2 parents 50fa89e + 68be276 commit e55cd21

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Library/Homebrew/cask/audit.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,17 @@ def audit_signing
510510
when Artifact::Pkg
511511
system_command("spctl", args: ["--assess", "--type", "install", path], print_stderr: false)
512512
when Artifact::App
513-
system_command("spctl", args: ["--assess", "--type", "execute", path], print_stderr: false)
513+
if which("syspolicy_check")
514+
system_command("syspolicy_check", args: ["distribution", path], print_stderr: false)
515+
else
516+
system_command("spctl", args: ["--assess", "--type", "execute", path], print_stderr: false)
517+
end
514518
when Artifact::Binary
515519
# Shell scripts cannot be signed, so we skip them
516520
next if path.text_executable?
517521

518-
system_command("codesign", args: ["--verify", path], print_stderr: false)
522+
system_command("codesign", args: ["--verify", "-R=notarized", "--check-notarization", path],
523+
print_stderr: false)
519524
else
520525
add_error "Unknown artifact type: #{artifact.class}", location: url.location
521526
end

0 commit comments

Comments
 (0)