| 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_CORE_CRYPTO_PROOF_VERIFIER_H_ | 5 #ifndef NET_QUIC_CORE_CRYPTO_PROOF_VERIFIER_H_ |
| 6 #define NET_QUIC_CORE_CRYPTO_PROOF_VERIFIER_H_ | 6 #define NET_QUIC_CORE_CRYPTO_PROOF_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "net/quic/core/quic_packets.h" | 12 #include "net/quic/core/quic_packets.h" |
| 13 #include "net/quic/core/quic_types.h" | 13 #include "net/quic/core/quic_types.h" |
| 14 #include "net/quic/platform/api/quic_export.h" | 14 #include "net/quic/platform/api/quic_export.h" |
| 15 #include "net/quic/platform/api/quic_string_piece.h" |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 | 18 |
| 18 // ProofVerifyDetails is an abstract class that acts as a container for any | 19 // ProofVerifyDetails is an abstract class that acts as a container for any |
| 19 // implementation specific details that a ProofVerifier wishes to return. These | 20 // implementation specific details that a ProofVerifier wishes to return. These |
| 20 // details are saved in the CachedState for the origin in question. | 21 // details are saved in the CachedState for the origin in question. |
| 21 class QUIC_EXPORT_PRIVATE ProofVerifyDetails { | 22 class QUIC_EXPORT_PRIVATE ProofVerifyDetails { |
| 22 public: | 23 public: |
| 23 virtual ~ProofVerifyDetails() {} | 24 virtual ~ProofVerifyDetails() {} |
| 24 | 25 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // This function may also return QUIC_PENDING, in which case the ProofVerifier | 72 // This function may also return QUIC_PENDING, in which case the ProofVerifier |
| 72 // will call back, on the original thread, via |callback| when complete. | 73 // will call back, on the original thread, via |callback| when complete. |
| 73 // | 74 // |
| 74 // The signature uses SHA-256 as the hash function and PSS padding in the | 75 // The signature uses SHA-256 as the hash function and PSS padding in the |
| 75 // case of RSA. | 76 // case of RSA. |
| 76 virtual QuicAsyncStatus VerifyProof( | 77 virtual QuicAsyncStatus VerifyProof( |
| 77 const std::string& hostname, | 78 const std::string& hostname, |
| 78 const uint16_t port, | 79 const uint16_t port, |
| 79 const std::string& server_config, | 80 const std::string& server_config, |
| 80 QuicVersion quic_version, | 81 QuicVersion quic_version, |
| 81 base::StringPiece chlo_hash, | 82 QuicStringPiece chlo_hash, |
| 82 const std::vector<std::string>& certs, | 83 const std::vector<std::string>& certs, |
| 83 const std::string& cert_sct, | 84 const std::string& cert_sct, |
| 84 const std::string& signature, | 85 const std::string& signature, |
| 85 const ProofVerifyContext* context, | 86 const ProofVerifyContext* context, |
| 86 std::string* error_details, | 87 std::string* error_details, |
| 87 std::unique_ptr<ProofVerifyDetails>* details, | 88 std::unique_ptr<ProofVerifyDetails>* details, |
| 88 std::unique_ptr<ProofVerifierCallback> callback) = 0; | 89 std::unique_ptr<ProofVerifierCallback> callback) = 0; |
| 89 | 90 |
| 90 // VerifyCertChain checks that |certs| is a valid chain for |hostname|. On | 91 // VerifyCertChain checks that |certs| is a valid chain for |hostname|. On |
| 91 // success, it returns QUIC_SUCCESS. On failure, it returns QUIC_FAILURE and | 92 // success, it returns QUIC_SUCCESS. On failure, it returns QUIC_FAILURE and |
| (...skipping 12 matching lines...) Expand all Loading... |
| 104 const std::vector<std::string>& certs, | 105 const std::vector<std::string>& certs, |
| 105 const ProofVerifyContext* context, | 106 const ProofVerifyContext* context, |
| 106 std::string* error_details, | 107 std::string* error_details, |
| 107 std::unique_ptr<ProofVerifyDetails>* details, | 108 std::unique_ptr<ProofVerifyDetails>* details, |
| 108 std::unique_ptr<ProofVerifierCallback> callback) = 0; | 109 std::unique_ptr<ProofVerifierCallback> callback) = 0; |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 } // namespace net | 112 } // namespace net |
| 112 | 113 |
| 113 #endif // NET_QUIC_CORE_CRYPTO_PROOF_VERIFIER_H_ | 114 #endif // NET_QUIC_CORE_CRYPTO_PROOF_VERIFIER_H_ |
| OLD | NEW |