From 49fbb52b018e27c75ce7839dd49bba91fbc54b42 Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Sat, 17 Jun 2017 00:06:50 +0300 Subject: [PATCH] Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types. https://codereview.chromium.org/2746103003 --- atom/browser/ui/certificate_trust_mac.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/certificate_trust_mac.mm b/atom/browser/ui/certificate_trust_mac.mm index be6e6963f46..eacc8303999 100644 --- a/atom/browser/ui/certificate_trust_mac.mm +++ b/atom/browser/ui/certificate_trust_mac.mm @@ -10,6 +10,7 @@ #include "atom/browser/native_window.h" #include "base/strings/sys_string_conversions.h" #include "net/cert/cert_database.h" +#include "net/cert/x509_util_mac.h" @interface TrustDelegate : NSObject { @private @@ -85,7 +86,8 @@ void ShowCertificateTrust(atom::NativeWindow* parent_window, const std::string& message, const ShowTrustCallback& callback) { auto sec_policy = SecPolicyCreateBasicX509(); - auto cert_chain = cert->CreateOSCertChainForCert(); + auto cert_chain = + net::x509_util::CreateSecCertificateArrayForX509Certificate(cert.get()); SecTrustRef trust = nullptr; SecTrustCreateWithCertificates(cert_chain, sec_policy, &trust);