blob: ebf9a2c41c4c2fc6ad6a132a413dacb51ef44256 [file] [log] [blame]
[email protected]2662ed562013-07-03 10:27:461// 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#ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
6#define NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
7
[email protected]5c78ce62014-03-13 19:48:018#include <set>
[email protected]2662ed562013-07-03 10:27:469#include <string>
10#include <vector>
11
12#include "base/basictypes.h"
13#include "base/compiler_specific.h"
14#include "base/memory/scoped_ptr.h"
[email protected]2662ed562013-07-03 10:27:4615#include "net/base/net_export.h"
16#include "net/base/net_log.h"
17#include "net/cert/cert_verify_result.h"
[email protected]c817c672014-03-21 22:25:3418#include "net/cert/x509_certificate.h"
[email protected]2662ed562013-07-03 10:27:4619#include "net/quic/crypto/proof_verifier.h"
20
21namespace net {
22
[email protected]2662ed562013-07-03 10:27:4623class CertVerifier;
[email protected]2662ed562013-07-03 10:27:4624class SingleRequestCertVerifier;
[email protected]2662ed562013-07-03 10:27:4625
[email protected]72e65992013-07-30 17:16:1426// ProofVerifyDetailsChromium is the implementation-specific information that a
27// ProofVerifierChromium returns about a certificate verification.
28struct ProofVerifyDetailsChromium : public ProofVerifyDetails {
29 public:
30 CertVerifyResult cert_verify_result;
31};
32
[email protected]c817c672014-03-21 22:25:3433// ProofVerifyContextChromium is the implementation-specific information that a
34// ProofVerifierChromium needs in order to log correctly.
35struct ProofVerifyContextChromium : public ProofVerifyContext {
36 public:
37 explicit ProofVerifyContextChromium(const BoundNetLog& net_log)
38 : net_log(net_log) {}
39
40 BoundNetLog net_log;
41};
42
[email protected]5c78ce62014-03-13 19:48:0143// ProofVerifierChromium implements the QUIC ProofVerifier interface. It is
44// capable of handling multiple simultaneous requests.
[email protected]2662ed562013-07-03 10:27:4645class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
46 public:
[email protected]c817c672014-03-21 22:25:3447 explicit ProofVerifierChromium(CertVerifier* cert_verifier);
[email protected]2662ed562013-07-03 10:27:4648 virtual ~ProofVerifierChromium();
49
50 // ProofVerifier interface
[email protected]d5c9e4ba2013-09-14 05:25:5851 virtual Status VerifyProof(const std::string& hostname,
[email protected]72e65992013-07-30 17:16:1452 const std::string& server_config,
53 const std::vector<std::string>& certs,
54 const std::string& signature,
[email protected]c817c672014-03-21 22:25:3455 const ProofVerifyContext* verify_context,
[email protected]72e65992013-07-30 17:16:1456 std::string* error_details,
[email protected]c817c672014-03-21 22:25:3457 scoped_ptr<ProofVerifyDetails>* verify_details,
[email protected]72e65992013-07-30 17:16:1458 ProofVerifierCallback* callback) OVERRIDE;
[email protected]2662ed562013-07-03 10:27:4659
60 private:
[email protected]5c78ce62014-03-13 19:48:0161 class Job;
[email protected]2662ed562013-07-03 10:27:4662
[email protected]5c78ce62014-03-13 19:48:0163 void OnJobComplete(Job* job);
[email protected]2662ed562013-07-03 10:27:4664
[email protected]5c78ce62014-03-13 19:48:0165 // Set owning pointers to active jobs.
66 typedef std::set<Job*> JobSet;
67 JobSet active_jobs_;
[email protected]2662ed562013-07-03 10:27:4668
[email protected]5c78ce62014-03-13 19:48:0169 // Underlying verifier used to verify certificates.
[email protected]2662ed562013-07-03 10:27:4670 CertVerifier* const cert_verifier_;
[email protected]2662ed562013-07-03 10:27:4671
[email protected]2662ed562013-07-03 10:27:4672 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
73};
74
75} // namespace net
76
77#endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_