blob: 830417911e79b568818ef487b794161881c14a68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
#define NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
#include <set>
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/cert/cert_verify_result.h"
#include "net/cert/x509_certificate.h"
#include "net/log/net_log.h"
#include "net/quic/crypto/proof_verifier.h"
namespace net {
class CertVerifier;
class TransportSecurityState;
// ProofVerifyDetailsChromium is the implementation-specific information that a
// ProofVerifierChromium returns about a certificate verification.
class NET_EXPORT_PRIVATE ProofVerifyDetailsChromium
: public ProofVerifyDetails {
public:
// ProofVerifyDetails implementation
ProofVerifyDetails* Clone() const override;
CertVerifyResult cert_verify_result;
// pinning_failure_log contains a message produced by
// TransportSecurityState::DomainState::CheckPublicKeyPins in the event of a
// pinning failure. It is a (somewhat) human-readable string.
std::string pinning_failure_log;
};
// ProofVerifyContextChromium is the implementation-specific information that a
// ProofVerifierChromium needs in order to log correctly.
struct ProofVerifyContextChromium : public ProofVerifyContext {
public:
explicit ProofVerifyContextChromium(const BoundNetLog& net_log)
: net_log(net_log) {}
BoundNetLog net_log;
};
// ProofVerifierChromium implements the QUIC ProofVerifier interface. It is
// capable of handling multiple simultaneous requests.
class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
public:
ProofVerifierChromium(CertVerifier* cert_verifier,
TransportSecurityState* transport_security_state);
~ProofVerifierChromium() override;
// ProofVerifier interface
QuicAsyncStatus VerifyProof(const std::string& hostname,
const std::string& server_config,
const std::vector<std::string>& certs,
const std::string& signature,
const ProofVerifyContext* verify_context,
std::string* error_details,
scoped_ptr<ProofVerifyDetails>* verify_details,
ProofVerifierCallback* callback) override;
private:
class Job;
typedef std::set<Job*> JobSet;
void OnJobComplete(Job* job);
// Set owning pointers to active jobs.
JobSet active_jobs_;
// Underlying verifier used to verify certificates.
CertVerifier* const cert_verifier_;
TransportSecurityState* const transport_security_state_;
DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
};
} // namespace net
#endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
|