blob: fd7f345a705c7c77291d36fd2477a8b06de7b405 [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
[email protected]2662ed562013-07-03 10:27:4612#include "base/compiler_specific.h"
Avi Drissman13fc8932015-12-20 04:40:4613#include "base/macros.h"
[email protected]2662ed562013-07-03 10:27:4614#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
estark6f9b3d82016-01-12 21:37:0524class CTPolicyEnforcer;
[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 // ProofVerifyDetails implementation
dchengb03027d2014-10-21 12:00:2035 ProofVerifyDetails* Clone() const override;
[email protected]92bc621d2014-07-29 21:42:1336
[email protected]72e65992013-07-30 17:16:1437 CertVerifyResult cert_verify_result;
rtenneti052774e2015-11-24 21:00:1238 ct::CTVerifyResult ct_verify_result;
[email protected]080b77932014-08-04 01:22:4639
40 // pinning_failure_log contains a message produced by
martijnc0d6b622015-06-30 19:14:4041 // TransportSecurityState::PKPState::CheckPublicKeyPins in the event of a
[email protected]080b77932014-08-04 01:22:4642 // pinning failure. It is a (somewhat) human-readable string.
43 std::string pinning_failure_log;
[email protected]72e65992013-07-30 17:16:1444};
45
[email protected]c817c672014-03-21 22:25:3446// ProofVerifyContextChromium is the implementation-specific information that a
47// ProofVerifierChromium needs in order to log correctly.
48struct ProofVerifyContextChromium : public ProofVerifyContext {
49 public:
rtennetia75df622015-06-21 23:59:5050 ProofVerifyContextChromium(int cert_verify_flags, const BoundNetLog& net_log)
51 : cert_verify_flags(cert_verify_flags), net_log(net_log) {}
[email protected]c817c672014-03-21 22:25:3452
rtennetia75df622015-06-21 23:59:5053 int cert_verify_flags;
[email protected]c817c672014-03-21 22:25:3454 BoundNetLog net_log;
55};
56
[email protected]5c78ce62014-03-13 19:48:0157// ProofVerifierChromium implements the QUIC ProofVerifier interface. It is
58// capable of handling multiple simultaneous requests.
[email protected]2662ed562013-07-03 10:27:4659class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
60 public:
[email protected]080b77932014-08-04 01:22:4661 ProofVerifierChromium(CertVerifier* cert_verifier,
estark6f9b3d82016-01-12 21:37:0562 CTPolicyEnforcer* ct_policy_enforcer,
rtenneti052774e2015-11-24 21:00:1263 TransportSecurityState* transport_security_state,
64 CTVerifier* cert_transparency_verifier);
dchengb03027d2014-10-21 12:00:2065 ~ProofVerifierChromium() override;
[email protected]2662ed562013-07-03 10:27:4666
67 // ProofVerifier interface
dchengb03027d2014-10-21 12:00:2068 QuicAsyncStatus VerifyProof(const std::string& hostname,
69 const std::string& server_config,
70 const std::vector<std::string>& certs,
rjshadec86dbfa2015-11-12 20:16:2571 const std::string& cert_sct,
dchengb03027d2014-10-21 12:00:2072 const std::string& signature,
73 const ProofVerifyContext* verify_context,
74 std::string* error_details,
75 scoped_ptr<ProofVerifyDetails>* verify_details,
76 ProofVerifierCallback* callback) override;
[email protected]2662ed562013-07-03 10:27:4677
78 private:
[email protected]5c78ce62014-03-13 19:48:0179 class Job;
[email protected]0cceb922014-07-01 02:00:5680 typedef std::set<Job*> JobSet;
[email protected]2662ed562013-07-03 10:27:4681
[email protected]5c78ce62014-03-13 19:48:0182 void OnJobComplete(Job* job);
[email protected]2662ed562013-07-03 10:27:4683
[email protected]5c78ce62014-03-13 19:48:0184 // Set owning pointers to active jobs.
[email protected]5c78ce62014-03-13 19:48:0185 JobSet active_jobs_;
[email protected]2662ed562013-07-03 10:27:4686
[email protected]5c78ce62014-03-13 19:48:0187 // Underlying verifier used to verify certificates.
[email protected]2662ed562013-07-03 10:27:4688 CertVerifier* const cert_verifier_;
estark6f9b3d82016-01-12 21:37:0589 CTPolicyEnforcer* const ct_policy_enforcer_;
[email protected]2662ed562013-07-03 10:27:4690
[email protected]2bfa5cf2014-08-21 01:24:5191 TransportSecurityState* const transport_security_state_;
rtenneti052774e2015-11-24 21:00:1292 CTVerifier* const cert_transparency_verifier_;
[email protected]080b77932014-08-04 01:22:4693
[email protected]2662ed562013-07-03 10:27:4694 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
95};
96
97} // namespace net
98
99#endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_