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

Unified Diff: net/test/cert_test_util.cc

Issue 67513008: Certificate Transparency: Add the high-level interface for verifying SCTs over multiple logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed using of released pointer. Created 7 years, 1 month 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
« net/test/cert_test_util.h ('K') | « net/test/cert_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/cert_test_util.cc
diff --git a/net/test/cert_test_util.cc b/net/test/cert_test_util.cc
index 5ec07749d508f5758cce834cbf4fd6d0679550c5..fa4b09d9ca0206ab460abe3121314604c9737763 100644
--- a/net/test/cert_test_util.cc
+++ b/net/test/cert_test_util.cc
@@ -26,6 +26,25 @@ CertificateList CreateCertificateListFromFile(
format);
}
+scoped_refptr<X509Certificate> CreateCertificateChainFromFile(
+ const base::FilePath& certs_dir,
+ const std::string& cert_file,
+ int format) {
+ CertificateList certs = CreateCertificateListFromFile(
wtc 2013/11/21 02:05:02 This is an inefficient way to implement this funct
Eran M. (Google) 2013/11/21 20:06:02 Ack - it is indeed only for testing.
+ certs_dir, cert_file, format);
+ if (certs.empty())
+ return NULL;
+
+ X509Certificate::OSCertHandles intermediates;
+ for (size_t i = 1; i < certs.size(); ++i)
+ intermediates.push_back(certs[i]->os_cert_handle());
+
+ scoped_refptr<X509Certificate> result(X509Certificate::CreateFromHandle(
+ certs[0]->os_cert_handle(), intermediates));
+ return result;
+}
+
+
wtc 2013/11/21 02:05:02 Nit: delete one blank line.
Eran M. (Google) 2013/11/21 20:06:02 Done.
scoped_refptr<X509Certificate> ImportCertFromFile(
const base::FilePath& certs_dir,
const std::string& cert_file) {
« net/test/cert_test_util.h ('K') | « net/test/cert_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698