summaryrefslogtreecommitdiffstats
path: root/net/base/ssl_cipher_suite_names.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/ssl_cipher_suite_names.h')
-rw-r--r--net/base/ssl_cipher_suite_names.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/base/ssl_cipher_suite_names.h b/net/base/ssl_cipher_suite_names.h
index deec529..f97b17f 100644
--- a/net/base/ssl_cipher_suite_names.h
+++ b/net/base/ssl_cipher_suite_names.h
@@ -6,6 +6,8 @@
#define NET_BASE_SSL_CIPHER_SUITE_NAMES_H_
#pragma once
+#include <string>
+
#include "base/basictypes.h"
#include "net/base/net_api.h"
@@ -34,6 +36,21 @@ NET_API void SSLCompressionToString(const char** name,
// If the version is unknown, |name| is set to "???".
NET_API void SSLVersionToString(const char** name, int ssl_version);
+// Parses a string literal that represents a SSL/TLS cipher suite.
+//
+// Supported literal forms:
+// 0xAABB, where AA is cipher_suite[0] and BB is cipher_suite[1], as
+// defined in RFC 2246, Section 7.4.1.2. Unrecognized but parsable cipher
+// suites in this form will not return an error.
+//
+// Returns true if the cipher suite was successfully parsed, storing the
+// result in |cipher_suite|.
+//
+// TODO(rsleevi): Support the full strings defined in the IANA TLS parameters
+// list.
+NET_API bool ParseSSLCipherString(const std::string& cipher_string,
+ uint16* cipher_suite);
+
} // namespace net
#endif // NET_BASE_SSL_CIPHER_SUITE_NAMES_H_