blob: ca7358a9604ec98208cd1b848d1079cadd1946c0 [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"
[email protected]c817c672014-03-21 22:25:3417#include "net/cert/x509_certificate.h"
eroman87c53d62015-04-02 06:51:0718#include "net/log/net_log.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]080b77932014-08-04 01:22:4624class TransportSecurityState;
[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.
[email protected]92bc621d2014-07-29 21:42:1328class NET_EXPORT_PRIVATE ProofVerifyDetailsChromium
29 : public ProofVerifyDetails {
[email protected]72e65992013-07-30 17:16:1430 public:
[email protected]92bc621d2014-07-29 21:42:1331
32 // ProofVerifyDetails implementation
dchengb03027d2014-10-21 12:00:2033 ProofVerifyDetails* Clone() const override;
[email protected]92bc621d2014-07-29 21:42:1334
[email protected]72e65992013-07-30 17:16:1435 CertVerifyResult cert_verify_result;
[email protected]080b77932014-08-04 01:22:4636
37 // pinning_failure_log contains a message produced by
martijnc0d6b622015-06-30 19:14:4038 // TransportSecurityState::PKPState::CheckPublicKeyPins in the event of a
[email protected]080b77932014-08-04 01:22:4639 // pinning failure. It is a (somewhat) human-readable string.
40 std::string pinning_failure_log;
[email protected]72e65992013-07-30 17:16:1441};
42
[email protected]c817c672014-03-21 22:25:3443// ProofVerifyContextChromium is the implementation-specific information that a
44// ProofVerifierChromium needs in order to log correctly.
45struct ProofVerifyContextChromium : public ProofVerifyContext {
46 public:
rtennetia75df622015-06-21 23:59:5047 ProofVerifyContextChromium(int cert_verify_flags, const BoundNetLog& net_log)
48 : cert_verify_flags(cert_verify_flags), net_log(net_log) {}
[email protected]c817c672014-03-21 22:25:3449
rtennetia75df622015-06-21 23:59:5050 int cert_verify_flags;
[email protected]c817c672014-03-21 22:25:3451 BoundNetLog net_log;
52};
53
[email protected]5c78ce62014-03-13 19:48:0154// ProofVerifierChromium implements the QUIC ProofVerifier interface. It is
55// capable of handling multiple simultaneous requests.
[email protected]2662ed562013-07-03 10:27:4656class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
57 public:
[email protected]080b77932014-08-04 01:22:4658 ProofVerifierChromium(CertVerifier* cert_verifier,
59 TransportSecurityState* transport_security_state);
dchengb03027d2014-10-21 12:00:2060 ~ProofVerifierChromium() override;
[email protected]2662ed562013-07-03 10:27:4661
62 // ProofVerifier interface
dchengb03027d2014-10-21 12:00:2063 QuicAsyncStatus VerifyProof(const std::string& hostname,
64 const std::string& server_config,
65 const std::vector<std::string>& certs,
66 const std::string& signature,
67 const ProofVerifyContext* verify_context,
68 std::string* error_details,
69 scoped_ptr<ProofVerifyDetails>* verify_details,
70 ProofVerifierCallback* callback) override;
[email protected]2662ed562013-07-03 10:27:4671
72 private:
[email protected]5c78ce62014-03-13 19:48:0173 class Job;
[email protected]0cceb922014-07-01 02:00:5674 typedef std::set<Job*> JobSet;
[email protected]2662ed562013-07-03 10:27:4675
[email protected]5c78ce62014-03-13 19:48:0176 void OnJobComplete(Job* job);
[email protected]2662ed562013-07-03 10:27:4677
[email protected]5c78ce62014-03-13 19:48:0178 // Set owning pointers to active jobs.
[email protected]5c78ce62014-03-13 19:48:0179 JobSet active_jobs_;
[email protected]2662ed562013-07-03 10:27:4680
[email protected]5c78ce62014-03-13 19:48:0181 // Underlying verifier used to verify certificates.
[email protected]2662ed562013-07-03 10:27:4682 CertVerifier* const cert_verifier_;
[email protected]2662ed562013-07-03 10:27:4683
[email protected]2bfa5cf2014-08-21 01:24:5184 TransportSecurityState* const transport_security_state_;
[email protected]080b77932014-08-04 01:22:4685
[email protected]2662ed562013-07-03 10:27:4686 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
87};
88
89} // namespace net
90
91#endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_