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

Side by Side Diff: net/quic/test_tools/crypto_test_utils_chromium.cc

Issue 17385010: OpenSSL/NSS implementation of ProofVerfifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added quic_ in front of all QUIC specific .crt file names and added them to net/ssl/certificates Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« net/quic/quic_session.h ('K') | « net/quic/quic_session.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/quic/test_tools/crypto_test_utils.h"
6
7 #include "base/files/file_path.h"
wtc 2013/07/03 00:20:26 Nit: we probably don't need to include this header
ramant (doing other things) 2013/07/03 05:46:34 Done.
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/test_data_directory.h"
11 #include "net/cert/cert_verifier.h"
12 #include "net/cert/test_root_certs.h"
13 #include "net/cert/x509_certificate.h"
14 #include "net/quic/crypto/proof_verifier_chromium.h"
15 #include "net/test/cert_test_util.h"
16
17 namespace net {
18
19 namespace test {
20
21 class TestProofVerifierChromium : public ProofVerifierChromium {
22 public:
23 TestProofVerifierChromium(CertVerifier* cert_verifier,
24 const std::string& cert_file)
25 : ProofVerifierChromium(cert_verifier, BoundNetLog()),
26 cert_verifier_(cert_verifier) {
27 // Load and install the root for the validated chain.
28 scoped_refptr<X509Certificate> root_cert =
29 ImportCertFromFile(GetTestCertsDirectory(), cert_file);
30 scoped_root_.Reset(root_cert.get());
31 }
32 virtual ~TestProofVerifierChromium() { }
33
34 private:
35 ScopedTestRoot scoped_root_;
36 scoped_ptr<CertVerifier> cert_verifier_;
37 };
38
39 // static
40 ProofVerifier* CryptoTestUtils::ProofVerifierForTesting() {
41 TestProofVerifierChromium* proof_verifier = new TestProofVerifierChromium(
42 CertVerifier::CreateDefault(), "quic_proof_verify.crt");
43 return proof_verifier;
44 }
45
46 } // namespace test
47
48 } // namespace net
OLDNEW
« net/quic/quic_session.h ('K') | « net/quic/quic_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698