Chromium Code Reviews| Index: webrtc/base/sslstreamadapter.h |
| diff --git a/webrtc/base/sslstreamadapter.h b/webrtc/base/sslstreamadapter.h |
| index 4fb238a290482d13d00569bc57ccc5cdc45389f8..a1d285fe881c82bdd1df9a05ec3b0e23f81297e1 100644 |
| --- a/webrtc/base/sslstreamadapter.h |
| +++ b/webrtc/base/sslstreamadapter.h |
| @@ -47,6 +47,15 @@ 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 { |
| + uint16_t ssl_id; |
|
juberti
2015/09/24 13:41:15
prefer plain |int| to a sized type.
guoweis_webrtc
2015/09/24 18:27:13
Done.
|
| + std::string rfc_name; |
|
juberti
2015/09/24 13:41:15
I would just call this |name|
guoweis_webrtc
2015/09/24 18:27:13
Done.
|
| + SslCipher() : ssl_id(0) {} |
| + SslCipher(uint16_t ssl_id, const std::string& rfc_name) |
| + : ssl_id(ssl_id), rfc_name(rfc_name) {} |
| +}; |
| + |
| class SSLStreamAdapter : public StreamAdapterInterface { |
| public: |
| // Instantiate an SSLStreamAdapter wrapping the given stream, |
| @@ -135,7 +144,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 +177,8 @@ 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& GetDefaultSslCipher(SSLProtocolVersion version, |
| + KeyType key_type = KT_DEFAULT); |
| private: |
| // If true, the server certificate need not match the configured |