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

Unified Diff: webrtc/base/sslstreamadapter.cc

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
« no previous file with comments | « webrtc/base/sslstreamadapter.h ('k') | webrtc/base/sslstreamadapter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sslstreamadapter.cc
diff --git a/webrtc/base/sslstreamadapter.cc b/webrtc/base/sslstreamadapter.cc
index 42dea9c0362f6910f550a36830e4dade3cecc5f1..8930f2185d8fd2ad5c96b1008aadf6738685198e 100644
--- a/webrtc/base/sslstreamadapter.cc
+++ b/webrtc/base/sslstreamadapter.cc
@@ -29,6 +29,19 @@
namespace rtc {
+// TODO(guoweis): Move this to SDP layer and use int form internally.
+// webrtc:5043.
+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";
+
+uint16_t GetSrtpCryptoSuiteFromName(const std::string& cipher) {
+ if (cipher == CS_AES_CM_128_HMAC_SHA1_32)
+ return SRTP_AES128_CM_SHA1_32;
+ if (cipher == CS_AES_CM_128_HMAC_SHA1_80)
+ return SRTP_AES128_CM_SHA1_80;
+ return 0;
+}
+
SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) {
#if SSL_USE_SCHANNEL
return NULL;
@@ -39,7 +52,7 @@ SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) {
#endif
}
-bool SSLStreamAdapter::GetSslCipher(std::string* cipher) {
+bool SSLStreamAdapter::GetSslCipherSuite(uint16_t* cipher) {
return false;
}
@@ -66,9 +79,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 +94,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::GetSslCipherSuiteName(uint16_t cipher) {
+ return OpenSSLStreamAdapter::GetSslCipherSuiteName(cipher);
}
#endif // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL
« no previous file with comments | « webrtc/base/sslstreamadapter.h ('k') | webrtc/base/sslstreamadapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698