proxygen
fizz::Exporter Class Reference

#include <Exporter.h>

Static Public Member Functions

static Buf getEkm (CipherSuite cipher, folly::ByteRange exporterMaster, folly::StringPiece label, Buf context, uint16_t length)
 

Detailed Description

Definition at line 16 of file Exporter.h.

Member Function Documentation

Buf fizz::Exporter::getEkm ( CipherSuite  cipher,
folly::ByteRange  exporterMaster,
folly::StringPiece  label,
Buf  context,
uint16_t  length 
)
static

Definition at line 13 of file Exporter.cpp.

References folly::IOBuf::create(), folly::Range< Iter >::hash(), fizz::Factory::makeKeyDeriver(), folly::range(), secret, and folly::IOBuf::wrapBuffer().

Referenced by fizz::server::FizzServer< ActionMoveVisitor, SM >::getEarlyEkm(), fizz::client::FizzClient< ActionMoveVisitor, SM >::getEarlyEkm(), and fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >::getEkm().

18  {
19  if (!context) {
21  }
22  auto deriver = Factory().makeKeyDeriver(cipher);
23  std::vector<uint8_t> base(deriver->hashLength());
24  folly::MutableByteRange hashedContext(base.data(), base.size());
25  deriver->hash(*context, hashedContext);
26  auto secret =
27  deriver->deriveSecret(exporterMaster, label, deriver->blankHash());
28  return deriver->expandLabel(
30  "exporter",
31  folly::IOBuf::wrapBuffer(hashedContext),
32  length);
33 }
static std::unique_ptr< IOBuf > create(std::size_t capacity)
Definition: IOBuf.cpp:229
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
Definition: IOBuf.cpp:353
context
Definition: CMakeCache.txt:563
CipherSuite cipher
constexpr Range< Iter > range(Iter first, Iter last)
Definition: Range.h:1114
uint32_t hash() const
Definition: Range.h:662
static constexpr StringPiece secret

The documentation for this class was generated from the following files: