| Bence Béky | bac0405 | 2022-04-07 15:44:29 -0400 | [diff] [blame] | 1 | // Copyright (c) 2019 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 QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_ |
| 6 | #define QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | |
| 10 | #include "quiche_platform_impl/quiche_default_proof_providers_impl.h" |
| 11 | #include "quiche/quic/core/crypto/proof_source.h" |
| 12 | #include "quiche/quic/core/crypto/proof_verifier.h" |
| 13 | |
| 14 | namespace quiche { |
| 15 | |
| 16 | // Provides a default proof verifier that can verify a cert chain for |host|. |
| 17 | // The verifier has to do a good faith attempt at verifying the certificate |
| 18 | // against a reasonable root store, and not just always return success. |
| 19 | inline std::unique_ptr<quic::ProofVerifier> CreateDefaultProofVerifier( |
| 20 | const std::string& host) { |
| 21 | return CreateDefaultProofVerifierImpl(host); |
| 22 | } |
| 23 | |
| 24 | // Provides a default proof source for CLI-based tools. The actual certificates |
| 25 | // used in the proof source should be confifgurable via command-line flags. |
| 26 | inline std::unique_ptr<quic::ProofSource> CreateDefaultProofSource() { |
| 27 | return CreateDefaultProofSourceImpl(); |
| 28 | } |
| 29 | |
| 30 | } // namespace quiche |
| 31 | |
| 32 | #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_DEFAULT_PROOF_PROVIDERS_H_ |