Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: net/quic/crypto/proof_verifier_chromium.h

Issue 17385010: OpenSSL/NSS implementation of ProofVerfifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled ECDSA test on windows Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // 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
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "net/base/completion_callback.h"
15 #include "net/base/net_export.h"
16 #include "net/base/net_log.h"
17 #include "net/cert/cert_verify_result.h"
18 #include "net/cert/x509_certificate.h"
19 #include "net/quic/crypto/proof_verifier.h"
20
21 namespace net {
22
23 class BoundNetLog;
24 class CertVerifier;
25 class CertVerifyResult;
26 class SingleRequestCertVerifier;
27 class X509Certificate;
28
29 // ProofVerifierChromium implements the QUIC ProofVerifier interface.
30 // TODO(rtenneti): Add support for multiple requests for one ProofVerifier.
31 class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier {
32 public:
33 explicit ProofVerifierChromium(CertVerifier* cert_verifier,
34 const BoundNetLog& net_log);
35 virtual ~ProofVerifierChromium();
36
37 // ProofVerifier interface
38 virtual int VerifyProof(const std::string& hostname,
39 const std::string& server_config,
40 const std::vector<std::string>& certs,
41 const std::string& signature,
42 std::string* error_details,
43 const CompletionCallback& callback) OVERRIDE;
44
45 private:
46 enum State {
47 STATE_NONE,
48 STATE_VERIFY_CERT,
49 STATE_VERIFY_CERT_COMPLETE,
50 };
51
52 int DoLoop(int last_io_result);
53 void OnIOComplete(int result);
54 int DoVerifyCert(int result);
55 int DoVerifyCertComplete(int result);
56
57 bool VerifySignature(const std::string& signed_data,
58 const std::string& signature,
59 const std::string& cert);
60
61 // |cert_verifier_| and |verifier_| are used for verifying certificates.
62 CertVerifier* const cert_verifier_;
63 scoped_ptr<SingleRequestCertVerifier> verifier_;
64
65 // |hostname| specifies the hostname for which |certs| is a valid chain.
66 std::string hostname_;
67
68 CompletionCallback callback_;
69
70 // The result of certificate verification.
71 CertVerifyResult cert_verify_result_;
72 std::string* error_details_;
73
74 // X509Certificate from a chain of DER encoded certificates.
75 scoped_refptr<X509Certificate> cert_;
76
77 // |generation_counter| passed to VerifyProof call.
78 uint64 generation_counter_;
79
80 State next_state_;
81
82 BoundNetLog net_log_;
83
84 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium);
85 };
86
87 } // namespace net
88
89 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698