Index: webrtc/base/sslstreamadapter.cc |
diff --git a/webrtc/base/sslstreamadapter.cc b/webrtc/base/sslstreamadapter.cc |
index b9ba9d3f2a1dcb2e3f0b1fa3b7dd00a0b3b1c12c..a2cff3e44874678de052e0636c4d695c221094c3 100644 |
--- a/webrtc/base/sslstreamadapter.cc |
+++ b/webrtc/base/sslstreamadapter.cc |
@@ -30,12 +30,20 @@ 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"; |
-int GetSrtpCryptoSuiteFromName(const std::string& cipher) { |
- if (cipher == CS_AES_CM_128_HMAC_SHA1_32) |
+std::string SrtpCryptoSuiteToName(int crypto_suite) { |
+ if (crypto_suite == SRTP_AES128_CM_SHA1_32) |
+ return CS_AES_CM_128_HMAC_SHA1_32; |
+ if (crypto_suite == SRTP_AES128_CM_SHA1_80) |
+ return CS_AES_CM_128_HMAC_SHA1_80; |
+ return std::string(); |
+} |
+ |
+int SrtpCryptoSuiteFromName(const std::string& crypto_suite) { |
+ if (crypto_suite == CS_AES_CM_128_HMAC_SHA1_32) |
return SRTP_AES128_CM_SHA1_32; |
- if (cipher == CS_AES_CM_128_HMAC_SHA1_80) |
+ if (crypto_suite == CS_AES_CM_128_HMAC_SHA1_80) |
return SRTP_AES128_CM_SHA1_80; |
- return 0; |
+ return SRTP_INVALID_CRYPTO_SUITE; |
} |
SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { |
@@ -46,7 +54,7 @@ SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { |
#endif // SSL_USE_OPENSSL |
} |
-bool SSLStreamAdapter::GetSslCipherSuite(int* cipher) { |
+bool SSLStreamAdapter::GetSslCipherSuite(int* cipher_suite) { |
return false; |
} |
@@ -59,12 +67,12 @@ bool SSLStreamAdapter::ExportKeyingMaterial(const std::string& label, |
return false; // Default is unsupported |
} |
-bool SSLStreamAdapter::SetDtlsSrtpCiphers( |
- const std::vector<std::string>& ciphers) { |
+bool SSLStreamAdapter::SetDtlsSrtpCryptoSuites( |
+ const std::vector<int>& crypto_suites) { |
return false; |
} |
-bool SSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) { |
+bool SSLStreamAdapter::GetDtlsSrtpCryptoSuite(int* crypto_suite) { |
return false; |
} |
@@ -83,8 +91,8 @@ int SSLStreamAdapter::GetDefaultSslCipherForTest(SSLProtocolVersion version, |
return OpenSSLStreamAdapter::GetDefaultSslCipherForTest(version, key_type); |
} |
-std::string SSLStreamAdapter::GetSslCipherSuiteName(int cipher) { |
- return OpenSSLStreamAdapter::GetSslCipherSuiteName(cipher); |
+std::string SSLStreamAdapter::SslCipherSuiteToName(int cipher_suite) { |
+ return OpenSSLStreamAdapter::SslCipherSuiteToName(cipher_suite); |
} |
#endif // SSL_USE_OPENSSL |