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

Unified Diff: net/ssl/ssl_connection_status_flags.h

Issue 291093002: Fail the SPDY transaction if it does not meet TLS base requirements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address forgotten comment. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ssl/ssl_cipher_suite_names_unittest.cc ('k') | net/ssl/ssl_connection_status_flags_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_connection_status_flags.h
diff --git a/net/ssl/ssl_connection_status_flags.h b/net/ssl/ssl_connection_status_flags.h
index 05757558ed8e9b2acdd8c686359e30cbff8201b0..faae306a5055b69c61db1edd7fb80daa982debb3 100644
--- a/net/ssl/ssl_connection_status_flags.h
+++ b/net/ssl/ssl_connection_status_flags.h
@@ -5,6 +5,9 @@
#ifndef NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
#define NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
+#include "base/logging.h"
+#include "base/macros.h"
+
namespace net {
// Status flags for SSLInfo::connection_status.
@@ -60,6 +63,28 @@ inline int SSLConnectionStatusToVersion(int connection_status) {
SSL_CONNECTION_VERSION_MASK;
}
+inline void SSLConnectionStatusSetCipherSuite(int cipher_suite,
+ int* connection_status) {
+ // Clear out the old ciphersuite.
+ *connection_status &=
+ ~(SSL_CONNECTION_CIPHERSUITE_MASK << SSL_CONNECTION_CIPHERSUITE_SHIFT);
+ // Set the new ciphersuite.
+ *connection_status |= ((cipher_suite & SSL_CONNECTION_CIPHERSUITE_MASK)
+ << SSL_CONNECTION_CIPHERSUITE_SHIFT);
+}
+
+inline void SSLConnectionStatusSetVersion(int version, int* connection_status) {
+ DCHECK_GT(version, 0);
+ DCHECK_LT(version, SSL_CONNECTION_VERSION_MAX);
+
+ // Clear out the old version.
+ *connection_status &=
+ ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT);
+ // Set the new version.
+ *connection_status |=
+ ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT);
+}
+
} // namespace net
#endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
« no previous file with comments | « net/ssl/ssl_cipher_suite_names_unittest.cc ('k') | net/ssl/ssl_connection_status_flags_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698