summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-07-05 19:31:34 +0100
committerKristian Monsen <kristianm@google.com>2011-07-08 17:55:05 +0100
commit80b02f653a8dd9e96eaa219647537e15a87d9330 (patch)
tree48a86c8295b16bf4487bdd576821efac20222d91
parentf90e3b770dd989e0cfbe7c69498cbd21c3bbe7ec (diff)
downloadexternal_chromium-80b02f653a8dd9e96eaa219647537e15a87d9330.zip
external_chromium-80b02f653a8dd9e96eaa219647537e15a87d9330.tar.gz
external_chromium-80b02f653a8dd9e96eaa219647537e15a87d9330.tar.bz2
Merge Chromium at r12.0.742.93: Fix conflicts in x509_certificate*
Changes close to local edits, moved functions to bottom of section. Several upstream CL's: http://codereview.chromium.org/4645001 http://codereview.chromium.org/6793041 Change-Id: I173e5bb2abadfd1f4ca5edbaedd3a564a648ca86
-rw-r--r--net/base/x509_certificate.h20
-rw-r--r--net/base/x509_certificate_openssl.cc54
2 files changed, 35 insertions, 39 deletions
diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h
index d81b1de..62c847f 100644
--- a/net/base/x509_certificate.h
+++ b/net/base/x509_certificate.h
@@ -393,16 +393,6 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
static bool VerifyHostname(const std::string& hostname,
const std::vector<std::string>& cert_names);
-<<<<<<< HEAD
-#ifdef ANDROID
-#if defined(USE_OPENSSL)
- // Returns the certificate in DER-encoded form, using the application DER
- // cache as appropriate. The returned string piece will be valid as long
- // as the handle is.
- static std::string GetDEREncodedBytes(OSCertHandle handle);
-#endif
-#endif
-=======
// The serial number, DER encoded.
// NOTE: keep this method private, used by IsBlacklisted only. To simplify
// IsBlacklisted, we strip the leading 0 byte of a serial number, used to
@@ -430,7 +420,15 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> {
// Writes a single certificate to |pickle|. Returns false on failure.
static bool WriteCertHandleToPickle(OSCertHandle handle, Pickle* pickle);
->>>>>>> chromium.org at r12.0.742.93
+
+#ifdef ANDROID
+#if defined(USE_OPENSSL)
+ // Returns the certificate in DER-encoded form, using the application DER
+ // cache as appropriate. The returned string piece will be valid as long
+ // as the handle is.
+ static std::string GetDEREncodedBytes(OSCertHandle handle);
+#endif
+#endif
// The subject of the certificate.
CertPrincipal subject_;
diff --git a/net/base/x509_certificate_openssl.cc b/net/base/x509_certificate_openssl.cc
index 57c7c3b..18d021f 100644
--- a/net/base/x509_certificate_openssl.cc
+++ b/net/base/x509_certificate_openssl.cc
@@ -516,16 +516,40 @@ bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
}
// static
-<<<<<<< HEAD
+X509Certificate::OSCertHandle
+X509Certificate::ReadCertHandleFromPickle(const Pickle& pickle,
+ void** pickle_iter) {
+ const char* data;
+ int length;
+ if (!pickle.ReadData(pickle_iter, &data, &length))
+ return NULL;
+
+ return CreateOSCertHandleFromBytes(data, length);
+}
+
+// static
+bool X509Certificate::WriteCertHandleToPickle(OSCertHandle cert_handle,
+ Pickle* pickle) {
+ DERCache der_cache;
+ if (!GetDERAndCacheIfNeeded(cert_handle, &der_cache))
+ return false;
+
+ return pickle->WriteData(
+ reinterpret_cast<const char*>(der_cache.data),
+ der_cache.data_length);
+}
+
+#if defined(ANDROID)
+// static
std::string X509Certificate::GetDEREncodedBytes(OSCertHandle handle) {
DERCache der_cache = {0};
GetDERAndCacheIfNeeded(handle, &der_cache);
return std::string(reinterpret_cast<const char*>(der_cache.data),
der_cache.data_length);
}
+#endif
#if defined(ANDROID)
-
void X509Certificate::GetChainDEREncodedBytes(
std::vector<std::string>* chain_bytes) const {
OSCertHandles cert_handles(intermediate_ca_certs_);
@@ -544,32 +568,6 @@ void X509Certificate::GetChainDEREncodedBytes(
chain_bytes->push_back(cert_bytes);
}
}
-
#endif
-=======
-X509Certificate::OSCertHandle
-X509Certificate::ReadCertHandleFromPickle(const Pickle& pickle,
- void** pickle_iter) {
- const char* data;
- int length;
- if (!pickle.ReadData(pickle_iter, &data, &length))
- return NULL;
-
- return CreateOSCertHandleFromBytes(data, length);
-}
-
-// static
-bool X509Certificate::WriteCertHandleToPickle(OSCertHandle cert_handle,
- Pickle* pickle) {
- DERCache der_cache;
- if (!GetDERAndCacheIfNeeded(cert_handle, &der_cache))
- return false;
-
- return pickle->WriteData(
- reinterpret_cast<const char*>(der_cache.data),
- der_cache.data_length);
-}
-
->>>>>>> chromium.org at r12.0.742.93
} // namespace net