blob: 215bc3d2845885366827240a12aff7a2725f63c8 [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"
[email protected]2662ed562013-07-03 10:27:4616#include "net/cert/cert_verify_result.h"
rtenneti052774e2015-11-24 21:00:1217#include "net/cert/ct_verify_result.h"
[email protected]c817c672014-03-21 22:25:3418#include "net/cert/x509_certificate.h"
eroman87c53d62015-04-02 06:51:0719#include "net/log/net_log.h"
[email protected]2662ed562013-07-03 10:27:4620#include "net/quic/crypto/proof_verifier.h"
21
22namespace net {
23
rsleevi9541f8632015-07-31 00:07:0024class CertPolicyEnforcer;
[email protected]2662ed562013-07-03 10:27:4625class CertVerifier;
rtenneti052774e2015-11-24 21:00:1226class CTVerifier;
[email protected]080b77932014-08-04 01:22:4627class TransportSecurityState;
[email protected]2662ed562013-07-03 10:27:4628
[email protected]72e65992013-07-30 17:16:1429// ProofVerifyDetailsChromium is the implementation-specific information that a
30// ProofVerifierChromium returns about a certificate verification.
[email protected]92bc621d2014-07-29 21:42:1331class NET_EXPORT_PRIVATE ProofVerifyDetailsChromium
32 : public ProofVerifyDetails {
[email protected]72e65992013-07-30 17:16:1433 public:
[email protected]92bc621d2014-07-29 21:42:1334
35 // ProofVerifyDetails implementation
dchengb03027d2014-10-21 12:00:2036 ProofVerifyDetails* Clone() const override;
[email protected]92bc621d2014-07-29 21:42:1337
[email protected]72e65992013-07-30 17:16:1438 CertVerifyResult cert_verify_result;
rtenneti052774e2015-11-24 21:00:1239 ct::CTVerifyResult ct_verify_result;
[email protected]080b77932014-08-04 01:22:4640
41 // pinning_failure_log contains a message produced by
martijnc0d6b622015-06-30 19:14:4042 // TransportSecurityState::PKPState::CheckPublicKeyPins in the event of a
[email protected]080b77932014-08-04 01:22:4643 // pinning failure. It is a (somewhat) human-readable string.
44 std::string pinning_failure_log;
[email protected]72e65992013-07-30 17:16:1445};
46
[email protected]c817c672014-03-21 22:25:3447// ProofVerifyContextChromium is the implementation-specific information that a
48// ProofVerifierChromium needs in order to log correctly.
49struct ProofVerifyContextChromium : public ProofVerifyContext {
50 public:
rtennetia75df622015-06-21 23:59:5051 ProofVerifyContextChromium(int cert_verify_flags, const BoundNetLog& net_log)
52 : cert_verify_flags(cert_verify_flags), net_log(net_log) {}
[email protected]c817c672014-03-21 22:25:3453
rtennetia75df622015-06-21 23:59:5054 int cert_verify_flags;
[email protected]c817c672014-03-21 22:25:3455 BoundNetLog net_log;
56};
57
[email protected]5c78ce62014-03-13 19:48:0158// ProofVerifierChromium implements the QUIC ProofVerifier interface. It is
59// capable of handling multiple simultaneous requests.
[email protected]2662ed562013-07-03 10:27:4660class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
61 public:
[email protected]080b77932014-08-04 01:22:4662 ProofVerifierChromium(CertVerifier* cert_verifier,
rsleevi9541f8632015-07-31 00:07:0063 CertPolicyEnforcer* cert_policy_enforcer,
rtenneti052774e2015-11-24 21:00:1264 TransportSecurityState* transport_security_state,
65 CTVerifier* cert_transparency_verifier);
dchengb03027d2014-10-21 12:00:2066 ~ProofVerifierChromium() override;
[email protected]2662ed562013-07-03 10:27:4667
68 // ProofVerifier interface
dchengb03027d2014-10-21 12:00:2069 QuicAsyncStatus VerifyProof(const std::string& hostname,
70 const std::string& server_config,
71 const std::vector<std::string>& certs,
rjshadec86dbfa2015-11-12 20:16:2572 const std::string& cert_sct,
dchengb03027d2014-10-21 12:00:2073 const std::string& signature,
74 const ProofVerifyContext* verify_context,
75 std::string* error_details,
76 scoped_ptr<ProofVerifyDetails>* verify_details,
77 ProofVerifierCallback* callback) override;
[email protected]2662ed562013-07-03 10:27:4678
79 private:
[email protected]5c78ce62014-03-13 19:48:0180 class Job;
[email protected]0cceb922014-07-01 02:00:5681 typedef std::set<Job*> JobSet;
[email protected]2662ed562013-07-03 10:27:4682
[email protected]5c78ce62014-03-13 19:48:0183 void OnJobComplete(Job* job);
[email protected]2662ed562013-07-03 10:27:4684
[email protected]5c78ce62014-03-13 19:48:0185 // Set owning pointers to active jobs.
[email protected]5c78ce62014-03-13 19:48:0186 JobSet active_jobs_;
[email protected]2662ed562013-07-03 10:27:4687
[email protected]5c78ce62014-03-13 19:48:0188 // Underlying verifier used to verify certificates.
[email protected]2662ed562013-07-03 10:27:4689 CertVerifier* const cert_verifier_;
rsleevi9541f8632015-07-31 00:07:0090 CertPolicyEnforcer* const cert_policy_enforcer_;
[email protected]2662ed562013-07-03 10:27:4691
[email protected]2bfa5cf2014-08-21 01:24:5192 TransportSecurityState* const transport_security_state_;
rtenneti052774e2015-11-24 21:00:1293 CTVerifier* const cert_transparency_verifier_;
[email protected]080b77932014-08-04 01:22:4694
[email protected]2662ed562013-07-03 10:27:4695 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
96};
97
98} // namespace net
99
100#endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_