Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1136)

Side by Side Diff: net/ssl/ssl_connection_status_flags.h

Issue 2083743002: Adding TLS 1.3 constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing max version constraints. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/ssl/ssl_config.h ('k') | net/ssl/ssl_server_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ 5 #ifndef NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
6 #define NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ 6 #define NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 30 matching lines...) Expand all
41 // NOTE: the SSL version enum constants must be between 0 and 41 // NOTE: the SSL version enum constants must be between 0 and
42 // SSL_CONNECTION_VERSION_MASK, inclusive. These values are persisted to disk 42 // SSL_CONNECTION_VERSION_MASK, inclusive. These values are persisted to disk
43 // and used in UMA, so they must remain stable. 43 // and used in UMA, so they must remain stable.
44 enum { 44 enum {
45 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version. 45 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version.
46 SSL_CONNECTION_VERSION_SSL2 = 1, 46 SSL_CONNECTION_VERSION_SSL2 = 1,
47 SSL_CONNECTION_VERSION_SSL3 = 2, 47 SSL_CONNECTION_VERSION_SSL3 = 2,
48 SSL_CONNECTION_VERSION_TLS1 = 3, 48 SSL_CONNECTION_VERSION_TLS1 = 3,
49 SSL_CONNECTION_VERSION_TLS1_1 = 4, 49 SSL_CONNECTION_VERSION_TLS1_1 = 4,
50 SSL_CONNECTION_VERSION_TLS1_2 = 5, 50 SSL_CONNECTION_VERSION_TLS1_2 = 5,
51 // Reserve 6 for TLS 1.3. 51 SSL_CONNECTION_VERSION_TLS1_3 = 6,
52 SSL_CONNECTION_VERSION_QUIC = 7, 52 SSL_CONNECTION_VERSION_QUIC = 7,
53 SSL_CONNECTION_VERSION_MAX, 53 SSL_CONNECTION_VERSION_MAX,
54 }; 54 };
55 static_assert(SSL_CONNECTION_VERSION_MAX - 1 <= SSL_CONNECTION_VERSION_MASK, 55 static_assert(SSL_CONNECTION_VERSION_MAX - 1 <= SSL_CONNECTION_VERSION_MASK,
56 "SSL_CONNECTION_VERSION_MASK too small"); 56 "SSL_CONNECTION_VERSION_MASK too small");
57 57
58 inline uint16_t SSLConnectionStatusToCipherSuite(int connection_status) { 58 inline uint16_t SSLConnectionStatusToCipherSuite(int connection_status) {
59 return static_cast<uint16_t>(connection_status); 59 return static_cast<uint16_t>(connection_status);
60 } 60 }
61 61
(...skipping 18 matching lines...) Expand all
80 *connection_status &= 80 *connection_status &=
81 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT); 81 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT);
82 // Set the new version. 82 // Set the new version.
83 *connection_status |= 83 *connection_status |=
84 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT); 84 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT);
85 } 85 }
86 86
87 } // namespace net 87 } // namespace net
88 88
89 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ 89 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
OLDNEW
« no previous file with comments | « net/ssl/ssl_config.h ('k') | net/ssl/ssl_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698