Chromium Code Reviews| Index: webrtc/base/sslstreamadapter.cc |
| diff --git a/webrtc/base/sslstreamadapter.cc b/webrtc/base/sslstreamadapter.cc |
| index 42dea9c0362f6910f550a36830e4dade3cecc5f1..c4a6c357bda45cd7cb0fc3fd01bfeebe02f22422 100644 |
| --- a/webrtc/base/sslstreamadapter.cc |
| +++ b/webrtc/base/sslstreamadapter.cc |
| @@ -29,6 +29,17 @@ |
| namespace rtc { |
| +const char CS_AES_CM_128_HMAC_SHA1_80[] = "AES_CM_128_HMAC_SHA1_80"; |
| +const char CS_AES_CM_128_HMAC_SHA1_32[] = "AES_CM_128_HMAC_SHA1_32"; |
|
pthatcher1
2015/09/29 22:25:16
Is this used anywhere that isn't PeerConnection or
guoweis_webrtc
2015/09/30 04:09:47
If I don't misunderstand, I was following Justin's
pthatcher1
2015/09/30 05:46:22
The constant in abstract form (which could be an i
guoweis_webrtc
2015/09/30 17:41:55
This makes sense. I'd like to do this in a separat
|
| + |
| +SrtpCipherType GetSrtpCipherType(const std::string& cipher) { |
| + if (cipher == CS_AES_CM_128_HMAC_SHA1_32) |
| + return SrtpCipher_AES_CM_128_HMAC_SHA1_32; |
| + if (cipher == CS_AES_CM_128_HMAC_SHA1_80) |
| + return SrtpCipher_AES_CM_128_HMAC_SHA1_80; |
| + return SrtpCipher_Unknown; |
| +} |
| + |
| SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { |
| #if SSL_USE_SCHANNEL |
| return NULL; |
| @@ -39,7 +50,7 @@ SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { |
| #endif |
| } |
| -bool SSLStreamAdapter::GetSslCipher(std::string* cipher) { |
| +bool SSLStreamAdapter::GetSslCipher(uint16_t* cipher) { |
| return false; |
| } |
| @@ -66,9 +77,10 @@ bool SSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) { |
| bool SSLStreamAdapter::HaveDtls() { return false; } |
| bool SSLStreamAdapter::HaveDtlsSrtp() { return false; } |
| bool SSLStreamAdapter::HaveExporter() { return false; } |
| -std::string SSLStreamAdapter::GetDefaultSslCipher(SSLProtocolVersion version, |
| - KeyType key_type) { |
| - return std::string(); |
| +uint16_t SSLStreamAdapter::GetDefaultSslCipherForTest( |
| + SSLProtocolVersion version, |
| + KeyType key_type) { |
| + return 0; |
| } |
| #elif SSL_USE_OPENSSL |
| bool SSLStreamAdapter::HaveDtls() { |
| @@ -80,9 +92,14 @@ bool SSLStreamAdapter::HaveDtlsSrtp() { |
| bool SSLStreamAdapter::HaveExporter() { |
| return OpenSSLStreamAdapter::HaveExporter(); |
| } |
| -std::string SSLStreamAdapter::GetDefaultSslCipher(SSLProtocolVersion version, |
| - KeyType key_type) { |
| - return OpenSSLStreamAdapter::GetDefaultSslCipher(version, key_type); |
| +uint16_t SSLStreamAdapter::GetDefaultSslCipherForTest( |
| + SSLProtocolVersion version, |
| + KeyType key_type) { |
| + return OpenSSLStreamAdapter::GetDefaultSslCipherForTest(version, key_type); |
| +} |
| + |
| +std::string SSLStreamAdapter::GetRfcSslCipherName(uint16_t cipher) { |
| + return OpenSSLStreamAdapter::GetRfcSslCipherName(cipher); |
| } |
| #endif // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL |