| 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 // 1 << 18 was previously used for SSL_CONNECTION_VERSION_FALLBACK. | 24 // 1 << 18 was previously used for SSL_CONNECTION_VERSION_FALLBACK. |
| 25 | 25 // 1 << 19 was previously used for SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION. |
| 26 // The server doesn't support the renegotiation_info extension. If this bit | |
| 27 // is not set then either the extension isn't supported, or we don't have any | |
| 28 // knowledge either way. (The latter case will occur when we use an SSL | |
| 29 // library that doesn't report it, like SChannel.) | |
| 30 SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION = 1 << 19, | |
| 31 | 26 |
| 32 // The next three bits are reserved for the SSL version. | 27 // The next three bits are reserved for the SSL version. |
| 33 SSL_CONNECTION_VERSION_SHIFT = 20, | 28 SSL_CONNECTION_VERSION_SHIFT = 20, |
| 34 SSL_CONNECTION_VERSION_MASK = 7, | 29 SSL_CONNECTION_VERSION_MASK = 7, |
| 35 | 30 |
| 36 // 1 << 31 (the sign bit) is reserved so that the SSL connection status will | 31 // 1 << 31 (the sign bit) is reserved so that the SSL connection status will |
| 37 // never be negative. | 32 // never be negative. |
| 38 }; | 33 }; |
| 39 | 34 |
| 40 // NOTE: the SSL version enum constants must be between 0 and | 35 // NOTE: the SSL version enum constants must be between 0 and |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 *connection_status &= | 74 *connection_status &= |
| 80 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT); | 75 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT); |
| 81 // Set the new version. | 76 // Set the new version. |
| 82 *connection_status |= | 77 *connection_status |= |
| 83 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT); | 78 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT); |
| 84 } | 79 } |
| 85 | 80 |
| 86 } // namespace net | 81 } // namespace net |
| 87 | 82 |
| 88 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ | 83 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ |
| OLD | NEW |