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

Unified Diff: webrtc/base/sslstreamadapter.h

Issue 1337673002: Change WebRTC SslCipher to be exposed as number only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 3 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
Index: webrtc/base/sslstreamadapter.h
diff --git a/webrtc/base/sslstreamadapter.h b/webrtc/base/sslstreamadapter.h
index 4fb238a290482d13d00569bc57ccc5cdc45389f8..44dbd8ca2e2ba5c88a993e9a224eb08e2e6b19a7 100644
--- a/webrtc/base/sslstreamadapter.h
+++ b/webrtc/base/sslstreamadapter.h
@@ -47,6 +47,14 @@ enum SSLProtocolVersion {
// Errors for Read -- in the high range so no conflict with OpenSSL.
enum { SSE_MSG_TRUNC = 0xff0001 };
+// Helper struct to retrieve both IANA number and the RFC name.
+struct SslCipher {
+ int ssl_id;
+ std::string name;
+ SslCipher() : ssl_id(0) {}
+ SslCipher(int ssl_id, const std::string& name) : ssl_id(ssl_id), name(name) {}
+};
+
class SSLStreamAdapter : public StreamAdapterInterface {
public:
// Instantiate an SSLStreamAdapter wrapping the given stream,
@@ -135,7 +143,7 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// Retrieves the name of the cipher suite used for the connection
// (e.g. "TLS_RSA_WITH_AES_128_CBC_SHA").
- virtual bool GetSslCipher(std::string* cipher);
+ virtual bool GetSslCipher(SslCipher* cipher);
// Key Exporter interface from RFC 5705
// Arguments are:
@@ -168,8 +176,9 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// Returns the default Ssl cipher used between streams of this class
// for the given protocol version. This is used by the unit tests.
// TODO(torbjorng@webrtc.org): Fix callers to avoid default parameter.
- static std::string GetDefaultSslCipher(SSLProtocolVersion version,
- KeyType key_type = KT_DEFAULT);
+ static const SslCipher& GetDefaultSslCipherForTest(
+ SSLProtocolVersion version,
+ KeyType key_type = KT_DEFAULT);
Ryan Sleevi 2015/09/24 21:09:58 http://google-styleguide.googlecode.com/svn/trunk/
guoweis_webrtc 2015/09/25 18:30:32 Done.
private:
// If true, the server certificate need not match the configured

Powered by Google App Engine
This is Rietveld 408576698