proxygen
HandshakeContextTest.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #include <gtest/gtest.h>
10 
12 
13 using namespace folly;
14 using namespace testing;
15 
16 namespace fizz {
17 namespace test {
18 
19 // TODO: test vectors
21 
22 TEST_F(HandshakeContextTest, TestHandshakeContextSingle) {
24  context.appendToTranscript(folly::IOBuf::copyBuffer("ClientHello"));
25  context.getHandshakeContext();
26 }
27 
28 TEST_F(HandshakeContextTest, TestHandshakeContextMultiple) {
30  context.appendToTranscript(folly::IOBuf::copyBuffer("ClientHello"));
31  context.appendToTranscript(folly::IOBuf::copyBuffer("ServerHello"));
32  context.getHandshakeContext();
33 }
34 
35 TEST_F(HandshakeContextTest, TestFinished) {
37  context.appendToTranscript(folly::IOBuf::copyBuffer("ClientHello"));
38  std::vector<uint8_t> baseKey(Sha256::HashLen);
39  context.getFinishedData(range(baseKey));
40 }
41 
44  context.getHandshakeContext();
45  std::array<uint8_t, Sha256::HashLen> key{4};
46  context.getFinishedData(folly::range(key));
47 }
48 } // namespace test
49 } // namespace fizz
std::string str() const
Definition: Range.h:591
context
Definition: CMakeCache.txt:563
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
constexpr Range< Iter > range(Iter first, Iter last)
Definition: Range.h:1114
Definition: Actions.h:16
TEST_F(AsyncSSLSocketWriteTest, write_coalescing1)
constexpr folly::StringPiece kHkdfLabelPrefix
Definition: Types.h:20
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587