proxygen
TLSDefinitions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <folly/io/Cursor.h>
20 #include <folly/io/IOBuf.h>
21 #include <map>
22 #include <vector>
23 
24 namespace folly {
25 namespace ssl {
26 
27 // http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
28 enum class TLSExtension : uint16_t {
29  SERVER_NAME = 0,
32  TRUSTED_CA_KEYS = 3,
33  TRUNCATED_HMAC = 4,
34  STATUS_REQUEST = 5,
35  USER_MAPPING = 6,
36  CLIENT_AUTHZ = 7,
37  SERVER_AUTHZ = 8,
38  CERT_TYPE = 9,
39  SUPPORTED_GROUPS = 10,
40  EC_POINT_FORMATS = 11,
41  SRP = 12,
43  USE_SRTP = 14,
44  HEARTBEAT = 15,
46  STATUS_REQUEST_V2 = 17,
50  PADDING = 21,
51  ENCRYPT_THEN_MAC = 22,
53  SESSION_TICKET = 35,
54  SUPPORTED_VERSIONS = 43,
55  // Facebook-specific, not IANA assigned yet
56  TLS_CACHED_INFO_FB = 60001,
57  // End Facebook-specific
58  RENEGOTIATION_INFO = 65281
59 };
60 
61 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-18
62 enum class HashAlgorithm : uint8_t {
63  NONE = 0,
64  MD5 = 1,
65  SHA1 = 2,
66  SHA224 = 3,
67  SHA256 = 4,
68  SHA384 = 5,
69  SHA512 = 6
70 };
71 
72 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-16
74  ANONYMOUS = 0,
75  RSA = 1,
76  DSA = 2,
77  ECDSA = 3
78 };
79 
84  std::vector<uint16_t> clientHelloCipherSuites_;
85  std::vector<uint8_t> clientHelloCompressionMethods_;
86  std::vector<TLSExtension> clientHelloExtensions_;
87  std::vector<std::pair<HashAlgorithm, SignatureAlgorithm>> clientHelloSigAlgs_;
88  std::vector<uint16_t> clientHelloSupportedVersions_;
89 };
90 
91 } // namespace ssl
92 } // namespace folly
std::vector< std::pair< HashAlgorithm, SignatureAlgorithm > > clientHelloSigAlgs_
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
std::vector< uint16_t > clientHelloSupportedVersions_
folly::IOBufQueue clientHelloBuf_
std::vector< uint8_t > clientHelloCompressionMethods_
std::vector< TLSExtension > clientHelloExtensions_
std::vector< uint16_t > clientHelloCipherSuites_