// Copyright 2013 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/core/crypto/channel_id.h" #include <memory> #include <string> #include "absl/strings/string_view.h" #include "quiche/quic/platform/api/quic_test.h" #include "quiche/quic/test_tools/crypto_test_utils.h" namespace quic { namespace test { namespace { // The following ECDSA signature verification test vectors for P-256,SHA-256 // come from the SigVer.rsp file in // http://csrc.nist.gov/groups/STM/cavp/documents/dss/186-3ecdsatestvectors.zip // downloaded on 2013-06-11. struct TestVector { … }; const TestVector test_vector[] = …; // Returns true if |ch| is a lowercase hexadecimal digit. bool IsHexDigit(char ch) { … } // Converts a lowercase hexadecimal digit to its integer value. int HexDigitToInt(char ch) { … } // |in| is a string consisting of lowercase hexadecimal digits, where // every two digits represent one byte. |out| is a buffer of size |max_len|. // Converts |in| to bytes and stores the bytes in the |out| buffer. The // number of bytes converted is returned in |*out_len|. Returns true on // success, false on failure. bool DecodeHexString(const char* in, char* out, size_t* out_len, size_t max_len) { … } } // namespace class ChannelIDTest : public QuicTest { … }; // A known answer test for ChannelIDVerifier. TEST_F(ChannelIDTest, VerifyKnownAnswerTest) { … } } // namespace test } // namespace quic