proxygen
AeadCookieCipher.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 
12 
13 namespace fizz {
14 namespace server {
15 
16 struct AppToken {
18 };
19 
22 };
23 
24 template <typename AeadType, typename HkdfType>
26  public:
28  : tokenCipher_(std::vector<std::string>({"Fizz Cookie Cipher v1"})) {}
29 
33  bool setCookieSecrets(const std::vector<folly::ByteRange>& cookieSecrets) {
34  return tokenCipher_.setSecrets(cookieSecrets);
35  }
36 
42  context_ = context;
43  }
44 
49  boost::variant<AppToken, StatelessHelloRetryRequest> getTokenOrRetry(
50  Buf clientHello,
51  Buf appToken) const;
52 
53  folly::Optional<CookieState> decrypt(Buf cookie) const override;
54 
55  private:
56  Buf getStatelessResponse(const ClientHello& chlo, Buf appToken) const;
57 
59 
60  const FizzServerContext* context_ = nullptr;
61 };
62 } // namespace server
63 } // namespace fizz
64 
static const std::string chlo
bool setCookieSecrets(const std::vector< folly::ByteRange > &cookieSecrets)
StringPiece cookie
context
Definition: CMakeCache.txt:563
void setContext(const FizzServerContext *context)
STL namespace.
AeadTokenCipher< AeadType, HkdfType > tokenCipher_
Definition: Actions.h:16
Definition: Traits.h:588
const char * string
Definition: Conv.cpp:212
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22