proxygen
HandshakeContext.h
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 #pragma once
10 
11 #include <fizz/record/Types.h>
12 #include <folly/ssl/OpenSSLHash.h>
13 
14 namespace fizz {
15 
21  public:
22  virtual ~HandshakeContext() = default;
23 
27  virtual void appendToTranscript(const Buf& transcript) = 0;
28 
32  virtual Buf getHandshakeContext() const = 0;
33 
38  virtual Buf getFinishedData(folly::ByteRange baseKey) const = 0;
39 
43  virtual folly::ByteRange getBlankContext() const = 0;
44 };
45 
46 template <typename Hash>
48  public:
49  HandshakeContextImpl(const std::string& hkdfLabelPrefix);
50 
51  void appendToTranscript(const Buf& data) override;
52 
53  Buf getHandshakeContext() const override;
54 
55  Buf getFinishedData(folly::ByteRange baseKey) const override;
56 
57  folly::ByteRange getBlankContext() const override {
58  return Hash::BlankHash;
59  }
60 
61  private:
64 };
65 } // namespace fizz
66 
virtual ~HandshakeContext()=default
virtual void appendToTranscript(const Buf &transcript)=0
virtual Buf getFinishedData(folly::ByteRange baseKey) const =0
virtual folly::ByteRange getBlankContext() const =0
virtual Buf getHandshakeContext() const =0
Definition: Actions.h:16
const char * string
Definition: Conv.cpp:212
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22
folly::ssl::OpenSSLHash::Digest hashState_
folly::ByteRange getBlankContext() const override
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43