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

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

Issue 17385010: OpenSSL/NSS implementation of ProofVerfifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implemented agl's comments 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
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_VERIFIER_H_ 5 #ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_H_
6 #define NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ 6 #define NET_QUIC_CRYPTO_PROOF_VERIFIER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "net/base/completion_callback.h"
11 #include "net/base/net_export.h" 12 #include "net/base/net_export.h"
12 13
13 namespace net { 14 namespace net {
14 15
15 // A ProofVerifier checks the signature on a server config, and the certificate 16 // A ProofVerifier checks the signature on a server config, and the certificate
16 // chain that backs the public key. 17 // chain that backs the public key.
17 class NET_EXPORT_PRIVATE ProofVerifier { 18 class NET_EXPORT_PRIVATE ProofVerifier {
18 public: 19 public:
19 virtual ~ProofVerifier() {} 20 virtual ~ProofVerifier() {}
20 21
21 // VerifyProof checks that |signature| is a valid signature of 22 // VerifyProof checks that |signature| is a valid signature of
22 // |server_config| by the public key in the leaf certificate of |certs|, and 23 // |server_config| by the public key in the leaf certificate of |certs|, and
23 // that |certs| is a valid chain for |hostname|. On success, it returns true. 24 // that |certs| is a valid chain for |hostname|. On success, it returns OK.
24 // On failure, it returns false and sets |*error_details| to a description of 25 // On failure, it returns ERR_FAILED. This function may also return
25 // the problem. 26 // ERR_IO_PENDING, in which case the |callback| will be run with the final
27 // OK/ERR_FAILED result when the proof is verified.
26 // 28 //
27 // The signature uses SHA-256 as the hash function and PSS padding in the 29 // The signature uses SHA-256 as the hash function and PSS padding in the
28 // case of RSA. 30 // case of RSA.
29 // 31 //
30 // Note: this is just for testing. The CN of the certificate is ignored and 32 // Note: this is just for testing. The CN of the certificate is ignored and
31 // wildcards in the SANs are not supported. 33 // wildcards in the SANs are not supported.
32 virtual bool VerifyProof(const std::string& hostname, 34 virtual int VerifyProof(const std::string& hostname,
33 const std::string& server_config, 35 const std::string& server_config,
34 const std::vector<std::string>& certs, 36 const std::vector<std::string>& certs,
35 const std::string& signature, 37 const std::string& signature,
36 std::string* error_details) const = 0; 38 const CompletionCallback& callback) = 0;
39
40 // If VerifyProof has failed, it returns the description of the problem.
41 virtual std::string error_details() = 0;
agl 2013/07/01 16:23:18 This can't work, right? It's a method of the Proof
wtc 2013/07/02 00:56:38 |error_details| should still be an output argument
ramant (doing other things) 2013/07/02 14:19:50 For |error_details| to be valid until ProofVerifie
Ryan Hamilton 2013/07/02 16:24:50 Or, alternatively, instead of taking a completion
37 }; 42 };
38 43
39 } // namespace net 44 } // namespace net
40 45
41 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ 46 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698