| OLD | NEW |
| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 // Status flags for SSLInfo::connection_status. | 15 // Status flags for SSLInfo::connection_status. |
| 16 enum { | 16 enum { |
| 17 // The lower 16 bits are reserved for the TLS ciphersuite id. | 17 // The lower 16 bits are reserved for the TLS ciphersuite id. |
| 18 SSL_CONNECTION_CIPHERSUITE_MASK = 0xffff, | 18 SSL_CONNECTION_CIPHERSUITE_MASK = 0xffff, |
| 19 | 19 |
| 20 // The next two bits are reserved for the compression used. | 20 // The next two bits are reserved for the compression used. |
| 21 SSL_CONNECTION_COMPRESSION_SHIFT = 16, | 21 SSL_CONNECTION_COMPRESSION_SHIFT = 16, |
| 22 SSL_CONNECTION_COMPRESSION_MASK = 3, | 22 SSL_CONNECTION_COMPRESSION_MASK = 3, |
| 23 | 23 |
| 24 // We fell back to an older protocol version for this connection. | 24 // 1 << 18 was previously used for SSL_CONNECTION_VERSION_FALLBACK. |
| 25 SSL_CONNECTION_VERSION_FALLBACK = 1 << 18, | |
| 26 | 25 |
| 27 // The server doesn't support the renegotiation_info extension. If this bit | 26 // The server doesn't support the renegotiation_info extension. If this bit |
| 28 // is not set then either the extension isn't supported, or we don't have any | 27 // is not set then either the extension isn't supported, or we don't have any |
| 29 // knowledge either way. (The latter case will occur when we use an SSL | 28 // knowledge either way. (The latter case will occur when we use an SSL |
| 30 // library that doesn't report it, like SChannel.) | 29 // library that doesn't report it, like SChannel.) |
| 31 SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION = 1 << 19, | 30 SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION = 1 << 19, |
| 32 | 31 |
| 33 // The next three bits are reserved for the SSL version. | 32 // The next three bits are reserved for the SSL version. |
| 34 SSL_CONNECTION_VERSION_SHIFT = 20, | 33 SSL_CONNECTION_VERSION_SHIFT = 20, |
| 35 SSL_CONNECTION_VERSION_MASK = 7, | 34 SSL_CONNECTION_VERSION_MASK = 7, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 *connection_status &= | 79 *connection_status &= |
| 81 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT); | 80 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT); |
| 82 // Set the new version. | 81 // Set the new version. |
| 83 *connection_status |= | 82 *connection_status |= |
| 84 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT); | 83 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT); |
| 85 } | 84 } |
| 86 | 85 |
| 87 } // namespace net | 86 } // namespace net |
| 88 | 87 |
| 89 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ | 88 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ |
| OLD | NEW |