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

Unified Diff: net/cert/x509_certificate.h

Issue 2746103003: Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types. (Closed)
Patch Set: . Created 3 years, 9 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
Index: net/cert/x509_certificate.h
diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h
index 21247d002a4de2890cfbe138d766101c9cc71c56..434ceb120b1dac6f6ef34f88314452b5c0298c24 100644
--- a/net/cert/x509_certificate.h
+++ b/net/cert/x509_certificate.h
@@ -20,7 +20,9 @@
#include "net/cert/cert_type.h"
#include "net/cert/x509_cert_types.h"
-#if defined(OS_WIN)
+#if defined(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 +58,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 defined(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;
@@ -221,7 +227,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.

Powered by Google App Engine
This is Rietveld 408576698