chromium/net/third_party/quiche/src/quiche/quic/test_tools/test_ticket_crypter.cc

// Copyright (c) 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "quiche/quic/test_tools/test_ticket_crypter.h"

#include <cstring>
#include <memory>
#include <utility>
#include <vector>

#include "absl/base/macros.h"
#include "quiche/quic/core/crypto/quic_random.h"

namespace quic {
namespace test {

namespace {

// A TicketCrypter implementation is supposed to encrypt and decrypt session
// tickets. However, the only requirement that is needed of a test
// implementation is that calling Decrypt(Encrypt(input), callback) results in
// callback being called with input. (The output of Encrypt must also not exceed
// the overhead specified by MaxOverhead.) This test implementation encrypts
// tickets by prepending kTicketPrefix to generate the ciphertext. The decrypt
// function checks that the prefix is present and strips it; otherwise it
// returns an empty vector to signal failure.
constexpr char kTicketPrefix[] =;

}  // namespace

TestTicketCrypter::TestTicketCrypter()
    :{}

size_t TestTicketCrypter::MaxOverhead() {}

std::vector<uint8_t> TestTicketCrypter::Encrypt(
    absl::string_view in, absl::string_view /* encryption_key */) {}

std::vector<uint8_t> TestTicketCrypter::Decrypt(absl::string_view in) {}

void TestTicketCrypter::Decrypt(
    absl::string_view in,
    std::shared_ptr<ProofSource::DecryptCallback> callback) {}

void TestTicketCrypter::SetRunCallbacksAsync(bool run_async) {}

size_t TestTicketCrypter::NumPendingCallbacks() {}

void TestTicketCrypter::RunPendingCallback(size_t n) {}

}  // namespace test
}  // namespace quic