proxygen
Parse-inl.h
Go to the documentation of this file.
1 #include <fizz/record/Types.h>
2 #include <map>
3 
4 namespace fizz {
5 template <>
7  static const std::map<folly::StringPiece, CipherSuite> stringToCiphers = {
8  {"TLS_AES_128_GCM_SHA256", CipherSuite::TLS_AES_128_GCM_SHA256},
9  {"TLS_AES_256_GCM_SHA384", CipherSuite::TLS_AES_256_GCM_SHA384},
10  {"TLS_CHACHA20_POLY1305_SHA256",
12  {"TLS_AES_128_OCB_SHA256_EXPERIMENTAL",
14 
15  auto location = stringToCiphers.find(s);
16  if (location != stringToCiphers.end()) {
17  return location->second;
18  }
19 
20  throw std::runtime_error(folly::to<std::string>("Unknown cipher suite: ", s));
21 }
22 
23 template <>
25  static const std::map<folly::StringPiece, NamedGroup> stringToGroups = {
26  {"secp256r1", NamedGroup::secp256r1}, {"x25519", NamedGroup::x25519}};
27 
28  auto location = stringToGroups.find(s);
29  if (location != stringToGroups.end()) {
30  return location->second;
31  }
32 
33  throw std::runtime_error(folly::to<std::string>("Unknown named group: ", s));
34 }
35 } // namespace fizz
NamedGroup
Definition: Types.h:302
CipherSuite
Definition: Types.h:153
static Param parse(Buf handshakeMsg, Buf original)
Definition: RecordLayer.cpp:68
Definition: Actions.h:16
static set< string > s