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

Unified Diff: net/cert/x509_util_openssl.cc

Issue 2694903006: Restore SSL_SESSION/X509Certificate X509* sharing (Closed)
Patch Set: xunjieli comments Created 3 years, 10 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 | « no previous file | net/socket/ssl_client_socket_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_util_openssl.cc
diff --git a/net/cert/x509_util_openssl.cc b/net/cert/x509_util_openssl.cc
index 4e79ad8a2115cad3b04d4e9048ad8efe7e094be1..32c421f7203b6daab95381389fcdeac6d94630bc 100644
--- a/net/cert/x509_util_openssl.cc
+++ b/net/cert/x509_util_openssl.cc
@@ -285,9 +285,16 @@ bool ParseDate(ASN1_TIME* x509_time, base::Time* time) {
}
// Returns true if |der_cache| points to valid data, false otherwise.
-// (note: the DER-encoded data in |der_cache| is owned by |cert|, callers should
+// (note: the DER-encoded data in |der_cache| is owned by |x509|, callers should
// not free it).
bool GetDER(X509* x509, base::StringPiece* der_cache) {
+ if (x509->buf) {
+ *der_cache = base::StringPiece(
+ reinterpret_cast<const char*>(CRYPTO_BUFFER_data(x509->buf)),
+ CRYPTO_BUFFER_len(x509->buf));
+ return true;
+ }
+
int x509_der_cache_index =
g_der_cache_singleton.Get().der_cache_ex_index();
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698