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

[match][sigh][cert] Added checking hash of installed wwdr certificates #20507

Merged
merged 2 commits into from
Aug 3, 2022
Merged
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions fastlane_core/lib/fastlane_core/cert_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ def self.list_available_developer_id_installer(in_keychain: nil)

def self.wwdr_certificate_installed?
certificate_name = "Apple Worldwide Developer Relations Certification Authority"
certificate_hash = "SHA-256 hash: BDD4ED6E74691F0C2BFD01BE0296197AF1379E0418E2D300EFA9C3BEF642CA30"
keychain = wwdr_keychain
response = Helper.backticks("security find-certificate -a -c '#{certificate_name}' #{keychain.shellescape}", print: FastlaneCore::Globals.verbose?)
certs = response.split("keychain: \"#{keychain}\"").drop(1)
certs.count >= 1
response = Helper.backticks("security find-certificate -a -c '#{certificate_name}' -Z #{keychain.shellescape} | grep ^SHA-256", print: FastlaneCore::Globals.verbose?)
certs = response.split("\n")
certs.include?(certificate_hash)
end

def self.install_wwdr_certificate
Expand Down