proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
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
9
#include <
fizz/server/AeadTokenCipher.h
>
10
#include <
fizz/server/CookieCipher.h
>
11
#include <
fizz/server/FizzServerContext.h
>
12
13
namespace
fizz
{
14
namespace
server {
15
16
struct
AppToken
{
17
Buf
token
;
18
};
19
20
struct
StatelessHelloRetryRequest
{
21
Buf
data
;
22
};
23
24
template
<
typename
AeadType,
typename
HkdfType>
25
class
AeadCookieCipher
:
public
CookieCipher
{
26
public
:
27
AeadCookieCipher
()
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
41
void
setContext
(
const
FizzServerContext
*
context
) {
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
58
AeadTokenCipher<AeadType, HkdfType>
tokenCipher_
;
59
60
const
FizzServerContext
* context_ =
nullptr
;
61
};
62
}
// namespace server
63
}
// namespace fizz
64
65
#include <
fizz/server/AeadCookieCipher-inl.h
>
fizz::server::StatelessHelloRetryRequest::data
Buf data
Definition:
AeadCookieCipher.h:21
fizz::server::AppToken
Definition:
AeadCookieCipher.h:16
chlo
static const std::string chlo
Definition:
HandshakeTypesTest.cpp:23
fizz::server::AeadCookieCipher::setCookieSecrets
bool setCookieSecrets(const std::vector< folly::ByteRange > &cookieSecrets)
Definition:
AeadCookieCipher.h:33
fizz::server::AeadCookieCipher::AeadCookieCipher
AeadCookieCipher()
Definition:
AeadCookieCipher.h:27
cookie
StringPiece cookie
Definition:
ExtensionsTest.cpp:28
fizz::server::AeadTokenCipher
Definition:
AeadTokenCipher.h:22
context
context
Definition:
CMakeCache.txt:563
fizz::server::AeadCookieCipher::setContext
void setContext(const FizzServerContext *context)
Definition:
AeadCookieCipher.h:41
std
STL namespace.
fizz::server::AeadCookieCipher::tokenCipher_
AeadTokenCipher< AeadType, HkdfType > tokenCipher_
Definition:
AeadCookieCipher.h:58
fizz::server::AppToken::token
Buf token
Definition:
AeadCookieCipher.h:17
folly::Optional
Definition:
Optional.h:71
fizz::server::FizzServerContext
Definition:
FizzServerContext.h:45
fizz
Definition:
Actions.h:16
fizz::ClientHello
Definition:
Types.h:186
vector
Definition:
Traits.h:588
fizz::server::CookieCipher
Definition:
CookieCipher.h:32
AeadCookieCipher-inl.h
string
const char * string
Definition:
Conv.cpp:212
fizz::Buf
std::unique_ptr< folly::IOBuf > Buf
Definition:
Types.h:22
AeadTokenCipher.h
CookieCipher.h
FizzServerContext.h
fizz::server::AeadCookieCipher
Definition:
AeadCookieCipher.h:25
fizz::server::StatelessHelloRetryRequest
Definition:
AeadCookieCipher.h:20
proxygen
fizz
fizz
server
AeadCookieCipher.h
Generated by
1.8.11