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

Unified Diff: net/cert/x509_certificate.h

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/cert/test_root_certs_mac.cc ('k') | net/cert/x509_certificate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate.h
diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h
index b3fff1f95a329f949b8a462e45fb050faf387563..0cb93b5adb71a3344a05689fa298dba48255bc83 100644
--- a/net/cert/x509_certificate.h
+++ b/net/cert/x509_certificate.h
@@ -19,8 +19,11 @@
#include "net/base/net_export.h"
#include "net/cert/cert_type.h"
#include "net/cert/x509_cert_types.h"
+#include "net/net_features.h"
-#if defined(OS_WIN)
+#if BUILDFLAG(USE_BYTE_CERTS)
+#include "third_party/boringssl/src/include/openssl/base.h"
+#elif defined(OS_WIN)
#include <windows.h>
#include "crypto/wincrypt_shim.h"
#elif defined(OS_MACOSX)
@@ -56,7 +59,11 @@ class NET_EXPORT X509Certificate
// An OSCertHandle is a handle to a certificate object in the underlying
// crypto library. We assume that OSCertHandle is a pointer type on all
// platforms and that NULL represents an invalid OSCertHandle.
-#if defined(OS_WIN)
+#if BUILDFLAG(USE_BYTE_CERTS)
+ // TODO(mattm): Remove OSCertHandle type and clean up the interfaces once all
+ // platforms use the CRYPTO_BUFFER version.
+ typedef CRYPTO_BUFFER* OSCertHandle;
+#elif defined(OS_WIN)
typedef PCCERT_CONTEXT OSCertHandle;
#elif defined(OS_MACOSX)
typedef SecCertificateRef OSCertHandle;
@@ -224,7 +231,7 @@ class NET_EXPORT X509Certificate
return intermediate_ca_certs_;
}
-#if defined(OS_MACOSX)
+#if defined(OS_IOS)
// Returns a new CFMutableArrayRef containing this certificate and its
// intermediate certificates in the form expected by Security.framework
// and Keychain Services, or NULL on failure.
« no previous file with comments | « net/cert/test_root_certs_mac.cc ('k') | net/cert/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698