OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ |
| 6 #define NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "net/base/net_export.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 // A ProofVerifier checks the signature on a server config, and the certificate |
| 16 // chain that backs the public key. |
| 17 class NET_EXPORT_PRIVATE ProofVerifier { |
| 18 public: |
| 19 virtual ~ProofVerifier() {} |
| 20 |
| 21 // VerifyProof checks that |signature| is a valid signature of |
| 22 // |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 // On failure, it returns false and sets |*error_details| to a description of |
| 25 // the problem. |
| 26 // |
| 27 // The signature uses SHA-256 as the hash function and PSS padding in the |
| 28 // case of RSA. |
| 29 // |
| 30 // Note: this is just for testing. The CN of the certificate is ignored and |
| 31 // wildcards in the SANs are not supported. |
| 32 virtual bool VerifyProof(const std::string& hostname, |
| 33 const std::string& server_config, |
| 34 const std::vector<std::string>& certs, |
| 35 const std::string& signature, |
| 36 std::string* error_details) const = 0; |
| 37 }; |
| 38 |
| 39 } // namespace net |
| 40 |
| 41 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ |
OLD | NEW |