OLD | NEW |
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 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 public: | 56 public: |
57 virtual ~ProofVerifier() {} | 57 virtual ~ProofVerifier() {} |
58 | 58 |
59 // VerifyProof checks that |signature| is a valid signature of | 59 // VerifyProof checks that |signature| is a valid signature of |
60 // |server_config| by the public key in the leaf certificate of |certs|, and | 60 // |server_config| by the public key in the leaf certificate of |certs|, and |
61 // that |certs| is a valid chain for |hostname|. On success, it returns | 61 // that |certs| is a valid chain for |hostname|. On success, it returns |
62 // QUIC_SUCCESS. On failure, it returns QUIC_FAILURE and sets |*error_details| | 62 // QUIC_SUCCESS. On failure, it returns QUIC_FAILURE and sets |*error_details| |
63 // to a description of the problem. In either case it may set |*details|, | 63 // to a description of the problem. In either case it may set |*details|, |
64 // which the caller takes ownership of. | 64 // which the caller takes ownership of. |
65 // | 65 // |
66 // |context| specifies an implementation specific struct (which may be NULL | 66 // |context| specifies an implementation specific struct (which may be nullptr |
67 // for some implementations) that provides useful information for the | 67 // for some implementations) that provides useful information for the |
68 // verifier, e.g. logging handles. | 68 // verifier, e.g. logging handles. |
69 // | 69 // |
70 // This function may also return QUIC_PENDING, in which case the ProofVerifier | 70 // This function may also return QUIC_PENDING, in which case the ProofVerifier |
71 // will call back, on the original thread, via |callback| when complete. | 71 // will call back, on the original thread, via |callback| when complete. |
72 // In this case, the ProofVerifier will take ownership of |callback|. | 72 // In this case, the ProofVerifier will take ownership of |callback|. |
73 // | 73 // |
74 // The signature uses SHA-256 as the hash function and PSS padding in the | 74 // The signature uses SHA-256 as the hash function and PSS padding in the |
75 // case of RSA. | 75 // case of RSA. |
76 virtual QuicAsyncStatus VerifyProof(const std::string& hostname, | 76 virtual QuicAsyncStatus VerifyProof(const std::string& hostname, |
77 const std::string& server_config, | 77 const std::string& server_config, |
78 const std::vector<std::string>& certs, | 78 const std::vector<std::string>& certs, |
79 const std::string& signature, | 79 const std::string& signature, |
80 const ProofVerifyContext* context, | 80 const ProofVerifyContext* context, |
81 std::string* error_details, | 81 std::string* error_details, |
82 scoped_ptr<ProofVerifyDetails>* details, | 82 scoped_ptr<ProofVerifyDetails>* details, |
83 ProofVerifierCallback* callback) = 0; | 83 ProofVerifierCallback* callback) = 0; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace net | 86 } // namespace net |
87 | 87 |
88 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ | 88 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_H_ |
OLD | NEW |