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

Side by Side Diff: webrtc/base/sslstreamadapter.cc

Issue 1377733004: Convert uint16_t to int for WebRTC cipher/crypto suite (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 /////////////////////////////////////////////////////////////////////////////// 28 ///////////////////////////////////////////////////////////////////////////////
29 29
30 namespace rtc { 30 namespace rtc {
31 31
32 // TODO(guoweis): Move this to SDP layer and use int form internally. 32 // TODO(guoweis): Move this to SDP layer and use int form internally.
33 // webrtc:5043. 33 // webrtc:5043.
34 const char CS_AES_CM_128_HMAC_SHA1_80[] = "AES_CM_128_HMAC_SHA1_80"; 34 const char CS_AES_CM_128_HMAC_SHA1_80[] = "AES_CM_128_HMAC_SHA1_80";
35 const char CS_AES_CM_128_HMAC_SHA1_32[] = "AES_CM_128_HMAC_SHA1_32"; 35 const char CS_AES_CM_128_HMAC_SHA1_32[] = "AES_CM_128_HMAC_SHA1_32";
36 36
37 uint16_t GetSrtpCryptoSuiteFromName(const std::string& cipher) { 37 int GetSrtpCryptoSuiteFromName(const std::string& cipher) {
38 if (cipher == CS_AES_CM_128_HMAC_SHA1_32) 38 if (cipher == CS_AES_CM_128_HMAC_SHA1_32)
39 return SRTP_AES128_CM_SHA1_32; 39 return SRTP_AES128_CM_SHA1_32;
40 if (cipher == CS_AES_CM_128_HMAC_SHA1_80) 40 if (cipher == CS_AES_CM_128_HMAC_SHA1_80)
41 return SRTP_AES128_CM_SHA1_80; 41 return SRTP_AES128_CM_SHA1_80;
42 return 0; 42 return 0;
43 } 43 }
44 44
45 SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { 45 SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) {
46 #if SSL_USE_SCHANNEL 46 #if SSL_USE_SCHANNEL
47 return NULL; 47 return NULL;
48 #elif SSL_USE_OPENSSL // !SSL_USE_SCHANNEL 48 #elif SSL_USE_OPENSSL // !SSL_USE_SCHANNEL
49 return new OpenSSLStreamAdapter(stream); 49 return new OpenSSLStreamAdapter(stream);
50 #else // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL 50 #else // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL
51 return NULL; 51 return NULL;
52 #endif 52 #endif
53 } 53 }
54 54
55 bool SSLStreamAdapter::GetSslCipherSuite(uint16_t* cipher) { 55 bool SSLStreamAdapter::GetSslCipherSuite(int* cipher) {
56 return false; 56 return false;
57 } 57 }
58 58
59 bool SSLStreamAdapter::ExportKeyingMaterial(const std::string& label, 59 bool SSLStreamAdapter::ExportKeyingMaterial(const std::string& label,
60 const uint8* context, 60 const uint8* context,
61 size_t context_len, 61 size_t context_len,
62 bool use_context, 62 bool use_context,
63 uint8* result, 63 uint8* result,
64 size_t result_len) { 64 size_t result_len) {
65 return false; // Default is unsupported 65 return false; // Default is unsupported
66 } 66 }
67 67
68 bool SSLStreamAdapter::SetDtlsSrtpCiphers( 68 bool SSLStreamAdapter::SetDtlsSrtpCiphers(
69 const std::vector<std::string>& ciphers) { 69 const std::vector<std::string>& ciphers) {
70 return false; 70 return false;
71 } 71 }
72 72
73 bool SSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) { 73 bool SSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) {
74 return false; 74 return false;
75 } 75 }
76 76
77 // Note: this matches the logic above with SCHANNEL dominating 77 // Note: this matches the logic above with SCHANNEL dominating
78 #if SSL_USE_SCHANNEL 78 #if SSL_USE_SCHANNEL
79 bool SSLStreamAdapter::HaveDtls() { return false; } 79 bool SSLStreamAdapter::HaveDtls() { return false; }
80 bool SSLStreamAdapter::HaveDtlsSrtp() { return false; } 80 bool SSLStreamAdapter::HaveDtlsSrtp() { return false; }
81 bool SSLStreamAdapter::HaveExporter() { return false; } 81 bool SSLStreamAdapter::HaveExporter() { return false; }
82 uint16_t SSLStreamAdapter::GetDefaultSslCipherForTest( 82 int SSLStreamAdapter::GetDefaultSslCipherForTest(SSLProtocolVersion version,
83 SSLProtocolVersion version, 83 KeyType key_type) {
84 KeyType key_type) {
85 return 0; 84 return 0;
86 } 85 }
87 #elif SSL_USE_OPENSSL 86 #elif SSL_USE_OPENSSL
88 bool SSLStreamAdapter::HaveDtls() { 87 bool SSLStreamAdapter::HaveDtls() {
89 return OpenSSLStreamAdapter::HaveDtls(); 88 return OpenSSLStreamAdapter::HaveDtls();
90 } 89 }
91 bool SSLStreamAdapter::HaveDtlsSrtp() { 90 bool SSLStreamAdapter::HaveDtlsSrtp() {
92 return OpenSSLStreamAdapter::HaveDtlsSrtp(); 91 return OpenSSLStreamAdapter::HaveDtlsSrtp();
93 } 92 }
94 bool SSLStreamAdapter::HaveExporter() { 93 bool SSLStreamAdapter::HaveExporter() {
95 return OpenSSLStreamAdapter::HaveExporter(); 94 return OpenSSLStreamAdapter::HaveExporter();
96 } 95 }
97 uint16_t SSLStreamAdapter::GetDefaultSslCipherForTest( 96 int SSLStreamAdapter::GetDefaultSslCipherForTest(SSLProtocolVersion version,
98 SSLProtocolVersion version, 97 KeyType key_type) {
99 KeyType key_type) {
100 return OpenSSLStreamAdapter::GetDefaultSslCipherForTest(version, key_type); 98 return OpenSSLStreamAdapter::GetDefaultSslCipherForTest(version, key_type);
101 } 99 }
102 100
103 std::string SSLStreamAdapter::GetSslCipherSuiteName(uint16_t cipher) { 101 std::string SSLStreamAdapter::GetSslCipherSuiteName(int cipher) {
104 return OpenSSLStreamAdapter::GetSslCipherSuiteName(cipher); 102 return OpenSSLStreamAdapter::GetSslCipherSuiteName(cipher);
105 } 103 }
106 #endif // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL 104 #endif // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL
107 105
108 /////////////////////////////////////////////////////////////////////////////// 106 ///////////////////////////////////////////////////////////////////////////////
109 107
110 } // namespace rtc 108 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698