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

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

Issue 22647002: Add support to QUIC for QUIC_VERSION_8: for RSA-PSS signatures, set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_QUIC_CRYPTO_PROOF_SOURCE_H_ 5 #ifndef NET_QUIC_CRYPTO_PROOF_SOURCE_H_
6 #define NET_QUIC_CRYPTO_PROOF_SOURCE_H_ 6 #define NET_QUIC_CRYPTO_PROOF_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "net/base/net_export.h" 11 #include "net/base/net_export.h"
12 #include "net/quic/quic_protocol.h"
12 13
13 namespace net { 14 namespace net {
14 15
15 // ProofSource is an interface by which a QUIC server can obtain certificate 16 // ProofSource is an interface by which a QUIC server can obtain certificate
16 // chains and signatures that prove its identity. 17 // chains and signatures that prove its identity.
17 class NET_EXPORT_PRIVATE ProofSource { 18 class NET_EXPORT_PRIVATE ProofSource {
18 public: 19 public:
19 virtual ~ProofSource() {} 20 virtual ~ProofSource() {}
20 21
21 // GetProof finds a certificate chain for |hostname|, sets |out_certs| to 22 // GetProof finds a certificate chain for |hostname|, sets |out_certs| to
22 // point to it (in leaf-first order), calculates a signature of 23 // point to it (in leaf-first order), calculates a signature of
23 // |server_config| using that chain and puts the result in |out_signature|. 24 // |server_config| using that chain and puts the result in |out_signature|.
24 // 25 //
25 // The signature uses SHA-256 as the hash function and PSS padding when the 26 // The signature uses SHA-256 as the hash function and PSS padding when the
26 // key is RSA. 27 // key is RSA.
27 // 28 //
28 // The signature uses SHA-256 as the hash function when the key is ECDSA. 29 // The signature uses SHA-256 as the hash function when the key is ECDSA.
29 // 30 //
31 // |version| is the QUIC version for the connection. TODO(wtc): Remove once
32 // QUIC_VERSION_7 and before are removed.
33 //
30 // |out_certs| is a pointer to a pointer, not a pointer to an array. 34 // |out_certs| is a pointer to a pointer, not a pointer to an array.
31 // 35 //
32 // The number of certificate chains is expected to be small and fixed thus 36 // The number of certificate chains is expected to be small and fixed thus
33 // the ProofSource retains ownership of the contents of |out_certs|. The 37 // the ProofSource retains ownership of the contents of |out_certs|. The
34 // expectation is that they will be cached forever. 38 // expectation is that they will be cached forever.
35 // 39 //
36 // The signature values should be cached because |server_config| will be 40 // The signature values should be cached because |server_config| will be
37 // somewhat static. However, since they aren't bounded, the ProofSource may 41 // somewhat static. However, since they aren't bounded, the ProofSource may
38 // wish to evicit entries from that cache, thus the caller takes ownership of 42 // wish to evicit entries from that cache, thus the caller takes ownership of
39 // |*out_signature|. 43 // |*out_signature|.
40 // 44 //
41 // |hostname| may be empty to signify that a default certificate should be 45 // |hostname| may be empty to signify that a default certificate should be
42 // used. 46 // used.
43 // 47 //
44 // This function may be called concurrently. 48 // This function may be called concurrently.
45 virtual bool GetProof(const std::string& hostname, 49 virtual bool GetProof(QuicVersion version,
50 const std::string& hostname,
46 const std::string& server_config, 51 const std::string& server_config,
47 bool ecdsa_ok, 52 bool ecdsa_ok,
48 const std::vector<std::string>** out_certs, 53 const std::vector<std::string>** out_certs,
49 std::string* out_signature) = 0; 54 std::string* out_signature) = 0;
50 }; 55 };
51 56
52 } // namespace net 57 } // namespace net
53 58
54 #endif // NET_QUIC_CRYPTO_PROOF_SOURCE_H_ 59 #endif // NET_QUIC_CRYPTO_PROOF_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698