Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2326)

Unified Diff: net/ssl/ssl_platform_key_mac_unittest.cc

Issue 2746103003: Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ssl/ssl_platform_key_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_platform_key_mac_unittest.cc
diff --git a/net/ssl/ssl_platform_key_mac_unittest.cc b/net/ssl/ssl_platform_key_mac_unittest.cc
index 9207dedb086f914c6ac99ad7f74d511d8165e4c0..e35af63b99ccfa3f33027fc320e02976b74849f2 100644
--- a/net/ssl/ssl_platform_key_mac_unittest.cc
+++ b/net/ssl/ssl_platform_key_mac_unittest.cc
@@ -16,6 +16,7 @@
#include "base/files/scoped_temp_dir.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/ref_counted.h"
+#include "net/cert/x509_util_mac.h"
#include "net/ssl/ssl_private_key.h"
#include "net/ssl/ssl_private_key_test_util.h"
#include "net/test/cert_test_util.h"
@@ -76,8 +77,10 @@ TEST_P(SSLPlatformKeyMacTest, KeyMatches) {
nullptr, keychain.InitializeInto()));
// Insert the certificate into the keychain.
- ASSERT_EQ(noErr,
- SecCertificateAddToKeychain(cert->os_cert_handle(), keychain));
+ base::ScopedCFTypeRef<SecCertificateRef> sec_cert(
+ x509_util::CreateSecCertificateFromX509Certificate(cert.get()));
+ ASSERT_TRUE(sec_cert);
+ ASSERT_EQ(noErr, SecCertificateAddToKeychain(sec_cert, keychain));
// Import the key into the keychain. Apple doesn't accept unencrypted PKCS#8,
// but it accepts the low-level RSAPrivateKey and ECPrivateKey types as
« no previous file with comments | « net/ssl/ssl_platform_key_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698